This package provides a simulation environment for Andino in Webots using webots_ros2 to integrate it with ROS 2.
Webots
uses PROTO as their robot description format, while the Andino
robot description is written in URDF
format.
The urdf2webots package provides a tool to convert a URDF
robot description to a Webots
-compatible proto file. This tool is used by the webots_ros2
package to convert the robot description in runtime.
- ROS 2: Humble Hawksbill
- OS:
- Ubuntu 22.04 Jammy Jellyfish
This package makes use of some packages from https://github.com/Ekumen-OS/andino repository. Therefore, the repository is brought as a git submodule.
For so, when cloning this repository make sure to also init the submodules, this can be done adding a --recursive
flag to the git clone
command
- Clone this repository
git clone [email protected]:ekumenlabs/andino_webots.git --recursive
- 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 an empty simulation by running the following ROS 2 launch file:
ros2 launch andino_webots launch_webots_world.launch.py world:=andino_webots
This launch file starts an empty simulation in a world given by the world
argument. This argument defines the wbt file of the world where andino will run. It should be present in the package's world
folder.
Defaults to: andino_webots
.
To spawn an Andino to a running webots_ros2 simulation you may run a separate launchfile:
ros2 launch andino_webots spawn_andino_webots.launch.py
This launch file supports the following launch arguments:
use_sim_time
. Parameter to indicate to the robot controller to synchronize with simulation time. Defaults totrue
.rsp
. Parameter to decide whether to spawn therobot state publisher
node or not. Defaults totrue
.
Alternatively you can launch the simulation along with the robot by running the andino_webots.launch.py
launchfile, which includes both previous commands:
ros2 launch andino_webots andino_webots.launch.py
This launchfile accepts all previous arguments, with the addition of the choice to run a custom plugin to remove nodes from a robot in the simulation:
remove_nodes
. Decide whether to run theNodeRemover
plugin, which removes specific nodes from a robot in the simulation. The parameters for this plugin can be set in thenode_remover_plugin.urdf
file in the package. Defaults to 'true'.
The robot is connected to the webots_ros2_control
plugin, that enables teleoperation by requesting commands via /cmd_vel
; so, out of the box, the package is ready to accept velocity commands.
The package automatically creates a ROS 2 interface for Andino
sensors, exposing its readings to a topic at a given refresh rate. The parameters to configure this interface are defined in the andino_webots.urdf
description file.
The NodeRemover is a custom webots_ros2
Supervisor plugin that allows users to modify the simulation in runtime by removing specific nodes from a given Robot.
The associated launchfile spawns a Supervisor robot in a running simulation and attaches the node_remover_plugin to it, which takes in a robot's name and list of the nodes to be removed as parameters.
It's provided in this package as an example of the tool's capabilities, as well as a means of providing a workaround for urdf2webots
not having a straightforward way to generate a free rotating joint, removing the caster's motor Nodes.
Issues or PRs are always welcome! Please refer to CONTRIBUTING doc.
Note that a Docker
folder is provided for easy setting up the workspace.