WPILibC++ 2024.3.2
frc2::sysid::Mechanism Class Reference

#include <frc2/command/sysid/SysIdRoutine.h>

Public Member Functions

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

Public Attributes

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

Constructor & Destructor Documentation

◆ Mechanism() [1/2]

frc2::sysid::Mechanism::Mechanism ( std::function< void(units::volt_t)>  drive,
std::function< void(frc::sysid::SysIdRoutineLog *)>  log,
frc2::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]

frc2::sysid::Mechanism::Mechanism ( std::function< void(units::volt_t)>  drive,
std::function< void(frc::sysid::SysIdRoutineLog *)>  log,
frc2::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

◆ m_drive

std::function<void(units::volt_t)> frc2::sysid::Mechanism::m_drive

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

◆ m_log

std::function<void(frc::sysid::SysIdRoutineLog*)> frc2::sysid::Mechanism::m_log

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

◆ m_name

std::string frc2::sysid::Mechanism::m_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".

◆ m_subsystem

frc2::Subsystem* frc2::sysid::Mechanism::m_subsystem

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


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