Skip to content

Commit 8ddf0d6

Browse files
authored
Update for error_code_name_prefixes and action error_msg (#4341) (#104)
Signed-off-by: Mike Wake <[email protected]>
1 parent aa23bcd commit 8ddf0d6

File tree

5 files changed

+39
-10
lines changed

5 files changed

+39
-10
lines changed

nav2_gps_waypoint_follower_demo/config/nav2_no_map_params.yaml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# GPS WPF CHANGES:
1+
# GPS WPF CHANGES:
22
# - amcl params where removed. They are not needed because global localization is provided
33
# by an ekf node on robot_localization fusing gps data with local odometry sources
44
# - static layer is removed from both costmaps, in this tutorial we assume there is no map
@@ -74,9 +74,19 @@ bt_navigator:
7474
- nav2_assisted_teleop_cancel_bt_node
7575
- nav2_drive_on_heading_cancel_bt_node
7676
- nav2_is_battery_charging_condition_bt_node
77-
error_code_names:
78-
- compute_path_error_code
79-
- follow_path_error_code
77+
error_code_name_prefixes:
78+
- assisted_teleop
79+
- backup
80+
- compute_path
81+
- dock_robot
82+
- drive_on_heading
83+
- follow_path
84+
- nav_thru_poses
85+
- nav_to_pose
86+
- route
87+
- spin
88+
- undock_robot
89+
- wait
8090

8191
controller_server:
8292
ros__parameters:
@@ -200,7 +210,7 @@ global_costmap:
200210
robot_radius: 0.22
201211
resolution: 0.1
202212
# When using GPS navigation you will potentially traverse huge environments which are not practical to
203-
# fit on a big static costmap. Thus it is recommended to use a rolling global costmap large enough to
213+
# fit on a big static costmap. Thus it is recommended to use a rolling global costmap large enough to
204214
# contain each pair of successive waypoints. See: https://github.com/ros-planning/navigation2/issues/2174
205215
rolling_window: True
206216
width: 50

nav2_sms_behavior/action/SendSms.action

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@
22
string message
33
---
44
#result definition
5+
6+
# Error codes
7+
# Note: The expected priority order of the errors should match the message order
8+
uint16 NONE=0
9+
uint16 UNKNOWN=51110
10+
uint16 SMS_SEND_FAILED=51111
11+
512
builtin_interfaces/Duration total_elapsed_time
613
uint16 error_code
14+
string error_msg
715
---
816
#feedback definition

nav2_sms_behavior/include/nav2_sms_behavior/send_sms.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ namespace nav2_sms_behavior
1717

1818
using namespace nav2_behaviors; // NOLINT
1919
using Action = nav2_sms_behavior::action::SendSms;
20+
using ActionResult = Action::Result;
2021

2122
class SendSms : public TimedBehavior<Action>
2223
{

nav2_sms_behavior/src/send_sms.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ ResultStatus SendSms::onRun(const std::shared_ptr<const Action::Goal> command)
4545
"",
4646
false);
4747
if (!message_success) {
48-
RCLCPP_INFO(node->get_logger(), "SMS send failed.");
49-
return ResultStatus{Status::FAILED};
48+
RCLCPP_INFO(node->get_logger(), "SMS send failed: %s.", response.c_str());
49+
return ResultStatus{Status::FAILED, ActionResult::SMS_SEND_FAILED, response};
5050
}
5151

5252
RCLCPP_INFO(node->get_logger(), "SMS sent successfully!");

sam_bot_description/config/nav2_params.yaml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,19 @@ bt_navigator:
6161
# Built-in plugins are added automatically
6262
# plugin_lib_names: []
6363

64-
error_code_names:
65-
- compute_path_error_code
66-
- follow_path_error_code
64+
error_code_name_prefixes:
65+
- assisted_teleop
66+
- backup
67+
- compute_path
68+
- dock_robot
69+
- drive_on_heading
70+
- follow_path
71+
- nav_thru_poses
72+
- nav_to_pose
73+
- route
74+
- spin
75+
- undock_robot
76+
- wait
6777

6878
controller_server:
6979
ros__parameters:

0 commit comments

Comments
 (0)