Skip to content
Snippets Groups Projects
Unverified Commit 19b844b5 authored by Steven Macenski's avatar Steven Macenski Committed by GitHub
Browse files

fixing nightly builds with exception handling (#1527)

parent cc28e8a2
No related branches found
No related tags found
No related merge requests found
...@@ -178,8 +178,8 @@ class NavTester(Node): ...@@ -178,8 +178,8 @@ class NavTester(Node):
req = ManageLifecycleNodes.Request() req = ManageLifecycleNodes.Request()
req.command = ManageLifecycleNodes.Request().SHUTDOWN req.command = ManageLifecycleNodes.Request().SHUTDOWN
future = mgr_client.call_async(req) future = mgr_client.call_async(req)
rclpy.spin_until_future_complete(self, future)
try: try:
rclpy.spin_until_future_complete(self, future)
future.result() future.result()
except Exception as e: except Exception as e:
self.error_msg('Service call failed %r' % (e,)) self.error_msg('Service call failed %r' % (e,))
...@@ -191,8 +191,8 @@ class NavTester(Node): ...@@ -191,8 +191,8 @@ class NavTester(Node):
req = ManageLifecycleNodes.Request() req = ManageLifecycleNodes.Request()
req.command = ManageLifecycleNodes.Request().SHUTDOWN req.command = ManageLifecycleNodes.Request().SHUTDOWN
future = mgr_client.call_async(req) future = mgr_client.call_async(req)
rclpy.spin_until_future_complete(self, future)
try: try:
rclpy.spin_until_future_complete(self, future)
future.result() future.result()
except Exception as e: except Exception as e:
self.error_msg('Service call failed %r' % (e,)) self.error_msg('Service call failed %r' % (e,))
......
...@@ -84,8 +84,12 @@ class WaypointFollowerTest(Node): ...@@ -84,8 +84,12 @@ class WaypointFollowerTest(Node):
self.info_msg('Sending goal request...') self.info_msg('Sending goal request...')
send_goal_future = self.action_client.send_goal_async(action_request) send_goal_future = self.action_client.send_goal_async(action_request)
try:
rclpy.spin_until_future_complete(self, send_goal_future) rclpy.spin_until_future_complete(self, send_goal_future)
goal_handle = send_goal_future.result() goal_handle = send_goal_future.result()
except Exception as e:
self.error_msg('Service call failed %r' % (e,))
if not goal_handle.accepted: if not goal_handle.accepted:
self.error_msg('Goal rejected') self.error_msg('Goal rejected')
return False return False
...@@ -94,9 +98,13 @@ class WaypointFollowerTest(Node): ...@@ -94,9 +98,13 @@ class WaypointFollowerTest(Node):
get_result_future = goal_handle.get_result_async() get_result_future = goal_handle.get_result_async()
self.info_msg("Waiting for 'FollowWaypoints' action to complete") self.info_msg("Waiting for 'FollowWaypoints' action to complete")
try:
rclpy.spin_until_future_complete(self, get_result_future) rclpy.spin_until_future_complete(self, get_result_future)
status = get_result_future.result().status status = get_result_future.result().status
result = get_result_future.result().result result = get_result_future.result().result
except Exception as e:
self.error_msg('Service call failed %r' % (e,))
if status != GoalStatus.STATUS_SUCCEEDED: if status != GoalStatus.STATUS_SUCCEEDED:
self.info_msg('Goal failed with status code: {0}'.format(status)) self.info_msg('Goal failed with status code: {0}'.format(status))
return False return False
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment