Skip to content

Commit 588b10a

Browse files
ygoumazad-danielomichel
authored
Update Setting-up a Robot Simulation (Webots) tutorial to 2023.0.2 (#3317)
* Update intro to WSL * Revert "Update intro to WSL" This reverts commit 52a52d0. * Update intro to wsl * Remove windows tabs * Add windows WSL tab for extern controller code * Clean tutorial * Update world with declarations * Add supervisor node and environment var * Add ros2supervisorlauncher node creation in launch files * add env variable for linux * Update tutorial with explanations * Update source/Tutorials/Advanced/Simulators/Webots.rst Co-authored-by: ad-daniel <[email protected]> * include correct file for supervisor part * Add WEBOTS_CONTROLLER_URL wsl infos * cleanup * Update source/Tutorials/Advanced/Simulators/Webots.rst Co-authored-by: Olivier Michel <[email protected]> * Remove confusing sentence * Update source/Tutorials/Advanced/Simulators/Webots.rst Co-authored-by: Olivier Michel <[email protected]> * Squashed commit of the following: commit 72effa7 Author: Luke Schmitt <[email protected]> Date: Tue Nov 1 17:26:25 2022 -0500 Fix list formatting on Contact page (#3153) commit dcd066f Author: Dan Zimmerman <[email protected]> Date: Tue Nov 1 16:29:34 2022 -0400 Update throttle logging docs with units and data type hints (re: rclcpp/issues/1929) (#3143) * Note milliseconds on API Concepts page * Add units and types to About Logging page Co-authored-by: dan <[email protected]> Co-authored-by: Chris Lalancette <[email protected]> commit 375b6cf Author: definitelyuncertain <[email protected]> Date: Fri Oct 28 14:30:22 2022 -0500 Change to mention explicit requirement for folder names for .msg and .srv files (#3144) * Change to mention explicit requirement for folder names for msg and srv files From ros2/tutorials#29 * fix typo Co-authored-by: Tomoya Fujita <[email protected]> * fix rst formatting Co-authored-by: Chris Lalancette <[email protected]> Co-authored-by: Tomoya Fujita <[email protected]> Co-authored-by: Chris Lalancette <[email protected]> commit da871ef Author: Sergei Sergienko <[email protected]> Date: Thu Oct 27 17:20:06 2022 +0300 fix link to Gazebo-ROS2 bridge + CLI examples (#3139) * fix link to Gazebo-ROS2 bridge + CLI examples Co-authored-by: Chris Lalancette <[email protected]> commit e19c9b5 Author: Chris Lalancette <[email protected]> Date: Wed Oct 26 16:31:21 2022 -0400 Update the language to match the source code. (#3135) Fallout from #2865 Signed-off-by: Chris Lalancette <[email protected]> commit a5910a1 Author: Chris Lalancette <[email protected]> Date: Wed Oct 26 08:38:36 2022 -0400 Shorten the Windows build-from-source path. (#3130) * Shorten the Windows build-from-source path. This is to keep the total length down below the 260 character limit imposed by Windows by default. Signed-off-by: Chris Lalancette <[email protected]> commit 8225686 Author: Chris Lalancette <[email protected]> Date: Mon Oct 24 08:30:37 2022 -0400 Fix up the variable name in the traveling in time (C++) tutorial. (#3115) This is just to match what is in the code in the upstream repository. Signed-off-by: Chris Lalancette <[email protected]> commit 87ab121 Author: Ian Colwell <[email protected]> Date: Fri Oct 21 11:07:30 2022 -0400 Update default WORKING_DIRECTORY for ament_add_gtest() (#3117) commit 87bf20a Author: chianfern <[email protected]> Date: Tue Oct 18 21:36:57 2022 +0800 Add ParameterDescriptor to 'Using parameters in a class (C++)' (#2865) * Rename node name in "Using parameters" C++ tutorial to be consistent with Python tutorial. Signed-off-by: Tan Chian Fern <[email protected]> Signed-off-by: Chris Lalancette <[email protected]> commit 77646ce Author: George Stavrinos <[email protected]> Date: Tue Oct 18 15:29:37 2022 +0300 Fixed Intel's robot SDK repo with the new devkit name + reference to MoveIt2 instead of 1. (#3107) commit 1d24955 Author: Chris Lalancette <[email protected]> Date: Mon Oct 17 14:06:52 2022 -0400 Monitor parameter changes: Add note to save callback handle (#3102) Signed-off-by: Chris Lalancette <[email protected]> commit 8910a80 Author: David V. Lu!! <[email protected]> Date: Fri Oct 14 09:56:14 2022 -0400 Some testing basics (#3084) * Some testing basics Signed-off-by: David V. Lu <[email protected]> Signed-off-by: Chris Lalancette <[email protected]> commit 8771452 Author: Tomoya Fujita <[email protected]> Date: Fri Oct 14 05:34:20 2022 -0700 Sony's task for Iron Release. (#3089) * Sony's task for Iron Release. Signed-off-by: Tomoya.Fujita <[email protected]> * Rearrange and add in links. Signed-off-by: Chris Lalancette <[email protected]> Signed-off-by: Tomoya.Fujita <[email protected]> Signed-off-by: Chris Lalancette <[email protected]> Co-authored-by: Chris Lalancette <[email protected]> commit 2ea9e7d Author: Yannick Goumaz <[email protected]> Date: Fri Oct 14 14:23:13 2022 +0200 Update Setting-up a Robot Simulation (Webots) tutorial (#3090) * Update intro to WSL * Update world with declarations * Add supervisor node and environment var * Update tutorial with explanations Co-authored-by: ad-daniel <[email protected]> commit 0390a50 Author: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Date: Thu Oct 13 13:42:30 2022 -0400 fix unresolved package requirement to install Humble on Ubuntu 20.04 (#3086) (#3088) * fix command to install humble on Ubuntu 20.04 Co-authored-by: paolo.dimasi <[email protected]> Co-authored-by: Chris Lalancette <[email protected]> (cherry picked from commit 5626af9) Co-authored-by: Paolo Dimasi <[email protected]> * Update Webots.rst * Update intro to wsl * Remove windows tabs * Add windows WSL tab for extern controller code * Clean tutorial * Add ros2supervisorlauncher node creation in launch files * Update intro to WSL * Update tutorial with explanations * include correct file for supervisor part * Add WEBOTS_CONTROLLER_URL wsl infos * cleanup * Remove confusing sentence * Update source/Tutorials/Advanced/Simulators/Webots.rst Co-authored-by: Olivier Michel <[email protected]> * Update source/Tutorials/Advanced/Simulators/Webots.rst Co-authored-by: Olivier Michel <[email protected]> * Squashed commit of the following: commit 72effa7 Author: Luke Schmitt <[email protected]> Date: Tue Nov 1 17:26:25 2022 -0500 Fix list formatting on Contact page (#3153) commit dcd066f Author: Dan Zimmerman <[email protected]> Date: Tue Nov 1 16:29:34 2022 -0400 Update throttle logging docs with units and data type hints (re: rclcpp/issues/1929) (#3143) * Note milliseconds on API Concepts page * Add units and types to About Logging page Co-authored-by: dan <[email protected]> Co-authored-by: Chris Lalancette <[email protected]> commit 375b6cf Author: definitelyuncertain <[email protected]> Date: Fri Oct 28 14:30:22 2022 -0500 Change to mention explicit requirement for folder names for .msg and .srv files (#3144) * Change to mention explicit requirement for folder names for msg and srv files From ros2/tutorials#29 * fix typo Co-authored-by: Tomoya Fujita <[email protected]> * fix rst formatting Co-authored-by: Chris Lalancette <[email protected]> Co-authored-by: Tomoya Fujita <[email protected]> Co-authored-by: Chris Lalancette <[email protected]> commit da871ef Author: Sergei Sergienko <[email protected]> Date: Thu Oct 27 17:20:06 2022 +0300 fix link to Gazebo-ROS2 bridge + CLI examples (#3139) * fix link to Gazebo-ROS2 bridge + CLI examples Co-authored-by: Chris Lalancette <[email protected]> commit e19c9b5 Author: Chris Lalancette <[email protected]> Date: Wed Oct 26 16:31:21 2022 -0400 Update the language to match the source code. (#3135) Fallout from #2865 Signed-off-by: Chris Lalancette <[email protected]> commit a5910a1 Author: Chris Lalancette <[email protected]> Date: Wed Oct 26 08:38:36 2022 -0400 Shorten the Windows build-from-source path. (#3130) * Shorten the Windows build-from-source path. This is to keep the total length down below the 260 character limit imposed by Windows by default. Signed-off-by: Chris Lalancette <[email protected]> commit 8225686 Author: Chris Lalancette <[email protected]> Date: Mon Oct 24 08:30:37 2022 -0400 Fix up the variable name in the traveling in time (C++) tutorial. (#3115) This is just to match what is in the code in the upstream repository. Signed-off-by: Chris Lalancette <[email protected]> commit 87ab121 Author: Ian Colwell <[email protected]> Date: Fri Oct 21 11:07:30 2022 -0400 Update default WORKING_DIRECTORY for ament_add_gtest() (#3117) commit 87bf20a Author: chianfern <[email protected]> Date: Tue Oct 18 21:36:57 2022 +0800 Add ParameterDescriptor to 'Using parameters in a class (C++)' (#2865) * Rename node name in "Using parameters" C++ tutorial to be consistent with Python tutorial. Signed-off-by: Tan Chian Fern <[email protected]> Signed-off-by: Chris Lalancette <[email protected]> commit 77646ce Author: George Stavrinos <[email protected]> Date: Tue Oct 18 15:29:37 2022 +0300 Fixed Intel's robot SDK repo with the new devkit name + reference to MoveIt2 instead of 1. (#3107) commit 1d24955 Author: Chris Lalancette <[email protected]> Date: Mon Oct 17 14:06:52 2022 -0400 Monitor parameter changes: Add note to save callback handle (#3102) Signed-off-by: Chris Lalancette <[email protected]> commit 8910a80 Author: David V. Lu!! <[email protected]> Date: Fri Oct 14 09:56:14 2022 -0400 Some testing basics (#3084) * Some testing basics Signed-off-by: David V. Lu <[email protected]> Signed-off-by: Chris Lalancette <[email protected]> commit 8771452 Author: Tomoya Fujita <[email protected]> Date: Fri Oct 14 05:34:20 2022 -0700 Sony's task for Iron Release. (#3089) * Sony's task for Iron Release. Signed-off-by: Tomoya.Fujita <[email protected]> * Rearrange and add in links. Signed-off-by: Chris Lalancette <[email protected]> Signed-off-by: Tomoya.Fujita <[email protected]> Signed-off-by: Chris Lalancette <[email protected]> Co-authored-by: Chris Lalancette <[email protected]> commit 2ea9e7d Author: Yannick Goumaz <[email protected]> Date: Fri Oct 14 14:23:13 2022 +0200 Update Setting-up a Robot Simulation (Webots) tutorial (#3090) * Update intro to WSL * Update world with declarations * Add supervisor node and environment var * Update tutorial with explanations Co-authored-by: ad-daniel <[email protected]> commit 0390a50 Author: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Date: Thu Oct 13 13:42:30 2022 -0400 fix unresolved package requirement to install Humble on Ubuntu 20.04 (#3086) (#3088) * fix command to install humble on Ubuntu 20.04 Co-authored-by: paolo.dimasi <[email protected]> Co-authored-by: Chris Lalancette <[email protected]> (cherry picked from commit 5626af9) Co-authored-by: Paolo Dimasi <[email protected]> * Update Webots.rst * Update Webots.rst * Remove trailing white spaces * Update to VM and no supervisor * Remove wrong text * Update source/Tutorials/Advanced/Simulators/Webots.rst Co-authored-by: Olivier Michel <[email protected]> --------- Co-authored-by: ad-daniel <[email protected]> Co-authored-by: Olivier Michel <[email protected]>
1 parent fd9adb8 commit 588b10a

File tree

3 files changed

+11
-28
lines changed

3 files changed

+11
-28
lines changed

source/Tutorials/Advanced/Simulators/Code/robot_launch.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ def generate_launch_description():
1616
world=os.path.join(package_dir, 'worlds', 'my_world.wbt')
1717
)
1818

19-
ros2_supervisor = Ros2SupervisorLauncher()
20-
2119
my_robot_driver = Node(
2220
package='webots_ros2_driver',
2321
executable='driver',
@@ -31,7 +29,6 @@ def generate_launch_description():
3129
return LaunchDescription([
3230
webots,
3331
my_robot_driver,
34-
ros2_supervisor,
3532
launch.actions.RegisterEventHandler(
3633
event_handler=launch.event_handlers.OnProcessExit(
3734
target_action=webots,

source/Tutorials/Advanced/Simulators/Code/robot_launch_sensor.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ def generate_launch_description():
1616
world=os.path.join(package_dir, 'worlds', 'my_world.wbt')
1717
)
1818

19-
ros2_supervisor = Ros2SupervisorLauncher()
20-
2119
my_robot_driver = Node(
2220
package='webots_ros2_driver',
2321
executable='driver',
@@ -36,7 +34,6 @@ def generate_launch_description():
3634
return LaunchDescription([
3735
webots,
3836
my_robot_driver,
39-
ros2_supervisor,
4037
obstacle_avoider,
4138
launch.actions.RegisterEventHandler(
4239
event_handler=launch.event_handlers.OnProcessExit(

source/Tutorials/Advanced/Simulators/Webots.rst

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ In particular, :doc:`../../Beginner-CLI-Tools/Introducing-Turtlesim/Introducing-
5050

5151
.. group-tab:: macOS
5252

53-
The Linux and ROS commands of this tutorial must be run in a custom Docker container configured with the ``webots_ros2_driver`` package.
53+
The Linux and ROS commands of this tutorial must be run in a pre-configured Linux Virtual Machine (VM).
5454
See the `Webots ROS 2 macOS installation instructions <https://github.com/cyberbotics/webots_ros2/wiki/macOS-Installation-Guide>`_.
5555

5656
To install ``webots_ros2_driver`` from a terminal, proceed with the following commands.
@@ -203,15 +203,6 @@ You have to specify in the constructor which world file the simulator will open.
203203
:dedent: 4
204204
:lines: 15-17
205205

206-
A supervisor Robot is always automatically added to the world file by ``WebotsLauncher``.
207-
This robot is controlled by the custom node ``Ros2Supervisor``, which must also be started using the ``Ros2SupervisorLauncher``.
208-
This node allows to spawn URDF robots directly into the world, and it also publishes useful topics like ``/clock``.
209-
210-
.. literalinclude:: Code/robot_launch.py
211-
:language: python
212-
:dedent: 4
213-
:lines: 19
214-
215206
Then, the ROS node interacting with the simulated robot is created.
216207
This node, named ``driver``, is located in the ``webots_ros2_driver`` package.
217208

@@ -223,11 +214,11 @@ This node, named ``driver``, is located in the ``webots_ros2_driver`` package.
223214

224215
.. group-tab:: Windows
225216

226-
The node (in WSL) will be able to communicate with the simulated robot (in Webots on Windows) through a TCP connection.
217+
The node (in WSL) will be able to communicate with the simulated robot (in Webots on native Windows) through a TCP connection.
227218

228219
.. group-tab:: macOS
229220

230-
The node (in the docker container) will be able to communicate with the simulated robot (in Webots on macOS) through a TCP connection.
221+
The node (in the docker container) will be able to communicate with the simulated robot (in Webots on native macOS) through a TCP connection.
231222

232223

233224
In your case, you need to run a single instance of this node, because you have a single robot in the simulation.
@@ -239,21 +230,21 @@ The ``robot_description`` parameter holds the contents of the URDF file which re
239230
.. literalinclude:: Code/robot_launch.py
240231
:language: python
241232
:dedent: 4
242-
:lines: 21-29
233+
:lines: 19-27
243234

244235
After that, the three nodes are set to be launched in the ``LaunchDescription`` constructor:
245236

246237
.. literalinclude:: Code/robot_launch.py
247238
:language: python
248239
:dedent: 4
249-
:lines: 31-34
240+
:lines: 29-31
250241

251242
Finally, an optional part is added in order to shutdown all the nodes once Webots terminates (e.g., when it gets closed from the graphical user interface).
252243

253244
.. literalinclude:: Code/robot_launch.py
254245
:language: python
255246
:dedent: 8
256-
:lines: 35-40
247+
:lines: 32-37
257248

258249
6 Modify the setup.py file
259250
^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -269,7 +260,6 @@ This sets-up the package and adds in the ``data_files`` variable the newly added
269260
7 Test the code
270261
^^^^^^^^^^^^^^^
271262

272-
273263
.. tabs::
274264

275265
.. group-tab:: Linux
@@ -306,18 +296,17 @@ This sets-up the package and adds in the ``data_files`` variable the newly added
306296
On macOS, a local server must be started on the host to start Webots from the Docker container.
307297
The local server can be downloaded `on the webots-server repository <https://github.com/cyberbotics/webots-server/blob/main/local_simulation_server.py>`_.
308298

309-
In a terminal of the host machine (not in the container), specify the Webots installation folder (e.g. ``/Applications/Webots.app``) and start the server using the following commands:
299+
In a terminal of the host machine (not in the VM), specify the Webots installation folder (e.g. ``/Applications/Webots.app``) and start the server using the following commands:
310300

311301
.. code-block:: console
312302
313303
export WEBOTS_HOME=/Applications/Webots.app
314304
python3 local_simulation_server.py
315305
316-
From the terminal of the Docker container, build and launch your custom package with:
306+
From a terminal in the Linux VM in your ROS 2 workspace, build and launch your custom package with:
317307

318308
.. code-block:: console
319309
320-
cd ~/ros2_ws
321310
colcon build
322311
source install/local_setup.bash
323312
ros2 launch my_package robot_launch.py
@@ -407,7 +396,7 @@ Go to the file ``robot_launch.py`` and replace ``def generate_launch_description
407396

408397
.. literalinclude:: Code/robot_launch_sensor.py
409398
:language: python
410-
:lines: 11-47
399+
:lines: 11-44
411400

412401
This will create an ``obstacle_avoider`` node that will be included in the ``LaunchDescription``.
413402

@@ -443,7 +432,7 @@ As in task ``7``, launch the simulation from a terminal in your ROS 2 workspace:
443432

444433
.. group-tab:: macOS
445434

446-
In a terminal of the host machine (not in the container), if not done already, specify the Webots installation folder (e.g. ``/Applications/Webots.app``) and start the server using the following commands:
435+
In a terminal of the host machine (not in the VM), if not done already, specify the Webots installation folder (e.g. ``/Applications/Webots.app``) and start the server using the following commands:
447436

448437
.. code-block:: console
449438
@@ -452,7 +441,7 @@ As in task ``7``, launch the simulation from a terminal in your ROS 2 workspace:
452441
453442
Note that the server keeps running once the ROS 2 nodes are ended.
454443
You don't need to restart it every time you want to launch a new simulation.
455-
From the terminal of the Docker container, build and launch your custom package with:
444+
From a terminal in the Linux VM in your ROS 2 workspace, build and launch your custom package with:
456445

457446
.. code-block:: console
458447

0 commit comments

Comments
 (0)