CommonplaceRobotics / iRC_ROS

ROS2 packages for the igus Robot Control
Apache License 2.0
15 stars 7 forks source link

emergency button release while initializing ROS connection shuts down robot #100

Open JHeuverRiwo opened 1 year ago

JHeuverRiwo commented 1 year ago

Description Releasing the emergency stop button while ROS CAN interface is trying to initialize connection to the robot will shut the robot down.

Your environment ROS Distro: Humble OS Version: Ubuntu 22.04 Branch/Commit hash: git checkout 98-robot-joint-5-calibration-is-multiple-degrees-off Motor Module Firmware (seen in ROS): 03.03

To Reproduce

  1. Press the emergency stop button
  2. Start launchfile via "ros2 launch irc_ros_moveit_config rebel.launch.py rebel_version:=01 gripper:=none use_rviz:=true"
  3. Release the emergency button
  4. The robot turns off

Expected behavior After releasing the emergency button I expect the Motor module errors to be reset and to be able to use the robot afterwards through ROS.

Actual behavior before releasing the emergency button I see the following looping for all modules, which seems normal: [ros2_control_node-2] [INFO] [1683806812.386549141] [iRC_ROS]: Module 0x20: Errors ESTOP MNE detected, resetting

then after releasing I see the following in my terminal: [ros2_control_node-2] [INFO] [1683806812.436735060] [iRC_ROS]: Module 0x30: Errors MNE detected, resetting [ros2_control_node-2] [INFO] [1683806812.436746816] [iRC_ROS]: Module 0x30: Enabling motor [ros2_control_node-2] [INFO] [1683806812.436785812] [iRC_ROS]: Module 0x20: Errors MNE detected, resetting [ros2_control_node-2] [INFO] [1683806812.436793108] [iRC_ROS]: Module 0x20: Enabling motor [ros2_control_node-2] [INFO] [1683806812.436828495] [iRC_ROS]: Module 0x40: Errors MNE detected, resetting [ros2_control_node-2] [INFO] [1683806812.436835738] [iRC_ROS]: Module 0x40: Enabling motor [ros2_control_node-2] [INFO] [1683806812.436865125] [iRC_ROS]: Module 0x10: Errors MNE detected, resetting [ros2_control_node-2] [INFO] [1683806812.436872296] [iRC_ROS]: Module 0x10: Enabling motor [rviz2-7] [INFO] [1683806812.445249137] [move_group_interface]: Ready to take commands for planning group rebel_6dof. [ros2_control_node-2] [INFO] [1683806812.446343487] [iRC_ROS]: Module 0x30: Errorcode: 00000000 [ros2_control_node-2] [INFO] [1683806812.446363390] [iRC_ROS]: Module 0x30: Reset appears to have been successful, no errors remaining [ros2_control_node-2] [INFO] [1683806812.446371850] [iRC_ROS]: Module 0x30: Motor enabled [ros2_control_node-2] [INFO] [1683806812.446378945] [iRC_ROS]: Module 0x20: Errorcode: 00000000 [ros2_control_node-2] [INFO] [1683806812.446381979] [iRC_ROS]: Module 0x20: Reset appears to have been successful, no errors remaining [ros2_control_node-2] [INFO] [1683806812.446387250] [iRC_ROS]: Module 0x20: Motor enabled [ros2_control_node-2] [INFO] [1683806812.446393227] [iRC_ROS]: Module 0x40: Errorcode: 00000000 [ros2_control_node-2] [INFO] [1683806812.446396062] [iRC_ROS]: Module 0x40: Reset appears to have been successful, no errors remaining [ros2_control_node-2] [INFO] [1683806812.446401111] [iRC_ROS]: Module 0x40: Motor enabled [ros2_control_node-2] [INFO] [1683806812.446406941] [iRC_ROS]: Module 0x10: Errorcode: 00000000 [ros2_control_node-2] [INFO] [1683806812.446409769] [iRC_ROS]: Module 0x10: Reset appears to have been successful, no errors remaining [ros2_control_node-2] [INFO] [1683806812.446414888] [iRC_ROS]: Module 0x10: Motor enabled [ros2_control_node-2] [INFO] [1683806812.666333125] [iRC_ROS]: Module 0x50: Errorcode: 00000110 [ros2_control_node-2] [INFO] [1683806812.666353170] [iRC_ROS]: Module 0x50: Errors ESTOP MNE detected, motorstate set to disabled [ros2_control_node-2] [INFO] [1683806812.666356998] [iRC_ROS]: Module 0x50: Reset required [ros2_control_node-2] [ERROR] [1683806812.666372021] [iRC_ROS]: 0x50: Error detected with no recovery option, stopping entire hardware interface for safety reasons

And then the robot actually powers down. I have tried to replicate it using the Igus robot control software, but there the emergency stop seems to behave as expected. That is why it seems to me the issue could be in the ROS driver.

cpr-fer commented 1 year ago

Hi @JHeuverRiwo I am not sure how to fix this with the current code, as this looks like the modules briefly go into a no-errors state and then immediately go back to having some errors. I would suggest for now to always let the robot boot up fully before starting the ros nodes if that is possible for your setup

JHeuverRiwo commented 1 year ago

Hey @cpr-fer,

right now it is not causing us any real problems, so that's fine. Thanks for looking at it!