ROS、tf2に切り替えた際の以下のエラーの解消法 (Warning)Invalid argument "/map" passed to canTransform argument target_frame

問題

ROSにて、tfをtf2に切り替えると、

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.20/src/buffer_core.cpp

というエラーが出てmove_baseが実行できない。
tf2は下位互換があるって話だから切り替えたのに・・・・。

解決策

tf2は先頭フレームに" / "をつけることができないため、ここでエラーが出ている模様。
global_costmap_params.yamlと、local_costmap_params.yamlの" / "を削除することで、これまで同様にlaunchファイルを実行することが可能。

local_costmap:
# (was)
#  global_frame: /map
# (is)
  global_frame: map

  robot_base_frame: base_link
  update_frequency: 2.0
  publish_frequency: 1.0
  static_map: false
  inflation_radius: 0.4
  rolling_window: true
  width: 1.5
  height: 1.5
  resolution: 0.05
  plugins:
   - {name: obstacle_layer, type: "costmap_2d::ObstacleLayer"}
   - {name: inflation_layer, type: "costmap_2d::InflationLayer"}
  obstacle_layer:
    observation_sources: laser
    laser: {topic: scan, data_type: LaserScan, expected_update_rate: 2.0, observation_persistence: 0.0, marking: true, clearing: true}