Skip to content
Snippets Groups Projects
Commit 043728e6 authored by Louis Kevin Fink's avatar Louis Kevin Fink
Browse files

fix: add goal_handle reset

parent 94032901
No related branches found
No related tags found
No related merge requests found
......@@ -75,6 +75,7 @@ class TurnActionClientAsync(Node):
"""
self._status = GoalStatus.STATUS_UNKNOWN
self._goal_handle = None
def send_turn_goal_async(self, theta: float):
"""
......@@ -107,6 +108,8 @@ class TurnActionClientAsync(Node):
logger.debug("Canceling turn request!")
cancel_future.add_done_callback(self._cancel_response_callback)
self._goal_handle = None
def is_turn_goal_active(self) -> bool:
"""
Check if the turn goal is active.
......@@ -158,6 +161,7 @@ class TurnController:
Stop the JetRacer.
"""
self._turn_action_client.cancel_turn_goal_async()
self._turn_action_client.cleanup()
def shutdown(self):
"""
......@@ -179,7 +183,7 @@ class TurnController:
self._turn_action_client.send_turn_goal_async(theta)
while (self._turn_action_client.is_turn_goal_active()):
while self._turn_action_client.is_turn_goal_active():
logger.debug("Waiting for Turn action request %f to succeed.", theta)
rclpy.spin_once(self._turn_action_client)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment