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

Move_base and costmap_layers

asked 2013-09-24 23:45:14 -0500

CarolineQ gravatar image

Hi.

I would like to use a new layer in the costmap. I followed this tutorial : http://wiki.ros.org/costmap_2d/Tutorials/Creating%20a%20New%20Layer to create a new layer. Now my layer is defined but when I launch move_base the plugin is not loaded. I didn't find where I should add my layer...

Here is my launch file :

<launch>
<arg name="urdf_file" default="$(find xacro)/xacro.py '$(find emoxone_description)/robots/emox.urdf.xacro'" />
<param name="robot_description" command="$(arg urdf_file)" />   
<node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />
<node pkg="tf" type="static_transform_publisher" name="base_to_laser" args="0.105 0 0.123 0 0 0 base_link base_laser_link 100" />
<node name="map_server" pkg="map_server" type="map_server" args="$(find morse_2dnav)/map.yaml"/>
<node name="amcl" pkg="amcl" type="amcl" />

<node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen" clear_params="true">
    <param name="footprint_padding" value="0.01" />
    <param name="controller_frequency" value="10.0" />
    <param name="controller_patience" value="100.0" />
    <param name="planner_frequency" value="2.0" />
    <rosparam file="$(find morse_2dnav)/morse_move_base/costmap_common_params.yaml" command="load" ns="global_costmap" />
    <rosparam file="$(find morse_2dnav)/morse_move_base/costmap_common_params.yaml" command="load" ns="local_costmap" />
    <rosparam file="$(find morse_2dnav)/morse_move_base/local_costmap_params.yaml" command="load" />
    <rosparam file="$(find morse_2dnav)/morse_move_base/global_costmap_params.yaml" command="load" />
    <param name="base_local_planner" value="dwa_local_planner/DWAPlannerROS" />
<rosparam file="$(find morse_2dnav)/morse_move_base/dwa_planner_ros.yaml" command="load" />
</node>

</launch>

Here is the output in the console :

[ INFO] [1380101096.724416286]: Loading from pre-hydro parameter style
[ INFO] [1380101096.744456439]: Using plugin "static_layer"
[ INFO] [1380101096.817861305]: Requesting the map...
[ INFO] [1380101097.039012071]: Received a 4000 X 4000 map at 0.050000 m/pix
[ INFO] [1380101097.268514429]: Using plugin "obstacle_layer"
[ INFO] [1380101097.286262517]:     Subscribed to Topics: laser
[ INFO] [1380101097.308587570]: Using plugin "footprint_layer"
[ INFO] [1380101097.313275592]: Using plugin "inflation_layer"

I was expecting the plugin simple_layer to be used. But it's not. What did I miss ?

Thanks, Caroline

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2013-09-25 00:48:16 -0500

Hendrik Wiese gravatar image

updated 2013-09-25 00:50:26 -0500

Your settings are loaded from a default configuration which is indicated by the message "Loading from pre-hydro parameter style". That means that move_base cannot find any plugins settings for your local or global costmap.

Plugins are loaded from the YAML files. Here's for example my YAML file for my local costmap configuration:

local_costmap:
  global_frame: '/map'
  robot_base_frame: 'base_link'
  update_frequency: 1
  publish_frequency: 1
  static_map: false
  rolling_window: false
  width: 3
  height: 3
  resolution: 0.01
  plugins:
   -
     name: footprint
     type: "costmap_2d::FootprintLayer"
   - 
     name: obstacles
     type: "costmap_2d::ObstacleLayer"
   - 
     name: inflater
     type: "costmap_2d::InflationLayer"

You have to place the plugins parameter (a yaml list) inside the corresponding namespace (local_costmap in this case). That's the important part.

In your particular case a new entry to the plugins list might look like that:

   - 
     name: yourlayer
     type: "your_layer_namespace::YourLayerClassName"
edit flag offensive delete link more

Comments

Thanks for your answer, it's exactly what I missed. I still have a problem, when I add the plugins in the parameters for the local map, the plugins are all loaded but I see nothing in the Occupancy grid in Rviz, do you have any idea why ?

CarolineQ gravatar image CarolineQ  ( 2013-09-25 02:47:17 -0500 )edit
1

I can't tell exactly what's causing that for you but I had a similar problem that came with Hydro. I couldn't see my costmaps anymore (no topic available for GridCell). Reason was that in Hydro costmaps get posted as actual Map. That's what I had to use instead of GridCell. Hope that helps too.

Hendrik Wiese gravatar image Hendrik Wiese  ( 2013-09-25 05:59:32 -0500 )edit

SeveQ is correct. GridCells are no longer published with Layered Costmaps.

David Lu gravatar image David Lu  ( 2013-09-25 06:33:24 -0500 )edit

Thanks for the answer but I already used a Map in Rviz. With the default parameter I can see a costmap but as soon as I put the list of plugins in the yaml file I can't see the obstacles anymore. I tried the simple layer tutorial and this is working, the problem seems to be in the Obstacle layer.

CarolineQ gravatar image CarolineQ  ( 2013-09-25 21:17:02 -0500 )edit

Could you please open another question for this issue? The comments section is too cramped for helping.

Hendrik Wiese gravatar image Hendrik Wiese  ( 2013-09-25 23:20:44 -0500 )edit
CarolineQ gravatar image CarolineQ  ( 2013-09-25 23:42:50 -0500 )edit

Alright, I'll see how I can help.

Hendrik Wiese gravatar image Hendrik Wiese  ( 2013-09-25 23:54:44 -0500 )edit

Question Tools

3 followers

Stats

Asked: 2013-09-24 23:45:14 -0500

Seen: 6,552 times

Last updated: Sep 25 '13