This package provides integration and launch files for simulating Robotnik robots in the Webots simulator (lastly tested webotsR2025a version for ROS2 Jazzy).
launch/: ROS 2 launch files for spawning robots and worlds in Webots.protos/: Custom Webots PROTO files for robot models.resource/: Robot resources, including URDF, configuration files, and meshes.robotnik_webots/: Python package directory (can be used for ROS 2 nodes or utilities).worlds/: Webots world files.
- ROS 2 Jazzy or Humble
- Webots simulator version: R2023b
- Tested with Python 3.12.3
Install required packages to run this package:
python3 -m pip install --user catkin_pkg
sudo apt install -y ros-$ROS_DISTRO-geometry-msgs ros-$ROS_DISTRO-webots-ros2 ros-$ROS_DISTRO-webots-ros2-driver ros-$ROS_DISTRO-webots-ros2* ros-$ROS_DISTRO-controller-manager ros-$ROS_DISTRO-control-msgs ros-$ROS_DISTRO-control-toolbox ros-$ROS_DISTRO-controller-interface ros-$ROS_DISTRO-joint-state-broadcaster ros-$ROS_DISTRO-joint-trajectory-controller ros-$ROS_DISTRO-teleop-twist-keyboard ros-$ROS_DISTRO-rqt-joint-trajectory-controllerYou also should clone install robotnik_common package next to this package. To build this package with ROS 2 and colcon execute:
cd /path/to/your/workspace/src
git clone https://github.com/RobotnikAutomation/robotnik_webots.git
git clone https://github.com/RobotnikAutomation/robotnik_common.git
cd ..
sudo rosdep init && rosdep update && rosdep install --from-paths src --ignore-src -r -y
colcon build --symlink-installros2 launch robotnik_webots spawn_world.launch.pyworld: Name of the world file (without extension). Default:default_worldworld_path: Full path to the world file. Default:<package_share>/worlds/<world>.wbtgui: Launch Webots with GUI (true/false). Default:true
Examples:
Launch a specific world:
ros2 launch robotnik_webots spawn_world.launch.py world:=my_custom_worldLaunch headless (no GUI):
ros2 launch robotnik_webots spawn_world.launch.py gui:=falseros2 launch robotnik_webots spawn_robot.launch.pyrobot_id: Robot personal name. Default:robotrobot: Robot model (e.g.,rbwatcher,rbvogui,rbkairos,rbtheron,rbsummit). Default:rbwatcherrobot_model: Robot type variation. Default: value ofrobotx,y,z: Initial position in the world. Default:0.0run_rviz: Launch RViz2 (true/false). Default:false
Examples:
Spawn a robot at a specific position:
ros2 launch robotnik_webots spawn_robot.launch.py x:=2.0 y:=1.0 z:=0.0Spawn a robot with a custom name and model:
ros2 launch robotnik_webots spawn_robot.launch.py robot:=rbkairos robot_id:=rbkairos1Spawn a robot and launch RViz2:
ros2 launch robotnik_webots spawn_robot.launch.py run_rviz:=trueExample of cmd_vel command to interact with robot:
ros2 topic pub /rbkairos1/diffdrive_controller/cmd_vel geometry_msgs/msg/TwistStamped "{twist:{linear: {x: 2.0, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 2.0}}}" -r 500- Webots simulator in versions R2025 seem to have issues with compatibility with current versions of proto files. Therefore we recommend using older version R2023b.
See the LICENSE file for details.