Home

Awesome

Andino Gazebo Simulation

<img src="./docs/media/populated_office_1.png" width="800"/>

:clipboard: Description

This package provides a simulation environment for Andino in Gazebo Fortress relying on ros_gz to integrate it with ROS 2.

:clamp: Platforms

:inbox_tray: Installation

From binaries

  1. Meet prerequisites: ROS 2 Humble installation
  2. Install andino_gz package
    sudo apt install ros-humble-andino-gz
    
  3. You can jump directly to Usage section and start using it.

From source using a containerized environment

  1. Clone this repository
git clone git@github.com:ekumenlabs/andino_gz.git
  1. Set up docker environment: Refer to docker readme

Once the container is running and dependencies have been installed you can proceed to package building.

:package: Build

The package contains some dependencies that must be installed in order to build it:

rosdep install --from-paths src -i -y

Then build the package and source the install workspace. To do so run the following commands:

colcon build
source install/setup.bash

:rocket: Usage

Andino simulation

<img src="./docs/media/andino_gz.png" width="800"/>

Once the package is built and sourced, you can start a simulation.

ros2 launch andino_gz andino_gz.launch.py

Note: You can use world_name flag to indicate other world to use. (For example: depot.sdf(default), office.sdf, populated_office.sdf, empty.sdf)

By default the ros bridge and rviz are initialized. In case you prefer to disable any of those you can do it via its flags:

ros2 launch andino_gz andino_gz.launch.py ros_bridge:=False rviz:=False

To see a complete list of available arguments for the launch file do:

ros2 launch andino_gz andino_gz.launch.py --show-args

Using a different world:

ros2 launch andino_gz andino_gz.launch.py world_name:=populated_office.sdf
<img src="./docs/media/populated_office_2.png" width="800"/>

Make sure to review the required topics using ign topics and ros2 topic CLI tools. Also, consider using looking at the translation entries under andino_gz/config/bridge_config.yaml.

:robot::robot::robot: Multi robot simulation

This simulation also supports multi-robot simulation.

ros2 launch andino_gz andino_gz.launch.py robots:="
     andino1={x: 0.0, y: 0.0, z: 0.1, yaw: 0.};
     andino2={x: -0.4, y: 0.1, z: 0.1, yaw: 0.};
     andino3={x: -0.4, y: -0.1, z: 0.1, yaw: 0.};
     andino4={x: -0.8, y: 0.2, z: 0.1, yaw: 0.};
     andino5={x: -0.8, y: -0.2, z: 0.1, yaw: 0.};
     andino6={x: -0.8, y: 0.0, z: 0.1, yaw: 0.};"
<img src="./docs/media/andino_gz_multi_robot.png" width="800"/>

The launch file is in charge of:

The simulation allows you to spawn as many robots as you want via the --robots flags. For that, you can pass the information of the robots in some YAML format via ROS2 cli:

  <robot_name>={x: 0.0, y: 0.0, yaw: 0.0, roll: 0.0, pitch: 0.0, yaw: 0.0};

:compass: Navigation

<img src="./docs/media/andino_nav2.png" width="800"/>
  1. Run the simulation passing the nav2 flag.

    ros2 launch andino_gz andino_gz.launch.py nav2:=True
    

    As before, you can launch as many robots as you want, for example launching two:

    ros2 launch andino_gz andino_gz.launch.py nav2:=True robots:="andino1={x: 0.0, y: 0.0, z: 0.1, yaw: 0.};andino2={x: 1.0, y: 0.0, z: 0.1, yaw: 0.};" 
    

    Once Gazebo window pops up, play the simulation using the gui.

    Important!:

    • When using nav2 flag, the map must match the selected world. For example:
      • For depot.sdf world, the map need to be depot:
        ros2 launch andino_gz andino_gz.launch.py nav2:=True world_name:=depot.sdf map:=depot
        
        Typically, as this is the default world-map, there is no need to indicate them.
      • For office.sdf and populated_office.sdf worlds, the map need to be office:
        ros2 launch andino_gz andino_gz.launch.py nav2:=True world_name:=office.sdf map:=office
        
  2. An RViz window will be spawned for each robot so it can be controlled independently. Use 2D Pose Estimate to pass a hint to AMCL where is the initial point

    Note you have to do it per robot, namely, per RViz window.

    <img src="./docs/media/andino_nav2_pose_estimate.png" width="800"/>
  3. Send the desired goal using Nav2 Goal

    <img src="./docs/media/andino_nav2_goal_pose.png" width="800"/>

:world_map: SLAM

<img src="./docs/media/andino_slam.png" width="800"/>
  1. Run simulation with ros bridge and RViz.

    ros2 launch andino_gz andino_gz.launch.py
    
  2. Run slam toolbox

    ros2 launch andino_gz slam_toolbox_online_async.launch.py
    

    Configuration can be forwarded to the slam_toolbox_node. By default, the configuration parameters are obtained from andino's configuration file. In case a custom file is wanted to be passed, simply use the launch file argument for indicating the path to a new file.

    ros2 launch andino_gz slam_toolbox_online_async.launch.py slams_param_file:=<my_path>
    
  3. Visualize in RViz: Add map panel to RViz and see how the map is being generated.

:raised_hands: Contributing

Issues or PRs are always welcome! Please refer to CONTRIBUTING doc.

Code development

Note that a Docker folder is provided for easy setting up the workspace.