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

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

#include <grf_pid_controller.h>

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

Public Member Functions

 GrfPidController ()
 Constructor for GrfPidController.
 
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.
 
- 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::Vector3d pos_des_
 Desired position.
 
Eigen::Vector3d ang_des_
 Desired orientation.
 
Eigen::Vector3d pos_error_int_
 Position error integral.
 
Eigen::Vector3d ang_error_int_
 Orientation error integral.
 
ros::Time t_old_
 Timekeeping variable for integral term.
 

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.

GrfPidController 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

◆ GrfPidController()

GrfPidController::GrfPidController ( )

Constructor for GrfPidController.

Returns
Constructed object of type GrfPidController

Member Function Documentation

◆ computeLegCommandArray()

bool GrfPidController::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
[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.


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