23class VMCController :
public controller_interface::MultiInterfaceController<hardware_interface::EffortJointInterface,
24 rm_control::RobotStateInterface>
28 bool init(hardware_interface::RobotHW* robot_hw, ros::NodeHandle& root_nh, ros::NodeHandle& controller_nh)
override;
29 void update(
const ros::Time& time,
const ros::Duration& period)
override;
30 void starting(
const ros::Time& )
override;
33 void commandLegLengthCB(
const std_msgs::Float64ConstPtr& msg)
35 lengthCmd_ = msg->data;
38 void commandLegAngleCB(
const std_msgs::Float64ConstPtr& msg)
40 angleCmd_ = msg->data;
43 static inline double get_LM(
const double& l)
45 return 0.218f * l + 0.075f;
48 static inline double get_theta_leg_offset(
const double& l)
53 const double g_{ 9.81 };
55 double f_spring_force(
double L0);
56 double s2_{}, s3_{}, alpha_s_{};
58 bool leg_gravity_compensation_debug_{
false };
59 double leg_mass_{ 1.5 };
61 hardware_interface::JointHandle jointThigh_, jointKnee_;
62 control_toolbox::Pid pidLength_, pidAngle_;
64 double vmcBiasAngle_, spring_force_;
65 double lengthCmd_, angleCmd_;
67 std::unique_ptr<VMC> vmcPtr_;
69 ros::Publisher statePublisher_, jointCmdStatePublisher_;
70 ros::Subscriber cmdLegLengthSubscriber_, cmdLegAngleSubscriber_;
71 std::shared_ptr<DebugDataPublisher> debugPub_;