Added check for base_controller before stopping robot when node exits

This commit is contained in:
Patrick Goebel 2015-12-14 18:32:17 -08:00
parent 702624e336
commit 932282526d

View File

@ -266,12 +266,13 @@ class ArduinoROS():
return AnalogReadResponse(value) return AnalogReadResponse(value)
def shutdown(self): def shutdown(self):
rospy.loginfo("Shutting down Arduino Node...") rospy.loginfo("Shutting down Arduino node...")
# Stop the robot # Stop the robot
rospy.loginfo("Stopping the robot...") if self.use_base_controller:
self.cmd_vel_pub.publish(Twist()) rospy.loginfo("Stopping the robot...")
rospy.sleep(2) self.cmd_vel_pub.publish(Twist())
rospy.sleep(2)
# Detach any servos # Detach any servos
if self.have_joints: if self.have_joints: