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

Can I change parameter of plugins in yaml

asked 2017-11-23 03:21:11 -0500

dyan gravatar image

updated 2017-11-25 02:15:11 -0500

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.

edit retag flag offensive close merge delete

Comments

Yup. This is the way to do it...

mgruhler gravatar image mgruhler  ( 2017-11-28 01:21:46 -0500 )edit

@mig: thanks for confirm

dyan gravatar image dyan  ( 2017-11-30 02:51:33 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-11-30 07:01:58 -0500

mgruhler gravatar image

Yup. This is the way to do it...

(So you can acutally mark this as answered...)

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-11-23 03:21:11 -0500

Seen: 462 times

Last updated: Nov 30 '17