Cheetah Software
1.0
|
#include <LegController.h>
Public Member Functions | |
LegController (Quadruped< T > &quad) | |
void | zeroCommand () |
void | edampCommand (RobotType robot, T gain) |
void | updateData (const SpiData *spiData) |
void | updateData (const TiBoardData *tiBoardData) |
void | updateCommand (SpiCommand *spiCommand) |
void | updateCommand (TiBoardCommand *tiBoardCommand) |
void | setEnabled (bool enabled) |
void | setLcm (leg_control_data_lcmt *data, leg_control_command_lcmt *command) |
void | setMaxTorqueCheetah3 (T tau) |
Public Attributes | |
LegControllerCommand< T > | commands [4] |
LegControllerData< T > | datas [4] |
Quadruped< T > & | _quadruped |
bool | _legsEnabled = false |
T | _maxTorque = 0 |
Definition at line 49 of file LegController.h.
|
inline |
Definition at line 51 of file LegController.h.
void LegController< T >::edampCommand | ( | RobotType | robot, |
T | gain | ||
) |
Set the leg to edamp. This overwrites all command data and generates an emergency damp command using the given gain. For the mini-cheetah, the edamp gain is Nm/(rad/s), and for the Cheetah 3 it is N/m. You still must call updateCommand for this command to end up in the low-level command data!
Definition at line 62 of file LegController.cpp.
References CHEETAH_3.
|
inline |
void LegController< T >::setLcm | ( | leg_control_data_lcmt * | data, |
leg_control_command_lcmt * | command | ||
) |
|
inline |
Set the maximum torque. This only works on cheetah 3!
Definition at line 67 of file LegController.h.
void LegController< T >::updateCommand | ( | SpiCommand * | spiCommand | ) |
Update the "leg command" for the SPIne board message
Definition at line 126 of file LegController.cpp.
References SpiCommand::flags, SpiCommand::kd_abad, SpiCommand::kd_hip, SpiCommand::kd_knee, SpiCommand::kp_abad, SpiCommand::kp_hip, SpiCommand::kp_knee, SpiCommand::q_des_abad, SpiCommand::q_des_hip, SpiCommand::q_des_knee, SpiCommand::qd_des_abad, SpiCommand::qd_des_hip, SpiCommand::qd_des_knee, SpiCommand::tau_abad_ff, SpiCommand::tau_hip_ff, and SpiCommand::tau_knee_ff.
void LegController< T >::updateCommand | ( | TiBoardCommand * | tiBoardCommand | ) |
Update the "leg command" for the TI Board
Definition at line 180 of file LegController.cpp.
References TiBoardCommand::enable, TiBoardCommand::force_ff, TiBoardCommand::kd, TiBoardCommand::kp, TiBoardCommand::max_torque, TiBoardCommand::position_des, TiBoardCommand::tau_ff, and TiBoardCommand::velocity_des.
void LegController< T >::updateData | ( | const SpiData * | spiData | ) |
Update the "leg data" from a SPIne board message
Definition at line 83 of file LegController.cpp.
References SpiData::q_abad, SpiData::q_hip, SpiData::q_knee, SpiData::qd_abad, SpiData::qd_hip, and SpiData::qd_knee.
void LegController< T >::updateData | ( | const TiBoardData * | tiBoardData | ) |
Update the "leg data" from a TI Board message
Definition at line 108 of file LegController.cpp.
References TiBoardData::dq, TiBoardData::position, TiBoardData::q, TiBoardData::tau, and TiBoardData::velocity.
void LegController< T >::zeroCommand | ( | ) |
Zero all leg commands. This should be run before any control code, so if the control code is confused and doesn't change the leg command, the legs won't remember the last command.
Definition at line 48 of file LegController.cpp.
bool LegController< T >::_legsEnabled = false |
Definition at line 72 of file LegController.h.
T LegController< T >::_maxTorque = 0 |
Definition at line 73 of file LegController.h.
Quadruped<T>& LegController< T >::_quadruped |
Definition at line 71 of file LegController.h.
LegControllerCommand<T> LegController< T >::commands[4] |
Definition at line 69 of file LegController.h.
LegControllerData<T> LegController< T >::datas[4] |
Definition at line 70 of file LegController.h.