Robotics StackExchange | Archived questions

Costmap_layers problem with plugins

Hi, everyone!!

I am trying to create a new layer for costmap to be use in turtlebot, I follow the two tutorials for costmap_2d. 1.Configuring Layered Costmaps 2.Creating a New Layer

So my costmap layers ymal results in these:

1.costmapcommonparams.yaml

max_obstacle_height: 0.60  # assume something like an arm is mounted on top of the robot
obstacle_range: 2.5
raytrace_range: 3.0
footprint: [[-0.2, -0.2], [-0.2, 0.2], [0.2, 0.2], [0.2, -0.2]]
robot_radius: 0.18
inflation_radius: 0.50


# voxel map configuration; z-voxels 0 are filled by bumpers and 1 by laser scan (kinect)
map_type: voxel
origin_z: 0.0
z_resolution: 0.2
z_voxels: 2
publish_voxel_map: false

observation_sources: scan bump

scan: {data_type: LaserScan, topic: scan, marking: true, clearing: true, min_obstacle_height: 0.25, max_obstacle_height: 0.35}
bump: {data_type: PointCloud2, topic: mobile_base/sensors/bumper_pointcloud, marking: true, clearing: false, min_obstacle_height: 0.0, max_obstacle_height: 0.15}

2.globalcostmapparams.yaml global_costmap:

   global_frame: /map
   robot_base_frame: /base_footprint
   update_frequency: 1.0
   publish_frequency: 0.5
   static_map: true
   transform_tolerance: 0.5

3.mylocalcostmap_params.yaml

local_costmap:
   global_frame: /map
   robot_base_frame: /base_footprint
   update_frequency: 5.0
   publish_frequency: 2.0
   static_map: false
   rolling_window: true
   width: 4.0
   height: 4.0
   resolution: 0.05
   transform_tolerance: 0.5
   plugins:
   - {name: footprint_layer,     type: "costmap_2d::FootprintLayer"}      
   - {name: obstacle_layer_my,   type: "costmap_2d::ObstacleLayer" }     
   - {name: inflation_layer_my,  type: "costmap_2d::InflationLayer"}      
   - {name: grid_layer,          type: "simple_layer_namespace::GridLayer"}     
     #name: simple_layer
     #type: "simple_layer_namespace::SimpleLayer"

obstacle_layer_my:
    observation_sources: scan bump
    scan: {data_type: LaserScan, topic: scan, marking: true, clearing: true, min_obstacle_height: 0.25, max_obstacle_height: 0.35}
    bump: {data_type: PointCloud2, topic: mobile_base/sensors/bumper_pointcloud, marking: true, clearing: false, min_obstacle_height: 0.0, max_obstacle_height: 0.15}


inflation_layer_my:
    observation_sources: scan bump
    scan: {data_type: LaserScan, topic: scan, marking: true, clearing: true, min_obstacle_height: 0.25, max_obstacle_height: 0.35}
    bump: {data_type: PointCloud2, topic: mobile_base/sensors/bumper_pointcloud, marking: true, clearing: false, min_obstacle_height: 0.0, max_obstacle_height: 0.15}


grid_layer:
    observation_sources: scan bump
    scan: {data_type: LaserScan, topic: scan, marking: true, clearing: true, min_obstacle_height: 0.25, max_obstacle_height: 0.35}
    bump: {data_type: PointCloud2, topic: mobile_base/sensors/bumper_pointcloud, marking: true, clearing: false, min_obstacle_height: 0.0, max_obstacle_height: 0.15}

My problem is after running the gazebo and the mygmappingdemo.launch, and rviz of turtlebot navigation like this:

  1. optirun roslaunch turtlebotraulgazebo turtlebotempty_world.launch
  2. roslaunch turtlebotraulgazebo mygmapping_demo.launch
  3. optirun roslaunch turtlebotrvizlaunchers view_navigation.launch

I try to navigate the turtlebot in rviz using "2D Nav Goal" the path of global planner is all good, circumvents the obstacles, but for the local planner the path is wrong, for him doesn't exist obstacles so he try to pass through the obstacles, because my layer simplelayer or gridlayer aren't saving costs in the map. So I don't know if the problem is the cpp files of the layers: simplelayer or gridlayer, or the way I put the plugins in mylocalcostmapparams.yaml, because when I run the roslaunch turtlebotraulgazebo mygmappingdemo.launch I get this:

[ INFO] [1397036705.765097077, 34.590000000]: Laser is mounted upwards.
 -maxUrange 6 -maxUrange 8 -sigma     0.05 -kernelSize 1 -lstep 0.05 -lobsGain 3 -astep 0.05
 -srr 0.01 -srt 0.02 -str 0.01 -stt 0.02
 -linearUpdate 0.5 -angularUpdate 0.436 -resampleThreshold 0.5
 -xmin -1 -xmax 1 -ymin -1 -ymax 1 -delta 0.05 -particles 80
[ INFO] [1397036705.769054497, 34.600000000]: Initialization complete
update frame 0
update ld=0 ad=0
Laser Pose= -0.0867572 0.0137647 -0.0145564
m_count 0
Registering First Scan
[ INFO] [1397036705.838954381, 34.670000000]: Loading from pre-hydro parameter style
[ INFO] [1397036705.947094641, 34.780000000]: Using plugin "static_layer"
[ INFO] [1397036706.183634079, 35.020000000]: Requesting the map...
[ INFO] [1397036706.374853110, 35.220000000]: Resizing costmap to 32 X 32 at 0.050000 m/pix
[ INFO] [1397036706.474076571, 35.320000000]: Received a 32 X 32 map at 0.050000 m/pix
[ INFO] [1397036706.485520871, 35.320000000]: Using plugin "obstacle_layer"
[ INFO] [1397036706.491275496, 35.330000000]:     Subscribed to Topics: scan bump
[ INFO] [1397036706.633632513, 35.480000000]: Using plugin "inflation_layer"
[ INFO] [1397036707.051268521, 35.890000000]: Using plugin "footprint_layer"
[ INFO] [1397036707.211186567, 36.050000000]: Using plugin "obstacle_layer_my"
[ INFO] [1397036707.218004339, 36.060000000]:     Subscribed to Topics: 
[ INFO] [1397036707.256177220, 36.100000000]: Using plugin "inflation_layer_my"
[ INFO] [1397036707.289971534, 36.130000000]: Using plugin "grid_layer"
[ INFO] [1397036707.780966734, 36.620000000]: Created local_planner base_local_planner/TrajectoryPlannerROS
[ INFO] [1397036707.821001275, 36.660000000]: Sim period is set to 0.20
[ INFO] [1397036709.215136563, 38.060000000]: odom received!

If I don't put the plugins and the observation_sources of theirs I obtain this result (like default files):

[ INFO] [1396963043.172160845, 12.060000000]: Laser is mounted upwards.
 -maxUrange 6 -maxUrange 8 -sigma     0.05 -kernelSize 1 -lstep 0.05 -lobsGain 3 -astep 0.05
 -srr 0.01 -srt 0.02 -str 0.01 -stt 0.02
 -linearUpdate 0.5 -angularUpdate 0.436 -resampleThreshold 0.5
 -xmin -1 -xmax 1 -ymin -1 -ymax 1 -delta 0.05 -particles 80
[ INFO] [1396963043.177028332, 12.070000000]: Initialization complete
update frame 0
update ld=0 ad=0
Laser Pose= -0.0869294 0.012873 -0.00428912
m_count 0
Registering First Scan

    [ INFO] [1396963043.274013826, 12.160000000]: Loading from pre-hydro parameter style
    [ INFO] [1396963043.436017508, 12.330000000]: Using plugin "static_layer"       ----
    [ INFO] [1396963043.680294611, 12.580000000]: Requesting the map...                 -----
    [ INFO] [1396963043.876808413, 12.780000000]: Resizing costmap to 32 X 32 at 0.050000 m/pix     ---
    [ INFO] [1396963043.974339162, 12.880000000]: Received a 32 X 32 map at 0.050000 m/pix      ----
    [ INFO] [1396963043.994669524, 12.900000000]: Using plugin "obstacle_layer"         ---
    [ INFO] [1396963044.004677498, 12.900000000]:     Subscribed to Topics: scan bump       -----
    [ INFO] [1396963044.212971023, 13.120000000]: Using plugin "inflation_layer"                ---
    [ INFO] [1396963044.750858678, 13.660000000]: Loading from pre-hydro parameter style        xxx
    [ INFO] [1396963044.909394057, 13.820000000]: Using plugin "obstacle_layer"       ----
    [ INFO] [1396963045.126140535, 14.030000000]:     Subscribed to Topics: scan bump    xxx falta fazer isto
    [ INFO] [1396963045.340618484, 14.240000000]: Using plugin "inflation_layer"        -----
    [ INFO] [1396963045.718097827, 14.620000000]: Created local_planner base_local_planner/TrajectoryPlannerROS
    [ INFO] [1396963045.774572422, 14.680000000]: Sim period is set to 0.20
    [ INFO] [1396963047.095432501, 16.000000000]: odom received!

if you notess in this result I have two times "Loading from pre-hydro parameter style", and in my local cost map I have just one, so I search this on web, and I find this:

  1. https://groups.google.com/forum/#!topic/ros-sig-navigation/gqs0-w5MrSI
  2. http://wiki.ros.org/hydro/Migration

Comparing this result of default files and the results of my local cost map with plugins, I concluded this:

  1. The "Loading from pre-hydro parameter style" appears because the globalcostmapparams and the localcostmapparams doesn't have the tag "plugins" so they go into backward-compatibility mode ,like said here link_wiki.ros. org/hydro/Migration "If the "plugins" parameter are not found, Costmap2DROS goes into backward-compatibility mode and creates and configures a set of plugins which should mimic the old version's behavior.".
  2. In mylocalcosmapparams.yaml with plugins the difference is mark with xxx above in the code, the "Loading from pre-hydro parameter style" because mylocalcosmapparams.yaml have plugins so doesn't need to do backward-compatibility, but i think I have a problem in obsrvation_sources, because of this result:

    [ INFO] [1397036707.211186567, 36.050000000]: Using plugin "obstaclelayermy" [ INFO] [1397036707.218004339, 36.060000000]: Subscribed to Topics: He doesn't subscribe to any topics why?? if i say in sources the topics he need to subscribe.

The question is how can I put mylocalcostmap_param.ymal working fine with plugins, and if someone can say how is the configuration of others plugins in backward-compatibility mode to put in my local layer.

Appreciate your help.

Best Regards

Raul

Asked by Raul Gui on 2014-04-09 03:09:35 UTC

Comments

Is this still an open question, or have you figured it out?

Asked by David Lu on 2014-06-24 14:22:04 UTC

@David Lu , I believe question is still open and i also have the same question/problem. Cheers!

Asked by sobot on 2015-03-16 12:08:17 UTC

Does it work without your custom layer?

Asked by David Lu on 2015-03-16 18:46:21 UTC

Yes, without the layers there is no problem in launching the files. but i use gmapping to produce a map on the fly & i get no inflation, move_base doest account for the obstacles and plan the path right through them. i dont know what im doing wrong here. should i put plugins in a each .yaml?

Asked by sobot on 2015-03-17 04:01:17 UTC

@sobot - can you open your own question (unless you have the same exact configuration as above)?

Asked by David Lu on 2015-03-17 11:25:59 UTC

Answers

it's still open.

Asked by Raul Gui on 2014-07-21 04:50:58 UTC

Comments