../_images/tiagopro-icon.png ../_images/tiago-head-icon.png ../_images/kangaroo-icon.png ../_images/tiago-icon.png ../_images/triago-icon.png ../_images/ari-icon.png ../_images/talos-icon.png ../_images/mobile-bases-icon.png

Simulation#

3D simulation with Gazebo#

Introduction to Gazebo world environments#

PAL’s robots can be simulated with the Gazebo simulator, that offers a realistic 3D environment for simulating and testing our robots. It is integrated with ROS 2 providing features like accurate physics simulation, sensors emulation and customizable environments.

Several different world environments are provided with PAL’s robots:

  • Empty world is loaded as default when the simulation is launched. The robot spawns in an empty world with no objects, as shown in Figure: Empty world simulated in Gazebo. In order to launch the simulation, the following instruction needs to be executed in a terminal:

    source /opt/pal/${PAL_DISTRO}/setup.bash
    ros2 launch robot_name_gazebo robot_name_gazebo.launch.py
    
    Empty world simulated in Gazebo

    Figure: Empty world simulated in Gazebo#

  • Office world is a simple office world as shown in Figure: Small office world simulated in Gazebo can be launched with the following instruction:

    source /opt/pal/${PAL_DISTRO}/setup.bash
    ros2 launch robot_name_gazebo robot_name_gazebo.launch.py world_name:=small_office
    
    Small office world simulated in Gazebo

    Figure: Small office world simulated in Gazebo#

  • PAL Gazebo worlds custom worlds are created by PAL Robotics and are also available in the humble distro or can be found at the following link: https://github.com/pal-robotics/pal_gazebo_worlds

PAL robots simulation#

To start TIAGo Pro using the Gazebo simulation run the following command:

source /opt/pal/${PAL_DISTRO}/setup.bash
ros2 launch tiago_pro_gazebo tiago_pro_gazebo.launch.py
TIAGo Pro robot simulated in Gazebo

Figure: TIAGo Pro robot simulated in Gazebo#

Autonomous Navigation simulation#

To start the 🧭 Navigation functionalities along with the Gazebo simulation, the following command can be used:

source /opt/pal/${PAL_DISTRO}/setup.bash
ros2 launch <robot>_gazebo <robot>_gazebo.launch.py navigation:=True

Attention

Make sure to replace the <robot> placeholder with the name of your robot (e.g. tiago, omni_base, tiago_pro, etc.).

This starts the Autonomos Navigation along with the πŸ“ Localization and Rviz to interact with the robot. While in localization mode, the robot will use a map of the environment to localize itself and navigate autonomously. The pal_maps package offers several maps corresponding to the world environment loaded in Gazebo.

For example, to Navigate and Localize in the small_office world, it is enough to use the command:

source /opt/pal/${PAL_DISTRO}/setup.bash
ros2 launch <robot>_gazebo <robot>_gazebo.launch.py navigation:=True world_name:=small_office

And then change the current map with the command

ros2 service call /map_server/load_map nav2_msgs/srv/LoadMap "map_url: '<PAL_MAPS_DIR>/maps/small/office/map.yaml'"

Attention

Make sure to replace the <PAL_MAPS_DIR> placeholder with the full directory where you cloned ot installed the pal_maps package.

And the Localization will use the small_office map.

../_images/small_office_map.svg

Otherwise, if you want to start the Autonomous Navigation with the πŸ—ΊοΈ Mapping to create a new map of a simulated environment, you can use the following command:

source /opt/pal/${PAL_DISTRO}/setup.bash
ros2 launch <robot>_gazebo <robot>_gazebo.launch.py navigation:=True slam:=True

Interaction simulation with PAL’s Interaction Simulator#

PAL Interaction simulator

See PAL Interaction simulator for more information.