SLAM Mapping#

Build an occupancy-grid map of the environment by driving the base manually while SLAM runs. When the map looks complete, save it for later use in Autonomous Navigation. See Example Applications for the shared navigation setup. All commands run through nros.

  1. Open the scene:

    Open ~/workspaces/movensys-simulation/<NAVIGATION_MODEL>/navigation_simulation.usd

    nros ros2 launch movensys_navigation_description gazebo_navigation_simulation.launch.py
    
  2. Run the simulator bridge:

    nros ros2 launch movensys_navigation_nav2_config sim_bridge.launch.py use_sim_time:=true
    
  3. Start mapping:

    nros ros2 launch movensys_navigation_nav2_config mapping.launch.py use_sim_time:=true
    

    Add rsp:=false if using Gazebo or ros2_control – both already publish /robot_description.

  4. Drive with the teleop keyboard to cover the environment:

    nros ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args \
         -p turn:=0.5 \
         -p stamped:=true \
         -p frame_id:=base_link \
         -p use_sim_time:=true \
         -r cmd_vel:=/cmd_vel_safe
    
  5. Save the map once coverage is complete:

    nros ros2 run nav2_map_server map_saver_cli \
         -f /home/admin/workspaces/movensys_ws/src/movensys-navigation/movensys_navigation_nav2_config/maps/my_map
    
  1. Open the scene:

    Open ~/workspaces/movensys-simulation/<NAVIGATION_MODEL>/navigation_hil.usd

    Not applicable for HIL.

  2. Start WMX R2 for the navigation base (real WMX runtime) with use_sim_time:=true (see ~/workspaces/movensys_ws/src/wmx-r2/doc/launch_<NAVIGATION_MODEL>_navigation.md).

  3. Start mapping:

    nros ros2 launch movensys_navigation_nav2_config mapping.launch.py use_sim_time:=true
    

    Add rsp:=false if using Gazebo or ros2_control – both already publish /robot_description.

  4. Drive with the teleop keyboard to cover the environment:

    nros ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args \
         -p turn:=0.5 \
         -p stamped:=true \
         -p frame_id:=base_link \
         -p use_sim_time:=true \
         -r cmd_vel:=/cmd_vel_safe
    
  5. Save the map once coverage is complete:

    nros ros2 run nav2_map_server map_saver_cli \
         -f /home/admin/workspaces/movensys_ws/src/movensys-navigation/movensys_navigation_nav2_config/maps/my_map