Ekumen-OS / andino_gz

Andino Simulation using Gazebo simulator
8 stars 3 forks source link
andino gazebo ignition robotics ros2

Andino Gazebo Simulation

: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

  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

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

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.};"

:compass: Navigation

  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.

  3. Send the desired goal using Nav2 Goal

:world_map: SLAM

  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.