This package provides a simulation environment for Andino in Gazebo Fortress relying on ros_gz to integrate it with ROS 2.
- ROS 2: Humble Hawksbill
- OS:
- Ubuntu 22.04 Jammy Jellyfish
- Gazebo:
- Fortress
- Meet prerequisites: ROS 2 Humble installation
- Install
andino_gz
packagesudo apt install ros-humble-andino-gz
- You can jump directly to Usage section and start using it.
- Clone this repository
git clone [email protected]:ekumenlabs/andino_gz.git
- Set up docker environment: Refer to docker readme
Once the container is running and dependencies have been installed you can proceed to package building.
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
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
.
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.};"
- Note1: You can add as many Andino as you want.
- Note2: If enabling Nav2(Using
nav2:=True
) try first with 2 robots and see how they perform in your system before using more robots.
The launch file is in charge of:
- Start Gazebo simulator with a defined world (See '--world_name' flag)
- Spawn as many robots as commanded.
- Launch ros bridge for each robot.
- Launch Rviz visualization for each robot.
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};
- Note1: A ROS Namespace is pushed for each robot so all the topics and nodes are called the same with a difference of a
<robot_name>
prefix. - Note2: For RViz2 to work with the ROS namespace that is pushed, one has to ensure that no absolute topics are being used.
-
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, themap
must match the selectedworld
. For example:- For
depot.sdf
world, the map need to bedepot
:Typically, as this is the default world-map, there is no need to indicate them.ros2 launch andino_gz andino_gz.launch.py nav2:=True world_name:=depot.sdf map:=depot
- For
office.sdf
andpopulated_office.sdf
worlds, the map need to beoffice
:ros2 launch andino_gz andino_gz.launch.py nav2:=True world_name:=office.sdf map:=office
- For
- When using
-
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 pointNote you have to do it per robot, namely, per RViz window.
-
Send the desired goal using Nav2 Goal
-
Run simulation with ros bridge and RViz.
ros2 launch andino_gz andino_gz.launch.py
-
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>
-
Visualize in RViz: Add
map
panel to RViz and see how the map is being generated.
Issues or PRs are always welcome! Please refer to CONTRIBUTING doc.
Note that a Docker
folder is provided for easy setting up the workspace.