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/
174 stars 86 forks source link

Add stow robot service and fix home robot service in stretch_driver #83

Closed hello-binit closed 1 year ago

hello-binit commented 1 year ago

This PR adds a service called /stow_the_robot to stretch driver, which will stow the robot's arm regardless of the gripper attached to the end of arm. Internally, it calls robot.stow() which knows what gripper is installed and how to stow that gripper thanks to the Tool interface.

Additionally, as part of development of the stowing service, we found a threading bug in the similar /calibrate_the_robot service. This is fixed by managing mode state and its locking more carefully. In particular, this bug allowed users to accidentally concurrently control the robot while homing, which could have caused USB communication errors if not for the GIL (and if Stretch Body's threading models changes in the future, the GIL would stop saving us here). This bug also blocked the main stretch_driver loop from executing, so the mode topic, joint states topic, and other topics whose publishers are within that loop would stop publishing messages until the homing/stowing action completed.

Finally, there is API documentation added on both of these services.