Skip to content

Commit

Permalink
Merge pull request #133 from BlueAndi/develop/ROS2_nhjschulz
Browse files Browse the repository at this point in the history
Develop/ROS2_nhjschulz
  • Loading branch information
nhjschulz authored Aug 7, 2024
2 parents 741f27b + cdd3bcb commit 7625184
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
43 changes: 42 additions & 1 deletion doc/ROS2/setup/Webots.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Installation of Webots

## Official Setup Procedure
## Webots Setup Procedure
Follow the official installation guide for Webots on Linux with APT on the
[Webots installation Page](https://cyberbotics.com/doc/guide/installation-procedure#installing-the-debian-package-with-the-advanced-packaging-tool-apt).

Expand All @@ -22,3 +22,44 @@ If you get an error like "cannot open Display", try the following:
wsl --update
```
* try running Webots again

## Webots ROS2 Package

The setup procedure is described on [this page](https://docs.ros.org/en/jazzy/Tutorials/Advanced/Simulators/Webots/Installation-Ubuntu.html)
from the Jazzy documentation. The listed package is not found by apt, so
install it using building from source.

Note: For the time being, we need to install a patched version from https://github.com/nhjschulz/webots_ros2.git.
The official one doesn't seem to support webots running inside WSL, but expects msys2/mingw.

transcript:

```bash
mkdir -p ros2_webots_ws/src
cd ros2_webots_ws
git clone --recurse-submodules https://github.com/nhjschulz/webots_ros2.git src/webots_ros2

sudo apt install python3-pip python3-rosdep python3-colcon-common-extensions
sudo rosdep init && rosdep update
rosdep install --from-paths src --ignore-src --rosdistro jazzy

colcon build

```

## Running Webots ROS2 Universal Robot

See Task 2 from this [Jazzy documentaion page](https://docs.ros.org/en/jazzy/Tutorials/Advanced/Simulators/Webots/Installation-Ubuntu.html#launch-the-webots-ros2-universal-robot-example)


```bash
export WEBOTS_HOME=/usr/local/webots
cd ros2_webots_ws/src/
source install/local_setup.bash

ros2 launch webots_ros2_universal_robot multirobot_launch.py
```

You should get the following simulation on the screen:

![Webots ROS2 Example](./img/Webots_ros2_example.png)
Binary file added doc/ROS2/setup/img/Webots_ros2_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7625184

Please sign in to comment.