Skip to content

Commit 8a2b4a0

Browse files
authored
Let Navigators have different error codes (ros-navigation#3642) (ros-navigation#7)
* Change ERROR to DEBUG * INFO message on init * format code * Replace newlines with spaces
1 parent 91f3144 commit 8a2b4a0

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

nav2_behavior_tree/include/nav2_behavior_tree/bt_action_server_impl.hpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,22 @@ BtActionServer<ActionT>::BtActionServer(
7373
if (value.get_type() == rclcpp::PARAMETER_NOT_SET) {
7474
std::string error_codes_str;
7575
for (const auto & error_code : error_code_names) {
76-
error_codes_str += "\n" + error_code;
76+
error_codes_str += " " + error_code;
7777
}
7878
RCLCPP_WARN_STREAM(
79-
logger_, "Error_code parameters were not set. Using default values of: "
79+
logger_, "Error_code parameters were not set. Using default values of:"
8080
<< error_codes_str + "\n"
8181
<< "Make sure these match your BT and there are not other sources of error codes you"
8282
"reported to your application");
8383
rclcpp::Parameter error_code_names_param("error_code_names", error_code_names);
8484
node->set_parameter(error_code_names_param);
85+
} else {
86+
error_code_names = value.get<std::vector<std::string>>();
87+
std::string error_codes_str;
88+
for (const auto & error_code : error_code_names) {
89+
error_codes_str += " " + error_code;
90+
}
91+
RCLCPP_INFO_STREAM(logger_, "Error_code parameters were set to:" << error_codes_str);
8592
}
8693
}
8794
}
@@ -286,7 +293,7 @@ void BtActionServer<ActionT>::populateErrorCode(
286293
highest_priority_error_code = current_error_code;
287294
}
288295
} catch (...) {
289-
RCLCPP_ERROR(
296+
RCLCPP_DEBUG(
290297
logger_,
291298
"Failed to get error code: %s from blackboard",
292299
error_code.c_str());

0 commit comments

Comments
 (0)