File tree Expand file tree Collapse file tree 4 files changed +34
-1
lines changed
rm_common/include/rm_common/decision Expand file tree Collapse file tree 4 files changed +34
-1
lines changed Original file line number Diff line number Diff line change 5151#include < rm_msgs/GameRobotHp.h>
5252#include < rm_msgs/StatusChangeRequest.h>
5353#include < rm_msgs/ShootData.h>
54+ #include < rm_msgs/LegCmd.h>
5455#include < geometry_msgs/TwistStamped.h>
5556#include < sensor_msgs/JointState.h>
5657#include < nav_msgs/Odometry.h>
@@ -564,6 +565,32 @@ class BalanceCommandSender : public CommandSenderBase<std_msgs::UInt8>
564565 void setZero () override {};
565566};
566567
568+ class LegCommandSender : public CommandSenderBase <rm_msgs::LegCmd>
569+ {
570+ public:
571+ explicit LegCommandSender (ros::NodeHandle& nh) : CommandSenderBase<rm_msgs::LegCmd>(nh)
572+ {
573+ }
574+
575+ void setJump (bool jump)
576+ {
577+ msg_.jump = jump;
578+ }
579+ void setLgeLength (double length)
580+ {
581+ msg_.leg_length = length;
582+ }
583+ bool getJump ()
584+ {
585+ return msg_.jump ;
586+ }
587+ double getLgeLength ()
588+ {
589+ return msg_.leg_length ;
590+ }
591+ void setZero () override {};
592+ };
593+
567594class Vel3DCommandSender : public HeaderStampCommandSenderBase <geometry_msgs::TwistStamped>
568595{
569596public:
Original file line number Diff line number Diff line change @@ -66,6 +66,8 @@ class PowerLimit
6666 ROS_ERROR (" power gain no defined (namespace: %s)" , nh.getNamespace ().c_str ());
6767 if (!nh.getParam (" buffer_threshold" , buffer_threshold_))
6868 ROS_ERROR (" buffer threshold no defined (namespace: %s)" , nh.getNamespace ().c_str ());
69+ if (!nh.getParam (" is_new_capacitor" , is_new_capacitor_))
70+ ROS_ERROR (" is_new_capacitor no defined (namespace: %s)" , nh.getNamespace ().c_str ());
6971 }
7072 typedef enum
7173 {
@@ -124,7 +126,7 @@ class PowerLimit
124126 chassis_cmd.power_limit = burst_power_;
125127 else
126128 {
127- switch (cap_state_)
129+ switch (is_new_capacitor_ ? expect_state_ : cap_state_)
128130 {
129131 case NORMAL:
130132 normal (chassis_cmd);
@@ -186,6 +188,7 @@ class PowerLimit
186188 double charge_power_{}, extra_power_{}, burst_power_{};
187189 double buffer_threshold_{};
188190 double power_gain_{};
191+ bool is_new_capacitor_{};
189192 uint8_t expect_state_{}, cap_state_{};
190193
191194 bool referee_is_online_{ false };
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ add_message_files(
2222 GimbalCmd.msg
2323 GimbalDesError.msg
2424 GimbalPosState.msg
25+ LegCmd.msg
2526 LpData.msg
2627 LocalHeatState.msg
2728 KalmanData.msg
Original file line number Diff line number Diff line change 1+ bool jump
2+ float64 leg_length
You can’t perform that action at this time.
0 commit comments