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

costmap_2d plugin

asked 2018-10-15 21:04:24 -0600

saito gravatar image

updated 2018-10-29 22:37:02 -0600

Hello. I am a ROS beginner. I am doing SLAM of turtlebot 3 (waffle) in the ubuntu 16.04, ros (kinetic) personal computer environment. I modified local_costmap_params.yaml to use the costmap _ 2 d plugin (Inflation Layer). After the change, it became as follows.

local_costmap: global_frame: /odom robot_base_frame: /base_footprint

update_frequency: 10.0 publish_frequency: 10.0 transform_tolerance: 0.5

static_map: false rolling_window: true width: 3 height: 3 resolution: 0.05 plugins: - {name: inflation_layer, type: "costmap_2d::InflationLayer"}

However, after starting gazebo normally,

$ export TURTLEBOT3_MODEL=waffle $roslaunch turtlebot3_navigation turtlebot3_navigation.launch map_file:=$HOME/map.yaml

When you do this,

Warning: Invalid argument "/map" passed to canTransform argument target_frame in tf2 frame_ids cannot start with a '/' like: at line 134 in /tmp/binarydeb/ros-kinetic-tf2-0.5.18/src/buffer_core.cpp

The error will come out in succession. Could I ask the reason? I feel that I am doing some fundamental mistake. Thank you.!thisplugin

edit retag flag offensive close merge delete

Comments

Do you have a costmap_common_params.yaml file? If yes please update your answers with it.

pavel92 gravatar image pavel92  ( 2018-10-29 02:42:11 -0600 )edit

thank you.I have a costmap_common_params_waffle.yaml .this is OK?

saito gravatar image saito  ( 2018-10-29 04:18:37 -0600 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2018-10-29 02:42:17 -0600

pavel92 gravatar image

updated 2018-10-30 03:11:57 -0600

Try using the following local_costmap_params.yaml:

local_costmap:
  global_frame: odom
  robot_base_frame: base_footprint
  map_type: costmap

  static_map: false
  rolling_window: true
  width: 3.0
  height: 3.0
  resolution: 0.05
  always_send_full_costmap: true

  update_frequency: 10.0
  publish_frequency: 10.0
  transform_tolerance: 0.5

  plugins:
  - {name: inflater_layer, type: "costmap_2d::InflationLayer"}

  inflater_layer:
    inflation_radius: 0.2 # adjust the inflation for your system setup
    cost_scaling_factor: 1.0

The problem most probably is a TF2 thing. It does not accept leading slashes on TF2 frame names so make sure that in your common, local and global params files you dont use a "/" in the frame names

edit flag offensive delete link more

Comments

I did that. However, I get an error message. Also, even if you restore the same error message will appear. This error message will appear continuously.

Warning: Invalid argument "/map" passed to canTransform argument target_frame in tf2 frame_ids cannot start with a '/' like: at line 134

saito gravatar image saito  ( 2018-10-29 04:28:18 -0600 )edit

according to your question you had something like:

local_costmap: 
  global_frame: /odom 
  robot_base_frame: /base_footprint
...

Did you try setting the frames without "/" so it looks like:

local_costmap: 
  global_frame: odom 
  robot_base_frame: base_footprint
pavel92 gravatar image pavel92  ( 2018-10-29 04:48:57 -0600 )edit

The same error occurs in either way. Also, reinstalling the package of turtlebot 3 will cause the same error, so it may be due to a different location somewhere.Image added. The costmap is in error in RViz.

saito gravatar image saito  ( 2018-10-29 04:51:56 -0600 )edit

maybe it is coming from the global_costmap_params.yaml or costmap_common_params.yaml. Check if there the frame is put with a "/"

pavel92 gravatar image pavel92  ( 2018-10-29 07:07:15 -0600 )edit
1

Looks like it is a TF2 thing. It does not accept leading slashes on TF2 frame names so make sure that in your common, local and global params files you dont use a "/" in the frame names

pavel92 gravatar image pavel92  ( 2018-10-29 07:10:20 -0600 )edit

Thank you. The "/" in global was the cause.However, this image is displayed even though you do not use the plugin. Is plugin(static,obstacle,inflation) being used as a standard?

saito gravatar image saito  ( 2018-10-29 22:35:32 -0600 )edit

I am glad it fixed your initial problem. You can mark the answer as correct now by clicking the green tick. As for the plugins, the static, obstacle or inflation layers are used as standard plugins. You can also write and implement your own custom plugin

pavel92 gravatar image pavel92  ( 2018-10-30 03:11:07 -0600 )edit

Thank you! I have made a new question about the new plugin. Please answer if you are good!

saito gravatar image saito  ( 2018-10-30 03:23:23 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2018-10-15 21:04:24 -0600

Seen: 1,760 times

Last updated: Oct 30 '18