Quad-SDK
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
InverseDynamicsController Class Reference

Implements inverse dynamics as a controller within the ROS framework. More...

#include <inverse_dynamics_controller.h>

Inheritance diagram for InverseDynamicsController:
Inheritance graph
[legend]
Collaboration diagram for InverseDynamicsController:
Collaboration graph
[legend]

Public Member Functions

 InverseDynamicsController ()
 Constructor for InverseDynamicsController.
 
bool computeLegCommandArray (const quad_msgs::RobotState &robot_state_msg, quad_msgs::LegCommandArray &leg_command_array_msg, quad_msgs::GRFArray &grf_array_msg)
 Compute the leg command array message for a given current state and reference plan.
 
quad_msgs::RobotState getReferenceState ()
 Return the reference state used for current tracking.
 
- Public Member Functions inherited from LegController
 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.
 
bool overrideStateMachine ()
 

Private Attributes

Eigen::VectorXd last_grf_array_
 Prior grf_array.
 
quad_msgs::RobotState ref_state_msg_
 Reference state for tracking.
 
const double grf_exp_filter_const_ = 1.0
 GRF exponential filter constant.
 

Additional Inherited Members

- Protected Attributes inherited from LegController
const int num_feet_ = 4
 Number of feet.
 
std::shared_ptr< quad_utils::QuadKDquadKD_
 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.
 

Detailed Description

Implements inverse dynamics as a controller within the ROS framework.

InverseDynamicsController implements inverse dynamics logic. It should expose a constructor that does any initialization required and an update method called at some frequency.

Constructor & Destructor Documentation

◆ InverseDynamicsController()

InverseDynamicsController::InverseDynamicsController ( )

Constructor for InverseDynamicsController.

Returns
Constructed object of type InverseDynamicsController

Member Function Documentation

◆ computeLegCommandArray()

bool InverseDynamicsController::computeLegCommandArray ( const quad_msgs::RobotState &  robot_state_msg,
quad_msgs::LegCommandArray &  leg_command_array_msg,
quad_msgs::GRFArray &  grf_array_msg 
)
virtual

Compute the leg command array message for a given current state and reference plan.

Parameters
[in]robot_state_msgMessage of the current robot state
[out]leg_command_array_msgCommand message after solving inverse dynamics and including reference setpoints for each joint
[out]grf_array_msgGRF command message

Implements LegController.

◆ getReferenceState()

quad_msgs::RobotState InverseDynamicsController::getReferenceState ( )
inline

Return the reference state used for current tracking.

Returns
Reference state

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