Add execute homing on ROS node exit
This commit is contained in:
@@ -68,6 +68,12 @@ class AxidrawSerial(Node):
|
|||||||
response.status = self.status.get(request.resource, "Resource '{}' not found.".format(request.resource))
|
response.status = self.status.get(request.resource, "Resource '{}' not found.".format(request.resource))
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
def go_home(self):
|
||||||
|
self.status["motion"] = "busy"
|
||||||
|
if self.status["serial"] == "ready":
|
||||||
|
self.ad.moveto(0,0)
|
||||||
|
self.status["motion"] = "ready"
|
||||||
|
|
||||||
def set_busy(self):
|
def set_busy(self):
|
||||||
self.status["motion"] = "busy"
|
self.status["motion"] = "busy"
|
||||||
|
|
||||||
@@ -114,7 +120,7 @@ def main(args=None):
|
|||||||
axidraw_serial = AxidrawSerial()
|
axidraw_serial = AxidrawSerial()
|
||||||
|
|
||||||
rclpy.spin(axidraw_serial)
|
rclpy.spin(axidraw_serial)
|
||||||
|
axidraw_serial.go_home()
|
||||||
rclpy.shutdown()
|
rclpy.shutdown()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user