Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correct error message #3631

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#define NAV2_BEHAVIOR_TREE__BT_ACTION_SERVER_IMPL_HPP_

#include <memory>
#include <rclcpp/parameter_value.hpp>
#include <string>
#include <fstream>
#include <set>
Expand Down Expand Up @@ -67,16 +68,22 @@ BtActionServer<ActionT>::BtActionServer(
};

if (!node->has_parameter("error_code_names")) {
SteveMacenski marked this conversation as resolved.
Show resolved Hide resolved
std::string error_codes_str;
for (const auto & error_code : error_code_names) {
error_codes_str += error_code + "\n";
}
RCLCPP_WARN_STREAM(
logger_, "Error_code parameters were not set. Using default values of: "
<< error_codes_str
<< "Make sure these match your BT and there are not other sources of error codes you want "
"reported to your application");

const rclcpp::ParameterValue value = node->declare_parameter(
"error_code_names",
rclcpp::PARAMETER_STRING_ARRAY);
if (value.get_type() == rclcpp::PARAMETER_NOT_SET) {
SteveMacenski marked this conversation as resolved.
Show resolved Hide resolved
std::string error_codes_str;
for (const auto & error_code : error_code_names) {
error_codes_str += error_code + "\n";
}
RCLCPP_WARN_STREAM(
logger_, "Error_code parameters were not set. Using default values of: "
<< error_codes_str
<< "Make sure these match your BT and there are not other sources of error codes you"
"reported to your application");
node->declare_parameter("error_code_names", error_code_names);
SteveMacenski marked this conversation as resolved.
Show resolved Hide resolved
}
}
}

Expand Down