5#include <rclcpp/rclcpp.hpp>
20[[maybe_unused]]
static const std::string topic_validation_warning(
const std::string& name,
const std::string& type) {
21 return "The parsed signal name for " + type +
" '" + name
22 +
"' is empty. Provide a string with valid characters for the signal name ([a-z0-9_]).";
31[[maybe_unused]]
static std::string
32parse_node_name(
const rclcpp::NodeOptions& options,
const std::string& fallback =
"") {
33 std::string node_name = fallback;
34 const std::string pattern(
"__node:=");
35 for (
const auto& arg : options.arguments()) {
36 std::string::size_type index = arg.find(pattern);
37 if (index != std::string::npos) {
39 node_name.erase(index, pattern.length());
53[[maybe_unused]]
static std::string parse_topic_name(
const std::string& topic_name) {
55 for (
char c : topic_name) {
56 if (c >=
'a' && c <=
'z') {
57 output.insert(output.end(), c);
58 }
else if (!output.empty() && ((c >=
'0' && c <=
'9') || c ==
'_')) {
59 output.insert(output.end(), c);