Skip to content

Commit

Permalink
Dont throw exception on goal_handle rejected
Browse files Browse the repository at this point in the history
  • Loading branch information
hello-binit committed Jan 25, 2024
1 parent 2d2754b commit 713a5fc
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions rosbridge_library/src/rosbridge_library/internal/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,9 @@ def get_result_cb(self, future: Future) -> None:

def goal_response_cb(self, future: Future) -> None:
self.goal_handle = future.result()
if not self.goal_handle.accepted:
raise Exception("Action goal was rejected")
result_future = self.goal_handle.get_result_async()
result_future.add_done_callback(self.get_result_cb)
if self.goal_handle.accepted:
result_future = self.goal_handle.get_result_async()
result_future.add_done_callback(self.get_result_cb)

def start_goal(self, goal_msg):
if not self.client.action_client.wait_for_server(timeout_sec=10.0):
Expand Down Expand Up @@ -172,4 +171,4 @@ def start_goal(self, goal_msg):
else:
raise Exception(status)

return json_response
return json_response

0 comments on commit 713a5fc

Please sign in to comment.