How can I edit a map from cartographer?
I used cartographer_ros (ROS noetic) to create a 2D SLAM map from a laser scan. The generated maps has some imperfections, for example it laser scanner does not detect a mirror. I edited the generated map.pgm to correct it.
But when I use it later on for localization with cartographer_node it shows the original map and not the edited map. What is the proper procedure to use an edited map?
Here is the launch file for navigation. The map.yaml
points to the edited map.pgm
<launch> <arg name="robot_name" default="/"/> <arg name="rviz" default="true"/>
<arg if="$(eval arg('robot_name') == '/')" name="frame_prefix" value="" />
<arg unless="$(eval arg('robot_name') == '/')" name="frame_prefix" value="$(arg robot_name)/" />
<group ns="$(arg robot_name)">
<!-- Map server -->
<arg name="map_file" default="$(find mini_pupper)/maps/map.yaml"/>
<node pkg="map_server" name="map_server" type="map_server" args="$(arg map_file)" >
<param name="frame_id" value="$(arg frame_prefix)map" />
</node>
<!-- Localization -->
<arg name="pbstream_file" default="$(find mini_pupper)/maps/map.pbstream"/>
<node name="cartographer_node" pkg="cartographer_ros"
type="cartographer_node" args="
-configuration_directory $(find mini_pupper)/config/cartographer
-configuration_basename nav.lua
-load_state_filename $(arg pbstream_file)"
output="screen">
</node>
<node name="cartographer_occupancy_grid_node" pkg="cartographer_ros"
type="cartographer_occupancy_grid_node" args="-resolution 0.05" />
<!-- Calls navigation stack -->
<include file="$(find mini_pupper)/launch/include/move_base.launch">
<arg name="frame_prefix" value="$(arg frame_prefix)"/>
<arg name="robot_name" value="$(arg robot_name)"/>
</include>
<node if="$(arg rviz)" name="rviz" pkg="rviz" type="rviz"
args="-d $(find champ_navigation)/rviz/navigate.rviz -f $(arg frame_prefix)map"
output="screen"/>
</group>
</launch>