Implements an abstract class for leg controllers.
More...
#include <leg_controller.h>
|
| LegController () |
| Constructor for LegController.
|
|
virtual void | init (double kp, double kd) |
| Set the desired proportional and derivative gains for all legs.
|
|
virtual void | init (const std::vector< double > &kp, const std::vector< double > &kd) |
| Set the desired proportional and derivative gains for each leg.
|
|
virtual void | init (const std::vector< double > &stance_kp, const std::vector< double > &stance_kd, const std::vector< double > &swing_kp, const std::vector< double > &swing_kd, const std::vector< double > &swing_kp_cart, const std::vector< double > &swing_kd_cart) |
| Set the desired stance and swing proportional and derivative gains.
|
|
void | updateLocalPlanMsg (quad_msgs::RobotPlan::ConstPtr msg, const ros::Time &t_msg) |
| Compute the leg command array message for a given current state and reference plan.
|
|
virtual bool | computeLegCommandArray (const quad_msgs::RobotState &robot_state_msg, quad_msgs::LegCommandArray &leg_command_array_msg, quad_msgs::GRFArray &grf_array_msg)=0 |
| Compute the leg command array message.
|
|
bool | overrideStateMachine () |
|
|
const int | num_feet_ = 4 |
| Number of feet.
|
|
std::shared_ptr< quad_utils::QuadKD > | quadKD_ |
| QuadKD class.
|
|
std::vector< double > | stance_kp_ |
| PD gain when foot is in stance.
|
|
std::vector< double > | stance_kd_ |
|
std::vector< double > | swing_kp_ |
| PD gain when foot is in swing.
|
|
std::vector< double > | swing_kd_ |
|
std::vector< double > | swing_kp_cart_ |
| PD gain when foot is in swing (Cartesian)
|
|
std::vector< double > | swing_kd_cart_ |
|
quad_msgs::RobotPlan::ConstPtr | last_local_plan_msg_ |
| Last local plan message.
|
|
ros::Time | last_local_plan_time_ |
| Time of last local plan message.
|
|
bool | override_state_machine_ |
| Bool for whether to override the state machine.
|
|
Implements an abstract class for leg controllers.
LegController provides an abstract leg controller class. It contains pure virtual methods for computing motor commands for each leg to be sent to the robot.
◆ LegController()
LegController::LegController |
( |
| ) |
|
◆ computeLegCommandArray()
virtual bool LegController::computeLegCommandArray |
( |
const quad_msgs::RobotState & |
robot_state_msg, |
|
|
quad_msgs::LegCommandArray & |
leg_command_array_msg, |
|
|
quad_msgs::GRFArray & |
grf_array_msg |
|
) |
| |
|
pure virtual |
◆ init() [1/3]
void LegController::init |
( |
const std::vector< double > & |
kp, |
|
|
const std::vector< double > & |
kd |
|
) |
| |
|
virtual |
Set the desired proportional and derivative gains for each leg.
- Parameters
-
[in] | kp | Proportional gains |
[in] | kd | Derivative gains |
◆ init() [2/3]
void LegController::init |
( |
const std::vector< double > & |
stance_kp, |
|
|
const std::vector< double > & |
stance_kd, |
|
|
const std::vector< double > & |
swing_kp, |
|
|
const std::vector< double > & |
swing_kd, |
|
|
const std::vector< double > & |
swing_kp_cart, |
|
|
const std::vector< double > & |
swing_kd_cart |
|
) |
| |
|
virtual |
Set the desired stance and swing proportional and derivative gains.
- Parameters
-
[in] | stance_kp | Stance phase proportional gains |
[in] | stance_kd | Stance phase derivative gains |
[in] | swing_kp | Swing phase proportional gains |
[in] | swing_kd | Swing phase derivative gains |
[in] | swing_kp_cart | Cartesian Swing phase proportional gains |
[in] | swing_kd_cart | Cartesian Swing phase derivative gains |
◆ init() [3/3]
void LegController::init |
( |
double |
kp, |
|
|
double |
kd |
|
) |
| |
|
virtual |
Set the desired proportional and derivative gains for all legs.
- Parameters
-
[in] | kp | Proportional gains |
[in] | kd | Derivative gains |
◆ updateLocalPlanMsg()
void LegController::updateLocalPlanMsg |
( |
quad_msgs::RobotPlan::ConstPtr |
msg, |
|
|
const ros::Time & |
t_msg |
|
) |
| |
Compute the leg command array message for a given current state and reference plan.
- Parameters
-
[in] | local_plan_msg | Message of the local referance plan |
The documentation for this class was generated from the following files:
- robot_driver/include/robot_driver/controllers/leg_controller.h
- robot_driver/src/controllers/leg_controller.cpp