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.
Open the scene:
Open
~/workspaces/movensys-simulation/<NAVIGATION_MODEL>/navigation_simulation.usdnros ros2 launch movensys_navigation_description gazebo_navigation_simulation.launch.py
Run the simulator bridge:
nros ros2 launch movensys_navigation_nav2_config sim_bridge.launch.py use_sim_time:=true
Start mapping:
nros ros2 launch movensys_navigation_nav2_config mapping.launch.py use_sim_time:=true
Add
rsp:=falseif using Gazebo orros2_control– both already publish/robot_description.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
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
Open the scene:
Open
~/workspaces/movensys-simulation/<NAVIGATION_MODEL>/navigation_hil.usdNot applicable for HIL.
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).Start mapping:
nros ros2 launch movensys_navigation_nav2_config mapping.launch.py use_sim_time:=true
Add
rsp:=falseif using Gazebo orros2_control– both already publish/robot_description.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
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