hello-robot / stretch_ros2

ROS 2 packages for the Stretch mobile manipulators from Hello Robot Inc.
https://docs.hello-robot.com/0.2/stretch-tutorials/ros2/
51 stars 19 forks source link

Cannot send zero command to translate_mobile_base joint #124

Open hello-binit opened 2 weeks ago

hello-binit commented 2 weeks ago

This issue was reported by a Stretch user that discovered sending a zero command to the "translate_mobile_base" joint causes the driver to throw the following error:

[stretch_driver-3] [INFO] [1714621166.544765799] [joint_trajectory_action]: Received goal request
[stretch_driver-3] [INFO] [1714621166.547108618] [stretch_driver]: stretch_driver joint_traj action: New trajectory received with joint_names = ['translate_mobile_base']
[stretch_driver-3] [ERROR] [1714621166.547873219] [stretch_driver]: Error raised in execute callback: cannot unpack non-iterable NoneType object
[stretch_driver-3] Traceback (most recent call last):
[stretch_driver-3]   File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/action/server.py", line 325, in _execute_goal
[stretch_driver-3]     execute_result = await await_or_execute(execute_callback, goal_handle)
[stretch_driver-3]   File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 107, in await_or_execute
[stretch_driver-3]     return callback(*args)
[stretch_driver-3]   File "/home/hello-robot/ament_ws/install/stretch_core/lib/python3.10/site-packages/stretch_core/joint_trajectory_server.py", line 182, in execute_cb
[stretch_driver-3]     c.init_execution(self.node.robot, robot_status)
[stretch_driver-3]   File "/home/hello-robot/ament_ws/install/stretch_core/lib/python3.10/site-packages/stretch_core/command_groups.py", line 649, in init_execution
[stretch_driver-3]     (_, mobile_base_error_m), (_, mobile_base_error_rad) = self.update_execution(robot_status)
[stretch_driver-3] TypeError: cannot unpack non-iterable NoneType object

This issue is reproducible using:

  1. Launch Stretch Driver on the robot: ros2 launch stretch_core stretch_driver.launch.py
  2. Run the following code: https://gist.github.com/hello-binit/4eee80b0c3842aa2e55eba9b535e5ce3
  3. Changing the 0.0 to 0.0001 in this script will make it so the exception does not appear.