layered costmaps map_topic
I am learning to use layered costmaps, have gone through the tutorials, and they are basically working. However, I don't understand how map_topics works with map_server. I suspect I am missing some very basic point, but need help to figure it out.
I can specify a map_topic associated with a static layer (see below), but I don't know how to publish a map to that map_topic. As far as I can tell, map_server only publishes to /map.
For example, I have two static maps, one for a lower laser and the other for an upper laser. I setup the local costmap params as follows, but cannot get map_server to supply the maps with specific topic names.
Also, in amcl, I want to only use the upper static map. I know that I can make the parameter "use_map_topic" = true, but how do I specify the map_topic name?
lower_costmap:
global_frame: /map
robot_base_frame: /base_footprint
update_frequency: 1.0
publish_frequency: 0.0
static_map: true
rolling_window: false
resolution: 0.05
transform_tolerance: 1.0
plugins:
- {name: static_map_10lx_layer, type: "costmap_2d::StaticLayer"}
- {name: obstacle_layer, type: "costmap_2d::VoxelLayer"}
- {name: inflation_layer, type: "costmap_2d::InflationLayer"}
and the global as follows:
upper_costmap:
global_frame: /map
robot_base_frame: /base_footprint
update_frequency: 1.0
publish_frequency: 0.0
static_map: true
rolling_window: false
resolution: 0.05
transform_tolerance: 1.0
plugins:
- {name: static_map_30lx_layer, type: "costmap_2d::StaticLayer"}
- {name: obstacle_layer, type: "costmap_2d::VoxelLayer"}
- {name: inflation_layer, type: "costmap_2d::InflationLayer"}
with the common params as follows:
obstacle_range: 2.5
raytrace_range: 3.0
footprint: [[0.23, 0.23], [0.23, -0.23], [-0.23, -0.23], [-0.23, 0.23]]
#robot_radius: 0.4
inflation_radius: 0.34
max_obstacle_height: 0.6
min_obstacle_height: 0.0
static_map_30lx_layer:
map_topic: /30lx
static_map_10lx_layer:
map_topic: /10lx
obstacle_layer:
observation_sources: hokuyo_04lx
hokuyo_04lx: {sensor_frame: hokuyo_04lx_link, data_type: LaserScan, obstacle_range: 8, topic: /hokuyo_04lx_scan, marking: true, clearing: true}
inflation_layer:
inflation_radius: 0.34
In a launch file, I run map_server as follows:
<arg name="map_name" value="30lx"/>
<node name="map_server" pkg="map_server" type="map_server" args="$(find myBot)/maps/$(arg map_name).yaml">
<param name="frame_id" value="hokuyo_30lx_link"/>
</node>
but there is no way I can find to publish to the map_topic. Assuming that I do find a way to do that, should I run two instances of map_server, each publishing its own topic?