Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In Examples, Ctrl+C Errors on Exit with Simulated Robot #48

Closed
rethink-imcmahon opened this issue Sep 8, 2015 · 2 comments
Closed

In Examples, Ctrl+C Errors on Exit with Simulated Robot #48

rethink-imcmahon opened this issue Sep 8, 2015 · 2 comments

Comments

@rethink-imcmahon
Copy link
Contributor

A crossover issue from RethinkRobotics/baxter_simulator#58. The gist:
When running baxter_examples joint_velocity_wobbler.py on the baxter_simulator robot, and Ctrl+C is asserted by the user, various errors can be produced by rospy on exit:
A Timer Error:

~/ros_ws$ ./baxter.sh sim
~/ros_ws$ rosrun baxter_examples joint_velocity_wobbler.py
[INFO] [WallTime: 1441031503.775147] [128.230000] Robot Enabled
[INFO] [WallTime: 1441031549.388135] [173.643000] Robot Disabled
File "/home/baxter/ros_ws/src/baxter_examples/scripts/joint_velocity_wobbler.py", line 158, in
File "/home/baxter/ros_ws/src/baxter_examples/scripts/joint_velocity_wobbler.py", line 153, in
File "/home/baxter/ros_ws/src/baxter_examples/scripts/joint_velocity_wobbler.py", line 134, in
File "/opt/ros/indigo/lib/python2.7/dist­packages/rospy/timer.py", line 99, in sleep
File "/opt/ros/indigo/lib/python2.7/dist­packages/rospy/timer.py", line 157, in sleep
raise rospy.exceptions.ROSInterruptException("ROS shutdown request")
rospy.exceptions.ROSInterruptException: ROS shutdown request

A baxter_interface Limb Error:

$ rosrun baxter_examples joint_velocity_wobbler.py 
Initializing node... 
Getting robot state... 
Enabling robot... 
[INFO] [WallTime: 1441731848.427393] [7726.313000] Robot Enabled
Moving to neutral pose...
Left Moving to neutral pose complete...
Right Moving to neutral pose complete...
Wobbling. Press Ctrl-C to stop...
^C
Exiting example...
Moving to neutral pose...
Left Moving to neutral pose complete...
Right Moving to neutral pose complete...
Disabling robot...
[INFO] [WallTime: 1441731868.003786] [7745.839000] Robot Disabled
Finished shutdown check...
Traceback (most recent call last):
  File "/data/users/imcmahon/dev/mrsp_ws/src/baxter_examples/scripts/joint_velocity_wobbler.py", line 164, in <module>
    main()
  File "/data/users/imcmahon/dev/mrsp_ws/src/baxter_examples/scripts/joint_velocity_wobbler.py", line 159, in main
    wobbler.wobble()
  File "/data/users/imcmahon/dev/mrsp_ws/src/baxter_examples/scripts/joint_velocity_wobbler.py", line 136, in wobble
    self._right_arm.set_joint_velocities(cmd)
  File "/data/users/imcmahon/dev/mrsp_ws/src/baxter_interface/src/baxter_interface/limb.py", line 367, in set_joint_velocities
    self._pub_joint_cmd.publish(self._command_msg)
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rospy/topics.py", line 819, in publish
    self.impl.publish(data)
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rospy/topics.py", line 999, in publish
    b.tell()
AttributeError: 'NoneType' object has no attribute 'tell'

This is likely a rospy simulated_time timer issue, since the joint_velocity_wobbler script does not error like this on the real robot, but it is desirable to find a fix that would prevent this issue entirely.

rethink-imcmahon pushed a commit that referenced this issue Sep 8, 2015
This commit removes reliance on rospy for handling the shutdown
behavior when a Ctrl+C signal is asserted on the joint_velocity_wobbler
example. Cleanup was not properly being executed in only the
simulated robot through rospy's on_shutdown() callback handler. This
change has been tested on both the simulated and real Baxter robots.
rethink-imcmahon pushed a commit that referenced this issue Sep 8, 2015
This commit removes reliance on rospy for handling the shutdown
behavior when a Ctrl+C signal is asserted on the joint_velocity_wobbler
example. Cleanup was not properly being executed in only the
simulated robot through rospy's on_shutdown() callback handler. This
change has been tested on both the simulated and real Baxter robots.
rethink-imcmahon pushed a commit that referenced this issue Sep 8, 2015
This commit removes reliance on rospy for handling the shutdown
behavior when a Ctrl+C signal is asserted on the joint_velocity_wobbler
example. Cleanup was not properly being executed in only the
simulated robot through rospy's on_shutdown() callback handler. This
change has been tested on both the simulated and real Baxter robots.
@rethink-imcmahon rethink-imcmahon changed the title joint_velocity_wobbler Errors on Exit with Simulated Robot In Examples, Ctrl+C Errors on Exit with Simulated Robot Sep 8, 2015
@rethink-imcmahon
Copy link
Contributor Author

Either this should get fixed in all 13 of our examples with on_shutdown behavior or the root cause needs to be sussed out in ros_comm/rospy in simulation

dirk-thomas pushed a commit to ros/ros_comm that referenced this issue Nov 9, 2015
Timers go off and start periodically running in the background, and will throw exceptions when ros shutdown occurs because of the sleep function.

These are impossible to catch as they're off in a background thread and can be cleanly handled as in the code change.

Others with the same problem:

* [baxter examples](RethinkRobotics/baxter_examples#48)
@rethink-imcmahon
Copy link
Contributor Author

Appears there was an underlying rospy issue in ros_comm:
ros/ros_comm@2e84880
ros/ros_comm#690

@stonier thanks for fixing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants