Page tree
Skip to end of metadata
Go to start of metadata

Preconditions

Before starting the mapping procedure make sure that the basic ROS nodes (as defined in bringup.launch) are running. By default this is the case.

If not, see ROS II-Getting Started for more information.

Starting the mapping procedure

To start the mapping procedure you can use the "mapping" launch file as follows:

ros2 launch neo_mp_400-2 mapping.launch.py
ros2 launch neo_mp_500-2 mapping.launch.py
ros2 launch neo_mpo_500-2 mapping.launch.py
ros2 launch neo_mpo_700-2 mapping.launch.py

Please choose the correct package name depending on your platform.

If the default mapping parameters are not sufficient you can edit them here: ~/ros2_workspace/src/neo_mp[...]/configs/navigation/mapping.yaml


See https://github.com/SteveMacenski/slam_toolbox for more information regarding SLAM-Toolboc.

Visualizing the mapping process (Under Construction)

You can visualize the mapping procedure in real-time using Rviz as follows:

roslaunch neo_mp_400-2 rviz_navigation.launch
roslaunch neo_mp_500-2 rviz_navigation.launch
roslaunch neo_mpo_500-2 rviz_navigation.launch
roslaunch neo_mpo_700-2 rviz_navigation.launch

Please choose the correct package name depending on your platform.



Visualization is best done on a Client PC, see ROS II-Getting Started for how to setup the connection.

Mapping your environment

Once the mapping procedure has been started you can drive around your environment to create a map for it.

Try to avoid making fast movements or triggering the scanner stop.

Saving the map

Once you are finished mapping the environment you can save the map as follows:

ros2 run nav2_map_server map_saver_cli -f your_map_name

This will create two files, a "your_map_name.pgm" file and a "your_map_name.yaml" file. Both files are necessary and they should always be in the same directory.

Installing the map

In order to use the map for navigation later on it is necessary to copy it to the "maps" folder:

cp your_map_name.* ~/ros2_workspace/src/neo_mp[...]/configs/navigation/maps/

If the "maps" folder does not exist you can just create it first.

Selecting the map for navigation

The map being used for navigation is specified with an environment variable called MAP_NAME.

You can adjust the MAP_NAME in ~/ros2_workspace/src/neo_mp[...]/launch/navigation.launch.py, for example:

map_dir = LaunchConfiguration(
        'map',
        default=os.path.join(
            get_package_share_directory('neo_mpo_700-2'),
            'configs/navigation/maps',
            'YOUR_MAP_NAME'))

Note that the map name does not include any file extension.

Next steps

  • No labels