Autonomous Navigation#

Drive the base autonomously with the Nav2 stack: localize against the map saved in SLAM Mapping, set the initial pose, and send goal poses that Nav2 plans and executes on the collision-aware /cmd_vel_safe topic. 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. Launch navigation:

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

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

  4. Set the initial pose: in RViz, click 2D Pose Estimate and click the map at the robot’s current position and heading.

  5. Send a goal pose:

    nros ros2 action send_goal /navigate_to_pose nav2_msgs/action/NavigateToPose \
      "'{pose: {header: {frame_id: map}, pose: {position: {x: 8.0, y: 0.0, z: 0.0}, \
      orientation: {x: 0.0, y: 0.0, z: 0.0, w: 1.0}}}}'"
    
  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. Launch navigation:

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

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

  4. Set the initial pose: in RViz, click 2D Pose Estimate and click the map at the robot’s current position and heading.

  5. Send a goal pose:

    nros ros2 action send_goal /navigate_to_pose nav2_msgs/action/NavigateToPose \
      "'{pose: {header: {frame_id: map}, pose: {position: {x: 8.0, y: 0.0, z: 0.0}, \
      orientation: {x: 0.0, y: 0.0, z: 0.0, w: 1.0}}}}'"