Skip to content

Commit

Permalink
only stop thread if it exists, fixes ZebraDevs#18
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeferguson committed Sep 14, 2015
1 parent 519b780 commit 9ea4c66
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fetch_teleop/scripts/tuck_arm.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def is_moveit_running():
return True

def tuck():
move_thread = None
if not is_moveit_running():
rospy.loginfo("starting moveit")
move_thread = MoveItThread()
Expand All @@ -83,7 +84,8 @@ def tuck():
max_velocity_scaling_factor=0.5)
if result.error_code.val == MoveItErrorCodes.SUCCESS:
scene.removeCollisionObject("keepout")
move_thread.stop()
if move_thread:
move_thread.stop()
return

class TuckArmTeleop:
Expand Down

0 comments on commit 9ea4c66

Please sign in to comment.