Interbotix / interbotix_ros_toolboxes

Support-level ROS Packages for Interbotix Robots
BSD 3-Clause "New" or "Revised" License
29 stars 68 forks source link

XS Hardware Interface Crash #18

Closed drpjm closed 2 years ago

drpjm commented 2 years ago

We are receiving an error while sending a FollowJointTrajectoryGoal to our Locobot's arm controller:

terminate called after throwing an instance of 'std::runtime_error'
what(): Duration is out of dual 32-bit range

After instrumenting with some ROS logging, it seems that this error is thrown here: https://github.com/Interbotix/interbotix_ros_toolboxes/blob/1ed10f99f9ce7d5d77f65b5756d8f3f7a06bdc1e/interbotix_xs_toolbox/interbotix_xs_ros_control/src/xs_hardware_interface_obj.cpp#L91

This error occurs at seemingly random times as our trajectories execute fine most of the time. However, this error is not really explainable other than possibly a numerical issue with the difference calculation.

lukeschmitt-tr commented 2 years ago

This issue was somewhat resolved in an email exchange.

It seems like the error appears with some generated FollowJointTrajectoryGoal messages, but not others, and there is no clear reason why it happens. Adding a ROS_INFO call in the hardware update function seemingly prevented the issue from occurring. Adding try/catch statements as demonstrated in this gist can prevent crashing of the hardware interface.