3 #include "std_msgs/Empty.h"
4 #include "std_msgs/Bool.h"
5 #include "std_msgs/Float64.h"
6 #include "std_msgs/Float64MultiArray.h"
7 #include "sensor_msgs/JointState.h"
8 #include "geometry_msgs/Twist.h"
9 #include "std_srvs/Empty.h"
10 #include "eigen_conversions/eigen_msg.h"
23 #define UNINITIALIZED_JOINT_STATE 10.0
24 #define ROBOT_NAME "my_robot"
25 #define LEG_OFFSET_LENGTH 0.25
26 #define NUMBER_OF_LEGS 4
27 #define ACTUATORS_PER_LEG 3
30 protected:
using JointState = Eigen::Matrix<double, 12, 1>;
49 public:
void StandStill(
const double &duration);
53 public:
void SetTwistCommand(
double lin_vel_cmd_x,
double lin_vel_cmd_y,
double ang_vel_cmd_z);
60 Eigen::Matrix<double, 3, 1> fr_goal_foot_pos,
61 Eigen::Matrix<double, 3, 1> rl_goal_foot_pos,
62 Eigen::Matrix<double, 3, 1> rr_goal_foot_pos);
93 std_srvs::Empty::Response &_res);
100 public:
bool Shutdown(std_srvs::Empty::Request &_req,
101 std_srvs::Empty::Response &_res);
181 protected: Eigen::Matrix<double, 6, 1>
base_pose_state = Eigen::Matrix<double, 6, 1>::Zero();
Eigen::Vector3d fr_offset
bool UpdateJointCommands()
ros::NodeHandlePtr nodeHandle
void TwistCommandCallback(const geometry_msgs::TwistConstPtr &_msg)
Converts twist command messages into desired linear and angular body velocities.
Eigen::Vector3d fl_acceleration_body
double _ang_vel_x_measured
double _lin_vel_x_estimated
void jointStateCallback(const sensor_msgs::JointStatePtr &msg)
double _lin_vel_y_estimated
Eigen::Vector3d fl_offset
double lin_vel_y
The desired linear robot velocity in the body frame's y direction.
void SetReadyToProceedFlag()
bool CheckReadyToProceed()
ros::Publisher joint_state_logger
Eigen::Vector3d fl_velocity_body
ros::Subscriber ready_to_proceed_subscriber
void BasePoseStateCallback(const std_msgs::Float64MultiArrayConstPtr &msg)
Eigen::Vector3d rr_offset
bool UpdateVelocityCommands()
ros::Publisher base_twist_state_logger
Eigen::Vector3d rl_position_body
ros::Subscriber twist_command_subscriber
Subscribes to twist command messages from an external controller.
double _ang_vel_y_measured
ros::Subscriber base_pose_state_subscriber
ros::Publisher joint_command_publisher
void ResetReadyToProceedFlag()
void StandStill(const double &duration)
Controller(int controller_freq)
Eigen::Vector3d rl_acceleration_body
bool ReadyToProceed(std_srvs::Empty::Request &_req, std_srvs::Empty::Response &_res)
The ReadyToProceed function handles an incoming readyToProceed service request.
JointState joint_velocity_commands
void WaitForInitialState()
void readyToProceedCallback(const std_msgs::Bool &msg)
JointState joint_acceleration_commands
Eigen::Matrix< double, 6, 1 > base_pose_commands
Eigen::Vector3d fl_position_body
void TwistStateCallback(const geometry_msgs::TwistConstPtr &_msg)
double _ang_vel_z_estimated
virtual void UpdateFeetReferences()=0
Eigen::Vector3d rr_position_body
double ang_vel_z
The desired angular robot velocity around the robot's z axis.
Eigen::Matrix< double, 6, 1 > base_pose_state
ros::Subscriber twist_state_subscriber
void UpdateFeetPositions()
ros::Publisher joint_command_logger
Eigen::Vector3d fr_acceleration_body
Eigen::Vector3d fr_position_body
bool MoveFootToPosition(const Kinematics::LegType &leg_type, const Eigen::Matrix< double, 3, 1 > &goal_foot_position)
bool Shutdown(std_srvs::Empty::Request &_req, std_srvs::Empty::Response &_res)
The Shutdown function handles an incoming shutdown service request.
bool MoveFeetToPositions(Eigen::Matrix< double, 3, 1 > fl_goal_foot_pos, Eigen::Matrix< double, 3, 1 > fr_goal_foot_pos, Eigen::Matrix< double, 3, 1 > rl_goal_foot_pos, Eigen::Matrix< double, 3, 1 > rr_goal_foot_pos)
ros::Publisher base_twist_command_logger
double lin_vel_x
The desired linear robot velocity in the body frame's x direction.
ros::Publisher base_pose_state_logger
Eigen::Vector3d rr_velocity_body
Eigen::Vector3d rl_offset
void waitForReadyToProceed()
Eigen::Vector3d rr_acceleration_body
ros::Subscriber joint_state_subscriber
ros::ServiceServer shutdownService
ROS Shutdown Service.
ros::ServiceServer readyToProceedService
ROS Ready to Proceed Service.
JointState joint_torque_commands
JointState joint_angle_commands
Eigen::Vector3d rl_velocity_body
void SetTwistCommand(double lin_vel_cmd_x, double lin_vel_cmd_y, double ang_vel_cmd_z)
Eigen::Matrix< double, 12, 1 > JointState
double _lin_vel_z_measured
double nominal_base_height
bool RunStandUpSequence()
bool sendJointPositionCommands()
JointState joint_velocities
bool MoveJointsToSetpoints(Eigen::Matrix< double, 12, 1 > goal_joint_angles)
virtual void setInitialConfiguration()
ros::Publisher base_pose_command_logger
Eigen::Vector3d fr_velocity_body
A class for analytical Kinematics Solving.
LegType
Leg type enumerator.
#define LEG_OFFSET_LENGTH
#define UNINITIALIZED_JOINT_STATE