Skip to content

Linux Installation Guide

Yannick Goumaz edited this page Nov 21, 2022 · 4 revisions

Install webots_ros2

You can either install the official released package, or install it from the last up-to-date sources committed on this repository.

Install webots_ros2 distributed package

sudo apt-get install ros-$ROS_DISTRO-webots-ros2

Install webots_ros2 from sources

# Create a ROS2 workspace
mkdir -p ~/ros2_ws/src

# Source ROS2 environment
source /opt/ros/$ROS_DISTRO/setup.bash

# Retrieve the sources
cd ~/ros2_ws
git clone --recurse-submodules https://github.com/cyberbotics/webots_ros2.git src/webots_ros2

# Install dependencies
sudo apt install python3-pip python3-rosdep python3-colcon-common-extensions
sudo rosdep init && rosdep update
rosdep install --from-paths src --ignore-src --rosdistro $ROS_DISTRO

# Building packages
colcon build

# Source this workspace (careful when also sourcing others)
source install/local_setup.bash

Launch demos

The following instructions explain how to start a provided example.

source /opt/ros/$ROS_DISTRO/setup.bash

# To start a specific Webots installation, set WEBOTS_HOME
export WEBOTS_HOME=/usr/local/webots

# If installed from sources, source the ROS2 workspace
source install/local_setup.bash

# Start demo package (e.g. webots_ros2_epuck)
ros2 launch webots_ros2_epuck robot_launch.py
Clone this wiki locally