Can I change parameter of plugins in yaml
I have installed range_sensor_layer for local_costmap. in the local_costmap_param.yaml:
local_costmap:
global_frame: /odom
robot_base_frame: /base_footprint
update_frequency: 3.0
publish_frequency: 1.0
static_map: false
rolling_window: true
width: 6.0
height: 6.0
resolution: 0.05
transform_tolerance: 1.0
map_type: costmap
plugins:
- {name: sonar, type: "range_sensor_layer::RangeSensorLayer"}
the range_sensor_layer has some parameters,is it possible to change them in this yaml?
I found some code in costmap_2d_ros.cpp line 114:
if (private_nh.hasParam("plugins"))
{
XmlRpc::XmlRpcValue my_list;
private_nh.getParam("plugins", my_list);
for (int32_t i = 0; i < my_list.size(); ++i)
{
std::string pname = static_cast<std::string>(my_list[i]["name"]);
std::string type = static_cast<std::string>(my_list[i]["type"]);
ROS_INFO("Using plugin \"%s\"", pname.c_str());
boost::shared_ptr<Layer> plugin = plugin_loader_.createInstance(type);
layered_costmap_->addPlugin(plugin);
plugin->initialize(layered_costmap_, name + "/" + pname, &tf_);
}
}
It looks like should be:
......
plugins:
- {name: sonar, type: "range_sensor_layer::RangeSensorLayer"}
sonar:
......
......
but my sonar on the way,I cannot test this.
Yup. This is the way to do it...
@mig: thanks for confirm