Skip to content

Commit

Permalink
Let Navigators have different error codes (ros-navigation#3642) (ros-…
Browse files Browse the repository at this point in the history
…navigation#7)

* Change ERROR to DEBUG

* INFO message on init

* format code

* Replace newlines with spaces
  • Loading branch information
RBT22 authored Jun 23, 2023
1 parent 91f3144 commit 8a2b4a0
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,22 @@ BtActionServer<ActionT>::BtActionServer(
if (value.get_type() == rclcpp::PARAMETER_NOT_SET) {
std::string error_codes_str;
for (const auto & error_code : error_code_names) {
error_codes_str += "\n" + error_code;
error_codes_str += " " + error_code;
}
RCLCPP_WARN_STREAM(
logger_, "Error_code parameters were not set. Using default values of: "
logger_, "Error_code parameters were not set. Using default values of:"
<< error_codes_str + "\n"
<< "Make sure these match your BT and there are not other sources of error codes you"
"reported to your application");
rclcpp::Parameter error_code_names_param("error_code_names", error_code_names);
node->set_parameter(error_code_names_param);
} else {
error_code_names = value.get<std::vector<std::string>>();
std::string error_codes_str;
for (const auto & error_code : error_code_names) {
error_codes_str += " " + error_code;
}
RCLCPP_INFO_STREAM(logger_, "Error_code parameters were set to:" << error_codes_str);
}
}
}
Expand Down Expand Up @@ -286,7 +293,7 @@ void BtActionServer<ActionT>::populateErrorCode(
highest_priority_error_code = current_error_code;
}
} catch (...) {
RCLCPP_ERROR(
RCLCPP_DEBUG(
logger_,
"Failed to get error code: %s from blackboard",
error_code.c_str());
Expand Down

0 comments on commit 8a2b4a0

Please sign in to comment.