ocs2 icon indicating copy to clipboard operation
ocs2 copied to clipboard

Useless subscription to /legged_robot_mode_schedule

Open IoannisDadiotis opened this issue 2 years ago • 1 comments

When running the legged_robot_ddp.launch example there are two similar topics which create a bit of confusion, the /legged_robot_mode_schedule and /legged_robot_mpc_mode_schedule.

The first one has only a single subscriber, the mpc node, and does not seem to be useful at all. This subscription is created in the code below: https://github.com/leggedrobotics/ocs2/blob/ebde452b10d0eceaac45364f7bb8f0ac1038b637/ocs2_ros_interfaces/src/synchronized_module/RosReferenceManager.cpp#L57

Is there any reason for the existence of this subscription? In my opinion it could be removed since the mpc has already all the necessary info regarding the mode schedule from the /legged_robot_mpc_mode_schedule topic through the GaitReceiver object.

IoannisDadiotis avatar Feb 24 '23 15:02 IoannisDadiotis

hey, any help ? can't use /legged_robot_mpc_mode_schedule topic correctly !

rostopic pub -1 /legged_robot_mpc_mode_schedule ocs2_msgs/mode_schedule "eventTimes:
- [0,0.5]
modeSequence:
- [15]"

No error at topic, correctly sent.

doesn't produce a stance mode on gazebo !

however, original command work ! :

Enter the desired gait, for the list of available gait enter "list": stance
Enter the desired gait, for the list of available gait enter "list": [GaitReceiver]: Setting new gait after time 245.471
Template switching times: {0, 0.5}
Template mode sequence:   {15}

elpimous avatar Jul 14 '23 16:07 elpimous