ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

ObstacleLayer parameters - where to set them?

asked 2013-09-17 22:50:21 -0500

Hendrik Wiese gravatar image

updated 2014-01-28 17:17:59 -0500

ngrennan gravatar image

Hi folks,

I'm trying to migrate my costmap_2d setup to ROS Hydro which involves configuring layer plugins. Loading the plugins is working so far. But the ObstacleLayer that I use in my local costmap won't subscribe to a observation source topic that is configured in another YAML file.

This is how I've configured my move_base (launch file):

<node pkg="move_base" name="MoveBase" type="move_base" output="screen">
    <rosparam file="$(find otter4_tf)/costmap_common_params.yaml" command="load" ns="local_costmap" />
    <rosparam file="$(find otter4_tf)/costmap_common_params.yaml" command="load" ns="global_costmap" />
    <rosparam file="$(find otter4_tf)/local_costmap_params.yaml" command="load" />
    <rosparam file="$(find otter4_tf)/global_costmap_params.yaml" command="load" />
    <rosparam file="$(find otter4_tf)/base_local_planner_params.yaml" command="load" />
    <param name="base_local_planner" value="base_local_planner/TrajectoryPlannerROS" />
    <param name="controller_frequency" type="double" value="5.0" />

Here's the part of the costmap_common_params.yaml with the configured observation source ir_sensors:

ir_sensors: {
  sensor_frame: 'base_link',
  data_type: PointCloud,
  topic: '/ir_sensors',
  marking: true,
  clearing: true,
  obstacle_range: 0.8,
  raytrace_range: 0.8,
  expected_update_rate: 15,

And here's the configuration of my local costmap (local_costmap_params.yaml):

  robot_base_frame: 'base_link'
  update_frequency: 2.0
  publish_frequency: 1.0
  static_map: false
  rolling_window: true
  width: 3
  height: 2
  resolution: 0.05
     name: footprint
     type: "costmap_2d::FootprintLayer"
     name: obstacles
     type: "costmap_2d::ObstacleLayer"
     observation_sources: ir_sensors
     name: inflater
     type: "costmap_2d::InflationLayer"

The plugins load but the ObstacleLayer doesn't subscribe to the /ir_sensors topic. It looks like it can't find the observation source setup. I've got a strong feeling that it's some namespace related issue. But I haven't figured out yet how to configure it properly.

Thanks in advance for helping me again!

Cheers, Hendrik

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-09-20 07:29:34 -0500

David Lu gravatar image

The Obstacles layer uses the layer-specific namespace to look for additional parameters. Try this:

<rosparam file="$(find otter4_tf)/costmap_common_params.yaml" command="load" ns="local_costmap/obstacles" />
<rosparam file="$(find otter4_tf)/costmap_common_params.yaml" command="load" ns="global_costmap/obstacles" />
edit flag offensive delete link more


I've already sort of figured out that by myself (thanks anyway!) but somehow put the cart before the horse. I'm still using ns="local_costmap" and ns="global_costmap" but combined with "obstacle/observation_sources:" inside the corresponding yaml file. Works like a charm.

Hendrik Wiese gravatar image Hendrik Wiese  ( 2013-09-20 11:14:26 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2013-09-17 22:50:21 -0500

Seen: 1,046 times

Last updated: Sep 20 '13