Improve homing
This commit is contained in:
@@ -69,7 +69,6 @@ class AxidrawSerial(Node):
|
|||||||
return response
|
return response
|
||||||
|
|
||||||
def go_home(self):
|
def go_home(self):
|
||||||
self.wait_ready()
|
|
||||||
self.status["motion"] = "busy"
|
self.status["motion"] = "busy"
|
||||||
if self.status["serial"] == "ready":
|
if self.status["serial"] == "ready":
|
||||||
self.ad.moveto(0,0)
|
self.ad.moveto(0,0)
|
||||||
@@ -82,9 +81,10 @@ class AxidrawSerial(Node):
|
|||||||
self.status["motion"] = "ready"
|
self.status["motion"] = "ready"
|
||||||
|
|
||||||
def wait_ready(self):
|
def wait_ready(self):
|
||||||
rate = node.create_rate(2) #2Hz
|
rate = self.create_rate(2) #2Hz
|
||||||
while self.status["motion"] != "ready":
|
while self.status["motion"] != "ready":
|
||||||
rate.sleep()
|
rate.sleep()
|
||||||
|
pass
|
||||||
|
|
||||||
def move_callback(self, msg):
|
def move_callback(self, msg):
|
||||||
self.set_busy()
|
self.set_busy()
|
||||||
|
|||||||
Reference in New Issue
Block a user