hello-robot / stretch_ros

ROS packages for the Stretch mobile manipulators from Hello Robot Inc.
https://docs.hello-robot.com/0.2/stretch-tutorials/ros1/
167 stars 84 forks source link

Command Group status effort_pct key fix #78

Closed hello-fazil closed 1 year ago

hello-fazil commented 1 year ago

This PR changes the motor status key from 'effort' to 'effort_pct' in command groups, the only new supported unit system of stretch_ros with the new stretch_body 0.4.0.

hello-binit commented 1 year ago

@hello-fazil Do the other joints also use "effort_pct" over "effort" in the status dictionary?

If so, this would need to be change for the other joints. For example, here for the Head Pan joint:

https://github.com/hello-robot/stretch_ros/blob/fac882ecbcdfb30fe2caff125e96168b90a04b97/stretch_core/nodes/command_groups.py#L48-L52

aedsinger commented 1 year ago

Note that currently on stretch_body.stepper the value of motor.status['effort'] is the commanded value to the stepper motor driver (-255 to 255). With v0.4 this is renamed to 'effort_ticks', the ticks denoting that the units are the raw value.

With v0.4 we now also provide motor.status['effor_pct']., which is a -100 to 100 value, where 100 is the maximum allowable current to the winding (as defined in Yaml as iMax_pos/neg

https://github.com/hello-robot/stretch_body/blob/feature/mitski_pre_release/body/stretch_body/stepper.py

hello-fazil commented 1 year ago

@hello-binit All the dynamixels joints still produce their effort status with only the 'effort' key, and the 'effort_pct' key is used only with the other joints that use a stepper motor, i.e., right_wheel, left_wheel, arm, and lift. So we wouldn't need to change the effort key for the head and wrist joints.