ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

https://github.com/jbeder/yaml-cpp

Checkout the https://github.com/jbeder/yaml-cpp/wiki/Tutorial

https://github.com/jbeder/yaml-cpp

Checkout the https://github.com/jbeder/yaml-cpp/wiki/Tutorial

ros::NodeHandle nh;
yaml_params_ = YAML::LoadFile(yaml_filename);

for (YAML::const_iterator it = yaml_params_.begin();
        it != yaml_params_.end(); ++it) {
    nh.setParam(it->first.as<std::string>(), it->second.as<double>());
}

PS: Not sure if there a better way, but this is how I do it. Obviously, there is ddynamic_reconfigure & dynamic_reconfigure, where you can store the params to *.yaml and save/load them as needed.

https://github.com/jbeder/yaml-cpp

Checkout the https://github.com/jbeder/yaml-cpp/wiki/Tutorial

ros::NodeHandle nh;
yaml_params_ = YAML::LoadFile(yaml_filename);

for (YAML::const_iterator it = yaml_params_.begin();
        yaml_params_.begin(); it != yaml_params_.end(); ++it) {
    nh.setParam(it->first.as<std::string>(), it->second.as<double>());
}

PS: Not sure if there a better way, but this is how I do it. Obviously, there is ddynamic_reconfigure & dynamic_reconfigure, where you can store the params to *.yaml and save/load them as needed.

https://github.com/jbeder/yaml-cpp

Checkout the https://github.com/jbeder/yaml-cpp/wiki/Tutorial

ros::NodeHandle nh;
yaml_params_ = YAML::LoadFile(yaml_filename);

for (YAML::const_iterator it = yaml_params_.begin(); it != yaml_params_.end(); ++it) {
    nh.setParam(it->first.as<std::string>(), it->second.as<double>());
}

PS: Not sure if there is a better way, but this is how I do it. Obviously, there is ddynamic_reconfigure & dynamic_reconfigure, where you can store the params to *.yaml and save/load them as needed.