Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: cyberbotics/webots_ros2
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2023.0.4
Choose a base ref
...
head repository: cyberbotics/webots_ros2
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing 434 changed files with 9,487 additions and 1,740 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/libcontroller_updater.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: Libcontroller Updater

on:
schedule:
- cron: '0 04 * * *'
workflow_dispatch:

jobs:
automatic-libcontroller-sync:
3 changes: 1 addition & 2 deletions .github/workflows/sync_master_to_develop.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: Branch synchronizer

on:
schedule:
- cron: '0 04 * * *'
workflow_dispatch:

jobs:
sync-develop-with-master:
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
ROS_REPO: [main, testing]
ROS_DISTRO: [humble, rolling]
ROS_DISTRO: [humble, jazzy, rolling]
runs-on: ubuntu-latest
env:
AFTER_INIT: ./scripts/ci_after_init.bash ${ROS_DISTRO} ${ROS_REPO}
@@ -32,7 +32,7 @@ jobs:
ROS_DISTRO: ${{matrix.ROS_DISTRO}}
- name: Upload Artifact
if: ${{ failure() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: generic_artifacts_${{matrix.ROS_REPO}}_${{matrix.ROS_DISTRO}}
path: /artifacts
4 changes: 2 additions & 2 deletions .github/workflows/test_develop.yml
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ jobs:
fail-fast: false
matrix:
ROS_REPO: [main, testing]
ROS_DISTRO: [humble, rolling]
ROS_DISTRO: [humble, jazzy, rolling]
runs-on: ubuntu-latest
env:
AFTER_INIT: ./scripts/ci_after_init.bash ${ROS_DISTRO} ${ROS_REPO}
@@ -31,7 +31,7 @@ jobs:
ROS_DISTRO: ${{matrix.ROS_DISTRO}}
- name: Upload Artifact
if: ${{ failure() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: generic_artifacts_develop_${{matrix.ROS_REPO}}_${{matrix.ROS_DISTRO}}
path: /artifacts
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -12,10 +12,9 @@ It integrates with ROS2 using ROS2 messages, services and actions.

Please visit the [documentation](https://github.com/cyberbotics/webots_ros2/wiki) that contains the following sections:
- [Getting Started](https://github.com/cyberbotics/webots_ros2/wiki/Getting-Started)
- [Complete Installation Guide](https://github.com/cyberbotics/webots_ros2/wiki/Complete-Installation-Guide)
- [Tutorials](https://github.com/cyberbotics/webots_ros2/wiki/Tutorials)
- [Examples](https://github.com/cyberbotics/webots_ros2/wiki/Examples)
- [References](https://github.com/cyberbotics/webots_ros2/wiki/References)
- [Tutorials](https://github.com/cyberbotics/webots_ros2/wiki/Tutorials)


## Acknowledgements
53 changes: 53 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
ARG ROS_DISTRO=jazzy

FROM osrf/ros:${ROS_DISTRO}-desktop

ARG DEBIAN_FRONTEND=noninteractive
ARG UID=1000
ARG DOCKERUSER=
ARG DOCKERUSERCOMMENT=
ARG ROS_DISTRO=jazzy
ARG ROS_TESTING=0
ARG WEBOTS_VERSION=2025a

RUN if [ "${ROS_DISTRO}" != "humble" ]; then userdel -r ubuntu; fi
RUN useradd -d /${DOCKERUSER} -m \
-u ${UID} -U \
-s /usr/bin/bash \
-c "${DOCKERUSERCOMMENT}" ${DOCKERUSER} && \
echo "${DOCKERUSER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
usermod -a -G video ${DOCKERUSER} && \
usermod -a -G dialout ${DOCKERUSER}

RUN echo $WEBOTS_VERSION | grep -q "nightly" && export WEBOTS_URL="https://github.com/cyberbotics/webots/releases/download/${WEBOTS_VERSION}_amd64.deb" || export WEBOTS_URL="https://github.com/cyberbotics/webots/releases/download/R${WEBOTS_VERSION}/webots_${WEBOTS_VERSION}_amd64.deb" && \
apt update && apt install -y wget && \
wget ${WEBOTS_URL} -O /tmp/webots.deb && \
apt install -y /tmp/webots.deb && \
rm /tmp/webots.deb

RUN [ "$ROS_TESTING" -eq "1" ] && echo "deb [ signed-by=/usr/share/keyrings/ros2-latest-archive-keyring.gpg ] http://packages.ros.org/ros2-testing/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros2-latest.list || true

RUN apt-get update && apt-get install -y \
ros-${ROS_DISTRO}-vision-msgs \
ros-${ROS_DISTRO}-xacro \
ros-${ROS_DISTRO}-ros2-control \
ros-${ROS_DISTRO}-ros2-controllers \
ros-${ROS_DISTRO}-robot-localization \
ros-${ROS_DISTRO}-laser-filters \
ros-${ROS_DISTRO}-tf-transformations \
ros-${ROS_DISTRO}-rmw-cyclonedds-cpp \
gdb \
git

# HOTFIX: https://github.com/ros-controls/ros2_control/pull/1960
RUN [ "${ROS_DISTRO}" = "humble" ] && wget -O /tmp/hotfix.deb http://snapshots.ros.org/humble/2024-08-28/ubuntu/pool/main/r/ros-humble-hardware-interface/ros-humble-hardware-interface_2.43.0-1jammy.20240823.145349_amd64.deb && \
apt install -y --allow-downgrades /tmp/hotfix.deb && \
rm -f /tmp/hotfix.deb || true

COPY ./docker/bashrc /tmp/bashrc
COPY ./docker/webots.conf /${DOCKERUSER}/.config/Cyberbotics/Webots-R${WEBOTS_VERSION}.conf
RUN cat /tmp/bashrc >> /${DOCKERUSER}/.bashrc

ENV USERNAME=default
USER ${DOCKERUSER}
WORKDIR /${DOCKERUSER}/ros2_ws
44 changes: 44 additions & 0 deletions docker/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
UID:=$(shell id -u)
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))/../
NVIDIA_GPU:=$(shell docker info | grep Runtimes | grep nvidia 1> /dev/null && nvidia-smi 1> /dev/null && echo '--runtime nvidia --gpus all' || echo '')
DOCKERUSER:=cyberbotics
BASENAME:=webots_ros2
DOCKERUSERCOMMENT:="Cyberbotics"
ROS_DISTRO?=jazzy
ROS_TESTING?=0
WEBOTS_VERSION?=2025a

build:
echo "ROS_TESTING=${ROS_TESTING}"
docker build ${ROOT_DIR} \
-f ${ROOT_DIR}/docker/Dockerfile \
-t ${BASENAME} ${DOCKER_ARGS} \
--build-arg UID=${UID} \
--build-arg DOCKERUSER=${DOCKERUSER} \
--build-arg DOCKERUSERCOMMENT=${DOCKERUSERCOMMENT} \
--build-arg ROS_TESTING=${ROS_TESTING} \
--build-arg WEBOTS_VERSION=${WEBOTS_VERSION} \
--build-arg ROS_DISTRO=${ROS_DISTRO}

run:
@docker container rm -f ${BASENAME}
docker run \
--net=host \
--ipc=host \
--cap-add SYS_ADMIN \
--name ${BASENAME} \
--privileged \
--restart unless-stopped \
-e NVIDIA_DRIVER_CAPABILITIES=all ${NVIDIA_GPU} \
-e DISPLAY=${DISPLAY} \
-v ~/.Xauthority:/${DOCKERUSER}/.Xauthority:ro \
-v /tmp/.X11-unix/:/tmp/.X11-unix:rw \
-v /dev/dri:/dev/dri:ro \
-v ${ROOT_DIR}:/${DOCKERUSER}/ros2_ws/src/${BASENAME} \
-v /dev:/dev:rw \
--entrypoint bash \
-d -it ${BASENAME}


exec:
docker exec -it ${BASENAME} bash
30 changes: 30 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Docker

Development container for the project.

## Dependencies

```bash
sudo apt install git make curl
curl -sSL https://get.docker.com | sh && sudo usermod -aG docker $USER
```

## Usage

You need to build & run the container only the first time:
```bash
ROS_DISTRO=jazzy ROS_TESTING=0 WEBOTS_VERSION=2025a make build run exec
```

if you want to test a nightly build:
```bash
ROS_DISTRO=jazzy ROS_TESTING=0 WEBOTS_VERSION=nightly_25_12_2024/webots_2025a make build run exec
```

After that, you can just attach to the container with:
```bash
make exec
```

> [!NOTE]
> In case you get an error something like `qt.qpa.xcb: could not connect to display :0` then please run `xhost local:root` on the host.
10 changes: 10 additions & 0 deletions docker/bashrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
source /opt/ros/${ROS_DISTRO}/setup.bash
source ~/ros2_libs_ws/install/local_setup.bash
source ~/ros2_ws/install/local_setup.bash
alias cb='colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Debug'
alias teleop='ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args -p stamped:=true'

# For debugging
export WEBOTS_HOME=/usr/local/webots
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/cyberbotics/ros2_ws/src/webots_ros2/webots_ros2_driver/webots/lib/controller
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
17 changes: 17 additions & 0 deletions docker/webots.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[%General]
checkWebotsUpdateOnStartup=false
pythonCommand=python3
rendering=true
startupMode=Real-time
telemetry=false
theme=webots_night.qss

[OpenGL]
GTAO=0
disableAntiAliasing=true
disableShadows=true
textureFiltering=1
textureQuality=0

[Internal]
firstLaunch=false
41 changes: 25 additions & 16 deletions scripts/ci_after_init.bash
Original file line number Diff line number Diff line change
@@ -3,20 +3,24 @@
ROS_DISTRO=$1
ROS_REPO=$2

# Take the latest nightly build
YESTERDAY_WEEK_DAY_NUMBER=`date --date="1 day ago" +"%u"`
LAST_NIGHTLY_DAY_OLD=1
# There is no nightly build the weekend
if [ ${YESTERDAY_WEEK_DAY_NUMBER} -gt 5 ]; then
LAST_NIGHTLY_DAY_OLD="$((${YESTERDAY_WEEK_DAY_NUMBER}-4))"
WEBOTS_VERSION="R${WEBOTS_RELEASE_VERSION}"

if [ "${TEST_WITH_WEBOTS_NIGTHLY}" == "1" ]; then
# Take the latest nightly build
YESTERDAY_WEEK_DAY_NUMBER=`date --date="1 day ago" +"%u"`
LAST_NIGHTLY_DAY_OLD=1
# There is no nightly build the weekend
if [ ${YESTERDAY_WEEK_DAY_NUMBER} -gt 5 ]; then
LAST_NIGHTLY_DAY_OLD="$((${YESTERDAY_WEEK_DAY_NUMBER}-4))"
fi
NIGHTLY_DATE=`date --date="${LAST_NIGHTLY_DAY_OLD} day ago" +"%-d_%-m_%Y"`
WEBOTS_VERSION="nightly_${NIGHTLY_DATE}"
fi
NIGHTLY_DATE=`date --date="${LAST_NIGHTLY_DAY_OLD} day ago" +"%-d_%-m_%Y"`
WEBOTS_NIGHTLY_VERSION="nightly_${NIGHTLY_DATE}"

apt update
apt install -y wget dialog apt-utils psmisc lsb-release git
wget https://github.com/cyberbotics/webots/releases/download/${WEBOTS_NIGHTLY_VERSION}/webots_${WEBOTS_RELEASE_VERSION}_amd64.deb -O /tmp/webots.deb
apt install -y /tmp/webots.deb xvfb
apt update > /dev/null
apt install -y wget dialog apt-utils psmisc lsb-release git > /dev/null
wget https://github.com/cyberbotics/webots/releases/download/${WEBOTS_VERSION}/webots_${WEBOTS_RELEASE_VERSION}_amd64.deb -O /tmp/webots.deb > /dev/null
apt install -y /tmp/webots.deb xvfb > /dev/null

# OpenSSL patch for ubuntu 22
if [[ $(lsb_release -rs) == "22.04" && ${WEBOTS_RELEASE_VERSION} == "2022a" ]]; then
@@ -37,9 +41,14 @@ fi

# TODO: Revert once the https://github.com/ros-planning/navigation2/issues/3033 issue is fixed.
# Fast-DDS is not working properly with the Nav2 package on Humble and Iron. Using Cyclone DDS instead.
if [[ "${ROS_DISTRO}" != "rolling" ]]; then
apt install -y ros-${ROS_DISTRO}-rmw-cyclonedds-cpp
fi
apt install -y ros-${ROS_DISTRO}-rmw-cyclonedds-cpp

# Setup Qt plugins for RViz (can be used once RViz does not randomly crash anymore in GitHub CI).
#export QT_PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/qt5/plugins
# export QT_PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/qt5/plugins

# HOTFIX: https://github.com/ros-controls/ros2_control/pull/1960
if [[ "${ROS_DISTRO}" == "humble" ]]; then
wget -O /tmp/hotfix.deb http://snapshots.ros.org/humble/2024-08-28/ubuntu/pool/main/r/ros-humble-hardware-interface/ros-humble-hardware-interface_2.43.0-1jammy.20240823.145349_amd64.deb && \
apt install -y --allow-downgrades /tmp/hotfix.deb && \
rm -f /tmp/hotfix.deb
fi
7 changes: 3 additions & 4 deletions scripts/ci_before_init_embed.bash
Original file line number Diff line number Diff line change
@@ -2,7 +2,8 @@

ROS_DISTRO=$1

export WEBOTS_RELEASE_VERSION=2023a-rev1
export TEST_WITH_WEBOTS_NIGTHLY=1
export WEBOTS_RELEASE_VERSION=2025a
export WEBOTS_OFFSCREEN=1
export CI=1
export DEBIAN_FRONTEND=noninteractive
@@ -14,6 +15,4 @@ fi

# TODO: Revert once the https://github.com/ros-planning/navigation2/issues/3033 issue is fixed.
# Fast-DDS is not working properly with the Nav2 package on Humble. Using Cyclone DDS instead.
if [[ "${ROS_DISTRO}" != "rolling" ]]; then
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
fi
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
1 change: 1 addition & 0 deletions tests/sources/test_clang_format.py
Original file line number Diff line number Diff line change
@@ -56,6 +56,7 @@ def test_sources_are_clang_format_compliant(self):
'webots_ros2_control',
'webots_ros2_driver',
'webots_ros2_epuck',
'webots_ros2_husarion',
'webots_ros2_importer',
'webots_ros2_mavic',
'webots_ros2_msgs',
5 changes: 4 additions & 1 deletion tests/sources/test_pep8.py
Original file line number Diff line number Diff line change
@@ -31,7 +31,10 @@
skippedDirectories = [
'.git',
'webots_ros2_importer/webots_ros2_importer/urdf2webots/',
'webots_ros2_driver/webots/lib'
'webots_ros2_driver/webots/lib',
'webots_ros2_husarion/rosbot_ros',
'webots_ros2_husarion/rosbot_xl_ros',
'webots_ros2_husarion/ros_components_description'
]
skippedDirectoriesFull = [os.path.join(ROOT_FOLDER, os.path.normpath(path)) for path in skippedDirectories]

48 changes: 47 additions & 1 deletion webots_ros2/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -2,11 +2,57 @@
Changelog for package webots_ros2
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2025.0.0 (2025-XX-XX)
------------------
* Created webots_ros2_husarion package.
* Created webots_ros2_crazyflie package.

2023.1.3 (2024-08-07)
------------------
* Added support for ROS 2 Jazzy.
* Make webots_ros2_driver scripts executable.
* Fixed passing the `robot_description` parameter to ros2_control.
* Fixed the produced URDF to also contain joint limits necessary for ros2_control.
* Added support for the new `ros2_control` API affecting resource_manager and controller_manager.

2023.1.2 (2024-04-08)
------------------
* Fixed errors showing up when launching moveit for ur5e.
* Fixed nav2 turtlebot test failing very often.
* Fixed build and tests for rolling.
* Fixed deprecated ros_controls command: cmd_vel_unstamped.
* Remove usage of deprecated resource manager method: activate_all_components().
* Set is_urdf_loaded__ of the resource manager to true.

2023.1.1 (2023-07-11)
------------------
* Added deprecation message when declaring driver node in launch file.
* Fixed RangeFinder activation to also check for point cloud subscriptions.
* Added component remapping parameter to WebotsController to rename PROTO components.
* Added animation_{start,stop}_recording services to Ros2Supervisor node.
* Added /Ros2Supervisor namespace to Ros2Supervisor node.
* Fixed Python plugin termination on SIGINT call or simulation ends.

2023.1.0 (2023-06-29)
------------------
* Added Ros2Pen static plugin.
* Added support for Navigation2 in Iron.
* Clean simulation reset in launch files.
* Fixed Universal Robot trajectory interpolation.
* Added new TIAGo project to webots_ros2_tiago to run real robot configuration.
* Added new WebotsController node in the driver interface to launch robot controller plugins.
* Fixed unfound robot window library in Tesla example.
* Default to canonical topic name and fix camera_info stamp in Ros2Camera, Ros2RangeFinder.
* Added VacuumGripper gripper support in webots_ros2_driver.
* Added BoolStamped message in webots_ros2_msgs.
* Added GetBool service in webots_ros2_msgs.
* Fixed webots_ros2_control component activation.

2023.0.4 (2023-05-23)
------------------
* Drop support for Foxy.
* Fixed vertical field of view in static RangeFinder plugin.
* Added support for painted point clouds
* Added support for painted point clouds.
* Fixed ability to launch RViz without other tools in e-puck example.
* Fixed command line arguments in importer tools.
* Added custom handler in driver interface to start nodes when Webots is ready.
4 changes: 3 additions & 1 deletion webots_ros2/package.xml
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format2.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>webots_ros2</name>
<version>2023.0.4</version>
<version>2025.0.0</version>
<description>Interface between Webots and ROS2</description>

<maintainer email="support@cyberbotics.com">Cyberbotics</maintainer>
@@ -24,6 +24,8 @@
<exec_depend>webots_ros2_tiago</exec_depend>
<exec_depend>webots_ros2_turtlebot</exec_depend>
<exec_depend>webots_ros2_universal_robot</exec_depend>
<exec_depend>webots_ros2_crazyflie</exec_depend>
<exec_depend>webots_ros2_husarion</exec_depend>

<test_depend>ament_copyright</test_depend>
<test_depend>python3-pytest</test_depend>
Loading