Skip to content
Snippets Groups Projects
Commit c5dc06e4 authored by Tommy Persson's avatar Tommy Persson
Browse files

Refactoring execution.

parent cbd426c5
No related branches found
No related tags found
No related merge requests found
...@@ -47,8 +47,7 @@ class BaseExecutor(Executor): ...@@ -47,8 +47,7 @@ class BaseExecutor(Executor):
self.course = 90.0 - self.theta self.course = 90.0 - self.theta
self.have_turtle_pose = True self.have_turtle_pose = True
except Exception as exc: except Exception as exc:
print("EXCEPTION pose_callback:", type(exc)) self.node.get_logger().error(f'EXCEPTION pose_callback: {type(exc)} - {exc}')
print(exc)
def check(self): def check(self):
lx = 0.5 lx = 0.5
......
...@@ -13,10 +13,10 @@ class MoveToExecutor(BaseExecutor): ...@@ -13,10 +13,10 @@ class MoveToExecutor(BaseExecutor):
def start(self): def start(self):
try: try:
print("MoveToExecutor start") self.node.get_logger().info("MoveToExecutor start")
self.params.print() self.params.print()
gp = self.params.get_value("waypoint") gp = self.params.get_value("waypoint")
print("GP:", gp) self.node.get_logger().info(f'GP: {gp}')
self.commanded_speed = self.get_commanded_speed() self.commanded_speed = self.get_commanded_speed()
self.set_goal_gp(gp.latitude, gp.longitude, gp.altitude) self.set_goal_gp(gp.latitude, gp.longitude, gp.altitude)
...@@ -25,10 +25,9 @@ class MoveToExecutor(BaseExecutor): ...@@ -25,10 +25,9 @@ class MoveToExecutor(BaseExecutor):
self.stop() self.stop()
self.cleanup() self.cleanup()
print("MoveToExecutor end") self.node.get_logger().info("MoveToExecutor end")
except Exception as exc: except Exception as exc:
print("EXCEPTION start move-to", type(exc)) self.node.get_logger().error(f'EXCEPTION start: {type(exc)} - {exc}')
print(exc)
class MoveToExecutorFactory(ExecutorFactory): class MoveToExecutorFactory(ExecutorFactory):
def __init__(self): def __init__(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment