32 std::string new_topic;
34 node[
"topic"] >> new_topic;
35 node[
"timeout"] >> new_timeout;
37 #ifdef HAVE_NEW_YAMLCPP 38 if (node[
"short_desc"]) {
40 if (node.FindValue(
"short_desc") != NULL) {
45 if (new_topic !=
topic)
70 std::vector<std::shared_ptr<CmdVelSubs>> new_list(node.size());
71 for (
unsigned int i = 0; i < node.size(); i++)
74 std::string new_subs_name = node[i][
"name"].Scalar();
75 auto old_subs = std::find_if(
list.begin(),
list.end(),
76 [&new_subs_name](
const std::shared_ptr<CmdVelSubs>&
subs)
77 {
return subs->name == new_subs_name;});
78 if (old_subs !=
list.end())
81 new_list[i] = *old_subs;
85 new_list[i] = std::make_shared<CmdVelSubs>(i);
88 *new_list[i] << node[i];
96 catch(YAML::ParserException& e)
100 catch(YAML::RepresentationException& e)
void configure(const YAML::Node &node)
Configures the subscribers from a yaml file.
std::vector< std::shared_ptr< CmdVelSubs > > list
Structure for the cmd_vel_mux.
void setPeriod(const Duration &period, bool reset=true)
void operator<<(const YAML::Node &node)