WPILibC++ 2027.0.0-alpha-5
Loading...
Searching...
No Matches
wpi::cmd::sysid::Mechanism Class Reference

#include <wpi/commands2/sysid/SysIdRoutine.hpp>

Public Member Functions

 Mechanism (std::function< void(wpi::units::volt_t)> drive, std::function< void(wpi::sysid::SysIdRoutineLog *)> log, wpi::cmd::Subsystem *subsystem, std::string_view name)
 Create a new mechanism specification for a SysId routine.
 Mechanism (std::function< void(wpi::units::volt_t)> drive, std::function< void(wpi::sysid::SysIdRoutineLog *)> log, wpi::cmd::Subsystem *subsystem)
 Create a new mechanism specification for a SysId routine.

Public Attributes

std::function< void(wpi::units::volt_t)> drive
 Sends the SysId-specified drive signal to the mechanism motors during test routines.
std::function< void(wpi::sysid::SysIdRoutineLog *)> log
 Returns measured data (voltages, positions, velocities) of the mechanism motors during test routines.
wpi::cmd::Subsystemsubsystem
 The subsystem containing the motor(s) that is (or are) being characterized.
std::string name
 The name of the mechanism being tested.

Constructor & Destructor Documentation

◆ Mechanism() [1/2]

wpi::cmd::sysid::Mechanism::Mechanism ( std::function< void(wpi::units::volt_t)> drive,
std::function< void(wpi::sysid::SysIdRoutineLog *)> log,
wpi::cmd::Subsystem * subsystem,
std::string_view name )
inline

Create a new mechanism specification for a SysId routine.

Parameters
driveSends the SysId-specified drive signal to the mechanism motors during test routines.
logReturns measured data of the mechanism motors during test routines. To return data, call Motor(string motorName) on the supplied SysIdRoutineLog instance, and then call one or more of the chainable logging handles (e.g. voltage) on the returned MotorLog. Multiple motors can be logged in a single callback by calling Motor multiple times.
subsystemThe subsystem containing the motor(s) that is (or are) being characterized. Will be declared as a requirement for the returned test commands.
nameThe name of the mechanism being tested. Will be appended to the log entry * title for the routine's test state, e.g. "sysid-test-state-mechanism". Defaults to the name of the subsystem if left null.

◆ Mechanism() [2/2]

wpi::cmd::sysid::Mechanism::Mechanism ( std::function< void(wpi::units::volt_t)> drive,
std::function< void(wpi::sysid::SysIdRoutineLog *)> log,
wpi::cmd::Subsystem * subsystem )
inline

Create a new mechanism specification for a SysId routine.

Defaults the mechanism name to the subsystem name.

Parameters
driveSends the SysId-specified drive signal to the mechanism motors during test routines.
logReturns measured data of the mechanism motors during test routines. To return data, call Motor(string motorName) on the supplied SysIdRoutineLog instance, and then call one or more of the chainable logging handles (e.g. voltage) on the returned MotorLog. Multiple motors can be logged in a single callback by calling Motor multiple times.
subsystemThe subsystem containing the motor(s) that is (or are) being characterized. Will be declared as a requirement for the returned test commands. The subsystem's name will be appended to the log entry title for the routine's test state, e.g. "sysid-test-state-subsystem".

Member Data Documentation

◆ drive

std::function<void(wpi::units::volt_t)> wpi::cmd::sysid::Mechanism::drive

Sends the SysId-specified drive signal to the mechanism motors during test routines.

◆ log

std::function<void(wpi::sysid::SysIdRoutineLog*)> wpi::cmd::sysid::Mechanism::log

Returns measured data (voltages, positions, velocities) of the mechanism motors during test routines.

◆ name

std::string wpi::cmd::sysid::Mechanism::name

The name of the mechanism being tested.

Will be appended to the log entry title for the routine's test state, e.g. "sysid-test-state-mechanism".

◆ subsystem

wpi::cmd::Subsystem* wpi::cmd::sysid::Mechanism::subsystem

The subsystem containing the motor(s) that is (or are) being characterized.


The documentation for this class was generated from the following file: