Skip to content

Commit

Permalink
nav2_system_tests: log error_code and error_msg. (#4341)
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Wake <[email protected]>
  • Loading branch information
aosmw committed Oct 4, 2024
1 parent 52eecbf commit f76ec0a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
15 changes: 12 additions & 3 deletions nav2_system_tests/src/system/nav_through_poses_tester_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@ def runNavigateAction(self, goal_pose: Optional[Pose] = None):
rclpy.spin_until_future_complete(self, get_result_future)
status = get_result_future.result().status
if status != GoalStatus.STATUS_SUCCEEDED:
self.info_msg(f'Goal failed with status code: {status}')
result = get_result_future.result().result
self.info_msg(f'Goal failed with status code: {status}'
f' error code:{result.error_code}'
f' error msg:{result.error_msg}')
return False

self.info_msg('Goal succeeded!')
Expand Down Expand Up @@ -149,7 +152,10 @@ def runFakeNavigateAction(self):
rclpy.spin_until_future_complete(self, get_result_future)
status = get_result_future.result().status
if status != GoalStatus.STATUS_SUCCEEDED:
self.info_msg(f'Goal failed with status code: {status}')
result = get_result_future.result().result
self.info_msg(f'Goal failed with status code: {status}'
f' error code:{result.error_code}'
f' error msg:{result.error_msg}')
return False

self.info_msg('Goal succeeded!')
Expand Down Expand Up @@ -186,7 +192,10 @@ def runNavigatePreemptionAction(self, block):
rclpy.spin_until_future_complete(self, get_result_future)
status = get_result_future.result().status
if status != GoalStatus.STATUS_SUCCEEDED:
self.info_msg(f'Goal failed with status code: {status}')
result = get_result_future.result().result
self.info_msg(f'Goal failed with status code: {status}'
f' error code:{result.error_code}'
f' error msg:{result.error_msg}')
return False

self.info_msg('Goal succeeded!')
Expand Down
5 changes: 4 additions & 1 deletion nav2_system_tests/src/system/nav_to_pose_tester_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ def runNavigateAction(self, goal_pose: Optional[Pose] = None):
rclpy.spin_until_future_complete(self, get_result_future)
status = get_result_future.result().status
if status != GoalStatus.STATUS_SUCCEEDED:
self.info_msg(f'Goal failed with status code: {status}')
result = get_result_future.result().result
self.info_msg(f'Goal failed with status code: {status}'
f' error code:{result.error_code}'
f' error msg:{result.error_msg}')
return False

if not future_return:
Expand Down

0 comments on commit f76ec0a

Please sign in to comment.