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

Work on ROS2

parent 48a8d297
No related merge requests found
...@@ -11,7 +11,7 @@ class WaitExecutor(Executor): ...@@ -11,7 +11,7 @@ class WaitExecutor(Executor):
def start(self): def start(self):
try: try:
self.lprint("WaitExecutor start") self.node.get_logger().info("WaitExecutor start")
# self.params.print() # self.params.print()
index = 0 index = 0
paused = False paused = False
...@@ -23,7 +23,7 @@ class WaitExecutor(Executor): ...@@ -23,7 +23,7 @@ class WaitExecutor(Executor):
while not finished_flag and 0.1*index < duration: while not finished_flag and 0.1*index < duration:
if self.have_signal(): if self.have_signal():
signal = self.pop_signal() signal = self.pop_signal()
self.lprint("WaitExecutor got signal:", signal) self.node.get_logger().info(f'WaitExecutor got signal: {signal}')
if signal == "$enough": if signal == "$enough":
finished_flag = True finished_flag = True
if signal == "$abort": if signal == "$abort":
...@@ -37,10 +37,9 @@ class WaitExecutor(Executor): ...@@ -37,10 +37,9 @@ class WaitExecutor(Executor):
index += 1 index += 1
time.sleep(0.1) time.sleep(0.1)
except Exception as exc: except Exception as exc:
print(type(exc)) self.node.get_logger().error(f'EXCEPTION start: {type(exc)} - {exc}')
print(exc)
self.fail(f'Exception: {exc}') self.fail(f'Exception: {exc}')
self.lprint("WaitExecutor end") self.node.get_logger().info("WaitExecutor end")
class WaitExecutorFactory(ExecutorFactory): class WaitExecutorFactory(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