Skip to content

Getting Started with Gazebo

Overview

You can launch Gazebo and RViz (Moveit) individually, launch RViz together with physical hardware, and now run Nav2 with SLAM Toolbox in simulation to map the environment and test navigation before deploying to the robot.

Launch Gazebo

  • Launch Gazebo simulation: Use this command to run a dynamic simulation of the AI Worker in the Gazebo simulator.

    bash
    ros2 launch ffw_bringup ffw_bg2_follower_ai_gazebo.launch.py
  • View model in RViz only: Use this command when you want to visualize the robot model in RViz without running a full simulation or the physical hardware.

    bash
    ros2 launch ffw_description ffw_bg2_rev4.launch.py
  • Launch RViz with physical hardware: Use this command when you want to operate the physical AI Worker hardware and monitor its status in RViz. This command will launch RViz alongside the hardware interface.

    bash
    ros2 launch ffw_bringup ffw_bg2_follower_ai.launch.py start_rviz:=true
    • Note: This command is the same as the Follower launch command in the Teleoperation Guide and will also launch the cameras by default. To run without cameras, you can add the launch_cameras:=false argument.

Simulation Views

FFW_BG2

FFW BG2 Simulation

FFW_SG2

FFW SG2 Simulation

Launch Moveit

  • Launch Moveit: You can use the following command to launch Moveit for both FFW-BG2 and FFW-SG2:

    bash
    ros2 launch ffw_moveit_config moveit.launch.py
    # Launch Moveit with the AI Worker Follower model (FFW-BG2, FFW-SG2)

    If you are using Gazebo, you should add the argument use_sim:=true:

    bash
    ros2 launch ffw_moveit_config moveit.launch.py use_sim:=true
    # Launch Moveit in simulation mode
AI Worker MoveIt

Launch Nav2 in Gazebo

Use Nav2 with the Gazebo simulation to test autonomous navigation before running on hardware.

  1. Start Gazebo simulation: Use one of the Gazebo launch commands.
    bash
    ros2 launch ffw_bringup ffw_bg2_follower_ai_gazebo.launch.py

Gazebo View in the default world

Gazebo Nav2 View

  1. Launch Nav2:

    A default map matching the current gazebo world is provided. Remap with SLAM Toolbox if you change the world or want a new map.

    • Build a map with SLAM Toolbox:
      bash
      ros2 launch ffw_navigation navigation.launch.py use_slam:=true use_sim_time:=true
      Nav2 starts with SLAM enabled so you can map while driving. In RViz, send goals with 2D Goal Pose to explore and expand the map.

    SLAM Mapping Example

    Nav2 SLAM Mapping

    Save a generated map

    If you ran SLAM and want to reuse the map, save it with:

    bash
    cd ~/ros2_ws/src/ai_worker/ffw_navigation/maps
    ros2 run nav2_map_server map_saver_cli -f ./map

    This produces map.yaml and map.pgm in the maps directory. Change the path with -f /path/to/map_name if needed.

    Saved Map Example

    Example of a saved occupancy grid generated with map_saver_cli:

    Saved map example The map uses a two-dimensional Occupancy Grid Map (OGM). White is free space, black is occupied, and gray is unknown.

  • Use a saved or default map:
    bash
    ros2 launch ffw_navigation navigation.launch.py use_sim_time:=true
    Set the initial pose in RViz with 2D Pose Estimate so AMCL can localize. After Nav2 is running, send a goal in RViz using 2D Goal Pose. The robot will plan and drive to the target pose; if SLAM is enabled, the map updates in real time.

AI Worker and AI Manipulator released under the Apache-2.0 license.