Giter Club home page Giter Club logo

webots_ros2's Introduction

Webots ROS2 Interface

Test Status license - apache 2.0 Version

webots_ros2 is a package that provides the necessary interfaces to simulate a robot in the Webots open-source 3D robots simulator. It integrates with ROS2 using ROS2 messages, services and actions.

Webots

Please visit the documentation that contains the following sections:

Acknowledgements

rosin_logo

Supported by ROSIN - ROS-Industrial Quality-Assured Robot Software Components. More information: rosin-project.eu

eu_flag

This project has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement no. 732287.


opendr_logo

Supported by OpenDR - Open Deep Learning Toolkit for Robotics. More information: opendr.eu

eu_flag

This project has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement no. 871449.

webots_ros2's People

Contributors

ad-daniel avatar angel-ayala avatar benjaminhug8 avatar davidmansolino avatar delihus avatar dzywater avatar fmrico avatar github-actions[bot] avatar ijnek avatar jamestkpoon avatar joachimhgg avatar jolonb avatar justinberi avatar lukicdarkoo avatar michou214 avatar nikolaseu avatar omichel avatar philipppolterauer avatar ralphieraccoon avatar renan028 avatar sebastianohl avatar simon-steinmann avatar skpawar1305 avatar stefaniapedrazzi avatar taoyibo1866 avatar tbreeze98 avatar timple avatar yanick-douven avatar ygoumaz avatar zegangyang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

webots_ros2's Issues

Webots running native in Windows connecting to ROS2 running on Docker for Windows.

Escenario

  • With WSL2 (or just Windows), run a docker (Docker for Windows) container with ros:foxy as the base image, with webots_ros2, installed, launching one of the Webots drivers (or my custom).

  • In Windows (not via container) run Webots.

Expected behavior the controller running in the container can interact with the Webots instance running locally in Windows.

I've installed Webots on a Windows computer, and I'd like to run my ROS stack, including this package, with Docker. I'd like to avoid having to install ROS2 in Windows, as I can fully work with it via containers.

Following a bit on the workflow of the package, it'd seem that it will always try to start Webots, would it be possible to hook up to a running Webots instance?


We are going to host Webots on a Linux machine for CI purposes, however, for development purposes, we're running Windows on our workstations. So, any assistance on how we could solve this problem would be greatly welcome.

Thanks

Handle Multi-Robots

Currently the simulation can have only one robot using the ROS2 interface at the same time.

To fix this, we should first make sure to handle more than on external controller by setting the WEBOTS_ROBOT_NAME environment variable for each ROS2 node:
https://www.cyberbotics.com/doc/guide/running-extern-robot-controllers?tab=python#single-simulation-and-multiple-extern-robot-controllers

Then, we should make sure to prefix the node name and services/topics/actions names (to avoid having to robot publishing on the same topic for example).

Improve Tf publisher

Describe the Bug
Several improvements can be done to the generic TF publisher (https://github.com/cyberbotics/webots_ros2/blob/develop/webots_ros2_core/webots_ros2_core/tf_publisher.py):

  • TransformBroadcaster should be used instead of a tf topic for efficiency reasons.
  • For non moving part static transforms should be used, this will require improving this method to check wether the joint are static or dynamic between solids: https://github.com/cyberbotics/webots_ros2/blob/develop/webots_ros2_core/webots_ros2_core/tf_publisher.py#L41
  • The transform should not be published relatively to the map reference as map is usually associated with a map frame that has uncertain transformation to robot and it has to be estimate (e.g. particle filter). We should check what is the standard and what Gazebo is actually doing and rename the reference.

webots_ros2_turtlebot3 warning: Exporting 'BallJoint' nodes to URDF is currently not supported && he mass ratio between the heaviest solid and the lightest solid is huge

WARNING: It is not recommended to run Webots as root.
WARNING: The mass ratio between the heaviest solid ('Solid' - mass = 95.624 kg) and the lightest solid ('Solid' - mass = 0.000268083 kg) is huge. This is a source of physics instabilities.
WARNING: Fridge (PROTO) > HingeJoint > Solid: heaviest solid
WARNING: TurtleBot3Burger_enu (PROTO) > DEF CASTER_JOINT BallJoint > Solid: lightest solid
INFO: Starting extern controller for robot "TurtleBot3Burger".
WARNING: TurtleBot3Burger_enu (PROTO) > DEF CASTER_JOINT BallJoint: Exporting 'BallJoint' nodes to URDF is currently not supported

ur_e_description: attribution?

Inspecting the .urdf files in webots_ros2_ur_e_description shows a big similarity with the files in ros-industrial/universal_robot/ur_e_description.

However, I can't seem to find any mention of the origin of these files, nor any form of attribution.

They also appear to have been re-licensed (to Apache 2 from BSD), or at least there isn't any exception mentioned for those specific files.

We're happy that you find those models useful, and it would be appreciated if you could add a statement somewhere clarifying where they came from, under what license they were made available and who created them.

Build failed, missing 'lark'

Describe the Bug
I followed the build instructions here https://github.com/cyberbotics/webots_ros2/wiki/Build-and-Install and got the following error:

Of Note:
I'm using ros2-foxy and a conda virtual environment.

(ros2) simon@simon-Legion-Y540:~/ws_ros2$ rosdep install --from-paths src --ignore-src --rosdistro $ROS_DISTRO
#All required rosdeps installed successfully
(ros2) simon@simon-Legion-Y540:~/ws_ros2$ colcon build
Starting >>> webots_ros2_msgs
Starting >>> webots_ros2_ur_e_description
Starting >>> webots_ros2_importer
Finished <<< webots_ros2_ur_e_description [0.77s]                     
Finished <<< webots_ros2_importer [0.77s]
--- stderr: webots_ros2_msgs                          
CMake Warning at /opt/ros/foxy/share/rosidl_generator_py/cmake/rosidl_generator_py_generate_interfaces.cmake:235 (add_library):
  Cannot generate a safe runtime search path for target
  webots_ros2_msgs__rosidl_typesupport_fastrtps_c__pyext because files in
  some directories may conflict with libraries in implicit directories:

    runtime library [libssl.so.1.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/simon/anaconda3/envs/ros2/lib
    runtime library [libcrypto.so.1.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/simon/anaconda3/envs/ros2/lib

  Some of these libraries may not be found correctly.
Call Stack (most recent call first):
  /opt/ros/foxy/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
  /opt/ros/foxy/share/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake:286 (ament_execute_extensions)
  CMakeLists.txt:34 (rosidl_generate_interfaces)


Traceback (most recent call last):
  File "/opt/ros/foxy/share/rosidl_generator_c/cmake/../../../lib/rosidl_generator_c/rosidl_generator_c", line 8, in <module>
    from rosidl_generator_c import generate_c
  File "/opt/ros/foxy/lib/python3.8/site-packages/rosidl_generator_c/__init__.py", line 15, in <module>
    from rosidl_cmake import convert_camel_case_to_lower_case_underscore
  File "/opt/ros/foxy/lib/python3.8/site-packages/rosidl_cmake/__init__.py", line 24, in <module>
    from rosidl_parser.parser import parse_idl_file
  File "/opt/ros/foxy/lib/python3.8/site-packages/rosidl_parser/parser.py", line 20, in <module>
    from lark import Lark
ModuleNotFoundError: No module named 'lark'
Traceback (most recent call last):
  File "/opt/ros/foxy/share/rosidl_generator_cpp/cmake/../../../lib/rosidl_generator_cpp/rosidl_generator_cpp", line 8, in <module>
    from rosidl_generator_cpp import generate_cpp
  File "/opt/ros/foxy/lib/python3.8/site-packages/rosidl_generator_cpp/__init__.py", line 17, in <module>
    from rosidl_cmake import generate_files
  File "/opt/ros/foxy/lib/python3.8/site-packages/rosidl_cmake/__init__.py", line 24, in <module>
    from rosidl_parser.parser import parse_idl_file
  File "/opt/ros/foxy/lib/python3.8/site-packages/rosidl_parser/parser.py", line 20, in <module>
    from lark import Lark
ModuleNotFoundError: No module named 'lark'
make[2]: *** [CMakeFiles/webots_ros2_msgs__rosidl_generator_c.dir/build.make:98: rosidl_generator_c/webots_ros2_msgs/srv/set_differential_wheel_speed.h] Error 1
make[1]: *** [CMakeFiles/Makefile2:334: CMakeFiles/webots_ros2_msgs__rosidl_generator_c.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/webots_ros2_msgs__cpp.dir/build.make:106: rosidl_generator_cpp/webots_ros2_msgs/srv/set_differential_wheel_speed.hpp] Error 1
make[1]: *** [CMakeFiles/Makefile2:308: CMakeFiles/webots_ros2_msgs__cpp.dir/all] Error 2
make: *** [Makefile:161: all] Error 2
---
Failed   <<< webots_ros2_msgs [1.10s, exited with code 2]
                                 
Summary: 2 packages finished [1.25s]
  1 package failed: webots_ros2_msgs
  1 package had stderr output: webots_ros2_msgs
  10 packages not processed

It was a simple fix by installing it with
pip3 install lark

After his, everything compiled successfully.

Create ROS2 reusable nodes

Currently, there is a driver for each robot and coding something like that takes time. It could be improved by creating reusable nodes that can drive different parts of the robot, e.g. there could be a differential drive component that interacts with motors and encoders (Webots), and publishes Odometry and subscribes to Twist topic.

Here is the initial request:
#59 (review)

macOS compile error

Describe the Bug
On Mac, where the Webots application is installed in /Applications, there is an error when compiling a ROS2 workspace with the webots_ros2_desktop package.

>> colcon build --packages-select webots_ros2_desktop
Starting >>> webots_ros2_desktop
--- stderr: webots_ros2_desktop                     
error: can't copy '../../../../../../../Applications/Webots.app/lib/webots/libzip.dylib': doesn't exist or not a regular file

Steps to Reproduce

  1. Install Webots.app from GitHub releases
  2. Set WEBOTS_HOME to Applications/Webots.app
  3. Add webots_ros2 repo (eloquent branch) to src
  4. colcon build --packages-select webots_ros2_desktop
  5. See error

Expected behavior
Successful compilation of package.

Affected Packages
List of affected packages:

  • webots_ros2_desktop

System

  • Webots Version: R2020a Revision 1
  • ROS Version: Eloquent
  • Operating System: macOS Catalina
  • Graphics Card: [AMD Radeon Pro 5300M, Intel UHD Graphics 630]

Controllers spawned through ros2 not working for Webots: in Windows 10

I installed Webots and ros2 on my Win10 system. I tried to install the webots_ros2 pkg on my local workspace and launched the demo file ros2 launch webots_ros2_universal_robot universal_robot_multiple.launch.py for UR robot simulation. Webots opens and the conveyor belt starts moving but the extern controllers for ur robots do not work and hence the robots don't move.

When I press CTRL+C in PowerShell I get the following output

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

Loading personal and system profiles took 1135ms.
PS C:\Users\Admin> ros2 launch webots_ros2_universal_robot universal_robot_multiple.launch.py
[INFO] [launch]: All log files can be found below C:\Users\Admin\.ros/log\2021-01-02-19-28-48-433426-DESKTOP-Q4VN964-13284
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [universal_robot_multiple.wbt --batch --mode=realtime-1]: process started with pid [7848]
[INFO] [webots_robotic_arm_node.EXE-2]: process started with pid [2640]
[INFO] [webots_robotic_arm_node.EXE-3]: process started with pid [8512]
[universal_robot_multiple.wbt --batch --mode=realtime-1] OpenGL error: GL_INVALID_ENUM
[universal_robot_multiple.wbt --batch --mode=realtime-1] OpenGL error: GL_INVALID_ENUM
[universal_robot_multiple.wbt --batch --mode=realtime-1] OpenGL error: GL_INVALID_ENUM
[WARNING] [launch]: user interrupted with ctrl-c (SIGINT)
[ERROR] [universal_robot_multiple.wbt --batch --mode=realtime-1]: process has died [pid 7848, exit code 3221225786, cmd 'C:\Users\Admin\AppData\Local\Programs\Webots\msys64\mingw64\bin\webots C:\Users\Admin\Documents\ros2_ws\install\share\webots_ros2_universal_robot\worlds\universal_robot_multiple.wbt --batch --mode=realtime'].
[universal_robot_multiple.wbt --batch --mode=realtime-1] ^C
[ERROR] [webots_robotic_arm_node.EXE-3]: process has died [pid 8512, exit code 1, cmd 'C:\Users\Admin\Documents\ros2_ws\install\lib\webots_ros2_core\webots_robotic_arm_node.EXE --webots-robot-name=UR5e --ros-args -r __ns:=/UR5e --params-file C:\Users\Admin\AppData\Local\Temp\launch_params_tzxm7hn3'].
[webots_robotic_arm_node.EXE-3] **Cannot open file: C:\Users\Admin\AppData\Local\Temp/webots-13688/WEBOTS_SERVER (retrying in 1 second)**

[ERROR] [webots_robotic_arm_node.EXE-2]: process has died [pid 2640, exit code 1, cmd 'C:\Users\Admin\Documents\ros2_ws\install\lib\webots_ros2_core\webots_robotic_arm_node.EXE --webots-robot-name=UR3e --ros-args -r __ns:=/UR3e --params-file C:\Users\Admin\AppData\Local\Temp\launch_params_8wummeqt'].
[webots_robotic_arm_node.EXE-2] **Cannot open file: C:\Users\Admin\AppData\Local\Temp/webots-13688/WEBOTS_SERVER (retrying in 1 second)**

PS C:\Users\Admin>

I am unable to understand why this Cannot open file: C:\Users\Admin\AppData\Local\Temp/webots-13688/WEBOTS_SERVER (retrying in 1 second) message shows up for each controller spawn up! I tried running from Powershell Admin but got similar output.

For once (maybe by chance) it started working and I was able to see the robots moving but then subsequent trials were not working.

PS: I had to modify webots_ros2_core/webots_ros2_core/utils.py file in order to get the launch file working in the first place. webotsw.exe executable path was not added to Path system variable so I had to do that manually first. Then made the following changes to run the webots application through ros2 launch.

  1. Added from pathlib import Path and replaced os.environ['HOME'] in line 68 with str(Path.home()). os.environ['HOME'] was giving a KeyError in python3.
  2. Replaced subprocess.check_output(['which', 'webots']) in line 59 with subprocess.check_output(['where', 'webots']) because which is available in Linux. Windows alternative was where command.

If the above changes might have been the cause for the issue I am facing please let me know. Any help will be highly appreciated :). Thanks

My System config

  • Webots Version: R2021a
  • ROS Version: Foxy
  • Operating System: Windows 10 (Both Webots and ROS2 are installed in Windows 10)
  • Graphics Card: AMD Radon M360 (pretty old one but it works)

Add Simulation Control Services

Similarly to Gazebo we should provide services to control the simulation, such as (http://gazebosim.org/tutorials/?tut=ros_comm):

  • /webots/reset_simulation: should reset the simulation but not restart the controllers.
  • /webots/reset_world: should reset only the robot position.
  • /webots/pause_physics: should pause the simulation
  • /webots/unpause_physics: should unpause the simulation
  • /webots/spawn_model: should add an object to the root of the scene (with the possibility to set the translation/orientation (using a geometry_msgs/Pose initial_pose argument)
  • /webots/delete_model: should remove an object from the root of the scene.

Interact with the Robot UR- Never returns Goal Succeeded

Hi,

I am testing Webots with ROS2, the tutorial universal_robot:

Selection_240

When execute the trajectory :

ros2 action send_goal /follow_joint_trajectory control_msgs/action/FollowJointTrajectory "{ trajectory: { joint_names: [shoulder_pan_joint, shoulder_lift_joint, elbow_joint, wrist_1_joint, wrist_2_joint, wrist_3_joint], points: [ { positions: [-1.01, 0.38, -0.63, -0.88, 0.25, -1.63], velocities: [1.0, 1.0, 1.0, 1.0, 1.0, 1.0], accelerations: [1.0, 1.0, 1.0, 1.0, 1.0, 1.0], time_from_start: { sec: 10, nanosec: 500 } } ] } }"

The file trajectory_follower.py, never execute this part of the code: :

Selection_241

The state is always Goal Accepted and does not change to Goal Succeeded.

Thanks in advance for your answer.

Simplify Launch Files

Currently, every launch file has a piece of code dedicated for starting the Webots controller, launching Webots and making sure everything is stopped once Webots is closed. This is too much boilerplate code and it might be possible to simplify it.

Describe the solution you'd like
We can create launch file in webots_ros2_core and use launch.actions.IncludeLaunchDescription in other packages to include it. Something similar as here:

webots_launch = IncludeLaunchDescription(

When launching examples in eloquent I get "[webots_launcher-1] webots_launcher: error: unrecognized arguments: --ros-args"

Describe the Bug
I have installed:

  • Webots version: R2020a revision 1
  • ROS2 Eloquent

When I launch :

ros2 launch webots_ros2_examples example.launch.py

I get the following error:

[INFO] [launch]: All log files can be found below /home/finn/.ros/log/2020-04-14-08-22-05-128650-rdaneelcomputer-1578
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [webots_launcher-1]: process started with pid [1589]
[INFO] [example_controller-2]: process started with pid [1590]
[webots_launcher-1] usage: webots_launcher [-h] [--world WORLD] [--mode MODE] [--no-gui]
[webots_launcher-1] webots_launcher: error: unrecognized arguments: --ros-args
[ERROR] [webots_launcher-1]: process has died [pid 1589, exit code 2, cmd '/home/finn/catkin_ws/install/webots_ros2_core/lib/webots_ros2_core/webots_launcher --mode=realtime --world=/home/finn/catkin_ws/install/webots_ros2_examples/share/webots_ros2_examples/worlds/ros_example.wbt --ros-args'].
[INFO] [example_controller-2]: sending signal 'SIGINT' to process[example_controller-2]
[example_controller-2] Webots doesn't seems to be ready yet: (retrying in 1 second)
[example_controller-2] Webots doesn't seems to be ready yet: (retrying in 2 seconds)
[example_controller-2] Webots doesn't seems to be ready yet: (retrying in 3 seconds)
[ERROR] [example_controller-2]: process[example_controller-2] failed to terminate '5' seconds after receiving 'SIGINT', escalating to 'SIGTERM'
[INFO] [example_controller-2]: sending signal 'SIGTERM' to process[example_controller-2]
[example_controller-2] Webots doesn't seems to be ready yet: (retrying in 4 seconds)
[ERROR] [example_controller-2]: process has died [pid 1590, exit code -15, cmd '/home/finn/catkin_ws/install/webots_ros2_examples/lib/webots_ros2_examples/example_controller --ros-args --params-file /tmp/launch_params_gyebwfke'].

I compiled the webots_ros2 in my catkin_ws without issues, I souced with source install/local_setup.bash and ros2 works correctly as well as webots. Is this ros-args error that avoid it to be launched because launching:
/home/finn/catkin_ws/install/webots_ros2_core/lib/webots_ros2_core/webots_launcher --mode=realtime --world=/home/finn/catkin_ws/install/webots_ros2_examples/share/webots_ros2_examples/worlds/ros_example.wbt

Has no issue, it starts correctly.

Any ideas on where it could be the issue? Do I have to set something else?

webots_ros2_epuck - windows 10 ros2 foxy - fail to find world files

Describe the Bug
Webots ros2 (foxy) builds fine with colcon on Windows 10. After sourcing, I try to run the tutorial (ros2 launch webots_ros2_epuck robot_launch.py) and it fails to find a file - I believe it is the world file.
Error message: [ERROR] [launch]: Caught exception in launch (see debug for traceback): [WinError 2] The system cannot find the file specified.
The world exists and opens through the webots interface but ros cannot launch it. I believe that it is the world file because I print out both package_dir and world and then I get the error after a LaunchConfiguration is instantiated.
package_dir: C:\dev\webots_ws\install\webots_ros2_epuck\share\webots_ros2_epuck

Steps to Reproduce

  1. I followed these instructions:
    https://github.com/cyberbotics/webots_ros2/wiki/Build-and-Install#windows
    I did not run rosdep update according to https://index.ros.org/doc/ros2/Tutorials/Workspace/Creating-A-Workspace/
  2. colcon build - runs ok
  3. call install\local_setup.bat
  4. ros2 launch webots_ros2_epuck robot_launch.py

Expected behavior
As described here: https://github.com/cyberbotics/webots_ros2/wiki/Tutorial-E-puck-for-ROS2-Beginners#simulated-robot

Affected Packages
List of affected packages:

  • webots_ros2_epuck (this is the only one I tested)

System

  • Webots Version: [R2021a]
  • ROS Version: [e.g., Foxy]
  • Operating System: [Windows 10]
  • Graphics Card: [Nvidia Geforce RTX 2060]

Missing controller module for webots_ros2_universal_robot

I was just testing out the release of the webots_ros2_universal_robot package but encountered a ModuleNotFoundError, so perhaps there's a missing in depencies declarations or release packaging?

https://discourse.ros.org/t/new-packages-for-ros-2-crystal-2019-09-05/10562

  • OS: Ubuntu 18.04
  • ROS distro: crystal
  • type: release install

Installed via:

apt install ros-crystal-webots-ros2*

Runtime error:

$ ros2 launch webots_ros2_universal_robot universal_robot.launch.py 
[INFO] [launch]: process[webots_launcher-1]: started with pid [10099]
[INFO] [launch]: process[universal_robot-2]: started with pid [10100]
Traceback (most recent call last):
  File "/opt/ros/crystal/lib/webots_ros2_core/webots_launcher", line 11, in <module>
    load_entry_point('webots-ros2-core==0.0.2', 'console_scripts', 'webots_launcher')()
  File "/opt/ros/crystal/lib/python3.6/site-packages/webots_ros2_core/webots_launcher.py", line 42, in main
    subprocess.call(command)
  File "/usr/lib/python3.6/subprocess.py", line 287, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib/python3.6/subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.6/subprocess.py", line 1364, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/opt/ros/crystal/share/webots_ros2_desktop/webots/webots': '/opt/ros/crystal/share/webots_ros2_desktop/webots/webots'
[ERROR] [launch]: process[webots_launcher-1] process has died [pid 10099, exit code 1, cmd '/opt/ros/crystal/lib/webots_ros2_core/webots_launcher --mode=realtime --world=/opt/ros/crystal/share/webots_ros2_universal_robot/worlds/universal_robot.wbt'].
[INFO] [launch]: sending signal 'SIGINT' to process[universal_robot-2]
"WEBOTS_HOME" is not correctly set.Traceback (most recent call last):
  File "/opt/ros/crystal/lib/webots_ros2_universal_robot/universal_robot", line 11, in <module>
    load_entry_point('webots-ros2-universal-robot==0.0.2', 'console_scripts', 'universal_robot')()
  File "/usr/local/lib/python3.6/dist-packages/pkg_resources/__init__.py", line 487, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/local/lib/python3.6/dist-packages/pkg_resources/__init__.py", line 2728, in load_entry_point
    return ep.load()
  File "/usr/local/lib/python3.6/dist-packages/pkg_resources/__init__.py", line 2346, in load
    return self.resolve()
  File "/usr/local/lib/python3.6/dist-packages/pkg_resources/__init__.py", line 2352, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/opt/ros/crystal/lib/python3.6/site-packages/webots_ros2_universal_robot/universal_robot.py", line 17, in <module>
    from webots_ros2_core.webots_node import WebotsNode
  File "/opt/ros/crystal/lib/python3.6/site-packages/webots_ros2_core/webots_node.py", line 34, in <module>
    raise e
  File "/opt/ros/crystal/lib/python3.6/site-packages/webots_ros2_core/webots_node.py", line 31, in <module>
    from controller import Robot
ModuleNotFoundError: No module named 'controller'
[ERROR] [launch]: process[universal_robot-2] process has died [pid 10100, exit code 1, cmd '/opt/ros/crystal/lib/webots_ros2_universal_robot/universal_robot'].

Missing control_msgs package

The package control_msgs is not available for ROS2 Dashing, unfortunately, this prevents us from release the webots_ros2 package as we have a dependency on this package (we can easily compile control_msgs from sources to test, but impossible to create an official release).

Reported in ros-controls/control_msgs#33

Is possible implement webots_ros2 as c++ programme

Hello, thanks for such a nice project.

Thanks for such a nice project. I want to implement my webots_ros2 project using c++ because the original webots_ros2 is implemented by python.
I want to implement an external controller using directly c++ API and publish the simulation data with ROS2. And now i can comunicate with webots using extern controller.
And now I can communicate with webots using an extern controller.

My question is :

  1. Is it wise to write the project without using the provided python project?
  2. In webots/project/default/controllers/ros, is it necessary to implement the class named "RosSupervisor", what is RosSupervisor use for?

robot_state_publisher failed to terminate '5' seconds after receiving 'SIGINT', escalating to 'SIGTERM'

I am trying to run the webots_ros2_universal_robots package though running into, what seems to be, a robot_state_publisher error. I am using Ubuntu 20.04 LTS running ROS2 Foxy Desktop. I installed webots from Debian Packages with APT and installed the webots_ros2 packages from source following these instructions .

When running the following example [ros2 launch webots_ros2_universal_robot universal_robot.launch.py] I get the error which I posted below. I went though the files and made the python scripts executables [ chmod +x filename.py], rebuilt my workspace, though the same error occurs.

Prior to this, I installed webots Debian Packages with APT and webots_ros2 packages also with APT. Everything was working fine, and I was able to run the webot_ros2_universal_robot demos. I needed to modify the webot_ros2_universal_robot packages, so I created a workspace and installed them from source which is when I first ran into the error. I uninstalled the previous webot_ros2 packages installed with APT, thinking there were conflicting file paths, though that did not fix the error. I even created a new Virtual environment and installed webots debian packages and webots_ros2 from source. However the same error is present.

Any help would be greatly appreciated.

ERROR MESSAGE

iego@diego-virtual-machine:$ source /opt/ros/foxy/setup.bash
diego@diego-virtual-machine:
$ cd ros2_ws/
diego@diego-virtual-machine:/ros2_ws$ source install/setup.bash
diego@diego-virtual-machine:
/ros2_ws$ ros2 launch webots_ros2_universal_robot universal_robot.launch.py
[INFO] [launch]: All log files can be found below /home/diego/.ros/log/2020-09-21-12-15-48-999896-diego-virtual-machine-2264
[INFO] [launch]: Default logging verbosity is set to INFO
Task exception was never retrieved
future: <Task finished name='Task-2' coro=<LaunchService._process_one_event() done, defined at /opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py:271> exception=TypeError("Can't mix strings and bytes in path components")>
Traceback (most recent call last):
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 273, in _process_one_event
await self.__process_event(next_event)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 293, in __process_event
visit_all_entities_and_collect_futures(entity, self.__context))
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
[Previous line repeated 3 more times]
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 38, in visit_all_entities_and_collect_futures
sub_entities = entity.visit(context)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/action.py", line 108, in visit
return self.execute(context)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/actions/execute_process.py", line 775, in execute
self.__expand_substitutions(context)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/actions/execute_process.py", line 635, in __expand_substitutions
cmd = [perform_substitutions(context, x) for x in self.__cmd]
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/actions/execute_process.py", line 635, in
cmd = [perform_substitutions(context, x) for x in self.__cmd]
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/perform_substitutions_impl.py", line 26, in perform_substitutions
return ''.join([context.perform_substitution(sub) for sub in subs])
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/perform_substitutions_impl.py", line 26, in
return ''.join([context.perform_substitution(sub) for sub in subs])
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_context.py", line 184, in perform_substitution
return substitution.perform(self)
File "/home/diego/ros2_ws/install/webots_ros2_core/lib/python3.8/site-packages/webots_ros2_core/webots_launcher.py", line 98, in perform
webots_path = get_webots_home()
File "/home/diego/ros2_ws/install/webots_ros2_core/lib/python3.8/site-packages/webots_ros2_core/utils.py", line 59, in get_webots_home
if os.path.isdir(path) and get_webots_version(path) == version:
File "/home/diego/ros2_ws/install/webots_ros2_core/lib/python3.8/site-packages/webots_ros2_core/utils.py", line 140, in get_webots_version
versionFile = os.path.join(path if path is not None else get_webots_home(),
File "/usr/lib/python3.8/posixpath.py", line 90, in join
genericpath._check_arg_types('join', a, *p)
File "/usr/lib/python3.8/genericpath.py", line 155, in _check_arg_types
raise TypeError("Can't mix strings and bytes in path components") from None
TypeError: Can't mix strings and bytes in path components
Task exception was never retrieved
future: <Task finished name='Task-8' coro=<LaunchService._process_one_event() done, defined at /opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py:271> exception=RuntimeError('Signal event received before subprocess transport available.')>
Traceback (most recent call last):
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 273, in _process_one_event
await self.__process_event(next_event)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 293, in __process_event
visit_all_entities_and_collect_futures(entity, self.__context))
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 38, in visit_all_entities_and_collect_futures
sub_entities = entity.visit(context)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/action.py", line 108, in visit
return self.execute(context)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/actions/opaque_function.py", line 75, in execute
return self.__function(context, *self.__args, **self.__kwargs)
File "/opt/ros/foxy/lib/python3.8/site-packages/launch/actions/execute_process.py", line 421, in __on_signal_process_event
raise RuntimeError('Signal event received before subprocess transport available.')
RuntimeError: Signal event received before subprocess transport available.
[INFO] [robot_state_publisher-1]: process started with pid [2286]
[robot_state_publisher-1] Parsing robot urdf xml string.
[robot_state_publisher-1] [INFO] [1600715749.248895892] [robot_state_publisher]: got segment
[ERROR] [robot_state_publisher-1]: process[robot_state_publisher-1] failed to terminate '5' seconds after receiving 'SIGINT', escalating to 'SIGTERM'
[INFO] [robot_state_publisher-1]: sending signal 'SIGTERM' to process[robot_state_publisher-1]
[ERROR] [robot_state_publisher-1]: process has died [pid 2286, exit code -15, cmd '/opt/ros/foxy/lib/robot_state_publisher/robot_state_publisher --ros-args --params-file /tmp/launch_params_dcugksof'].

Dynamically load URDF to MoveIt2

Currently, the MoveIt2 example requires URDF to be present in /tmp/webots_robot_UR5e.urdf (e.g. by running ros2 launch webots_ros2_universal_robot universal_robot.launch.py). We should explore whether the URDF can be loaded dynamically to MoveIt2 after the initialization.

Improve CI Tests

Currently our CI test is testing the source code, compilation and installation of the packages.

But the behaviour is not tested.
It would be nice to run at least one node in the test and make sure it works correctly.
This way it will be very easy to check if the compatibility with one specific release of ROS is working (instead of testing manually on each supported version).

Generic Robotic Arm node

Similarly to what have been done for differential-wheel robot (https://github.com/cyberbotics/webots_ros2/blob/master/webots_ros2_core/webots_ros2_core/webots_differential_drive_node.py) we should create a generic class for robotic arms.
Indeed the two currently supported robotic arms share a lot in commun:

This new class should also provide a generic ros node (e.g. arm_driver) that will be compatible with any robotic arms.

URDF generation should escape whitespace

Describe_ the Bug
When generating the urdf file to publish the robot description the whitespaces should be escaped as it failes with some robot:
[webots_robotic_arm_node-3] FileNotFoundError: [Errno 2] No such file or directory: '/tmp/webots_robot_IRB 4600/40.urdf'

No such file or directory: 'webots_version.txt'

colcon build --symlink-install

When compiling in ROS2 eloquent.
Any ideas?

Starting >>> webots_ros2_desktop
--- stderr: webots_ros2_desktop
Traceback (most recent call last):
File "setup.py", line 18, in
with open('webots_version.txt') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'webots_version.txt'

Failed <<< webots_ros2_desktop [ Exited with code 1 ]
[Processing: webots_ros2_desktop]

Reset GUI Webots : webots_ros2 trayectory not responding

Hi,

I am testing Webots with ROS2, the tutorial universal_robot:

Robot UR5e initial position:

Selection_242

I execute the trajectory:

ros2 action send_goal /follow_joint_trajectory control_msgs/action/FollowJointTrajectory "{ trajectory: { joint_names: [shoulder_pan_joint, shoulder_lift_joint, elbow_joint, wrist_1_joint, wrist_2_joint, wrist_3_joint], points: [ { positions: [3.02, -1.63, -1.88, 1.01, 1.51, 1.13], velocities: [0.1, 0.1, 0.1, 0.1, 0.1, 0.1], accelerations: [0.1, 0.1, 0.1, 0.1, 0.1, 0.1], time_from_start: { sec: 5, nanosec: 500 } }, ] }, goal_tolerance: [ { name: shoulder_pan_joint, position: 0.01 }, { name: shoulder_lift_joint, position: 0.01 }, { name: elbow_joint, position: 0.01 }, { name: wrist_1_joint, position: 0.01 }, { name: wrist_2_joint, position: 0.01 }, { name: wrist_3_joint, position: 0.01 } ] }"

All correct:

Selection_243

I reset the simulation :

Selection_244

I execute the same trajectory :

Selection_245

The state is "Goal Accepted" in the action_server, but the trajectory never executed.

Thanks in advance for your answer.

Synchronisation parameter declaration error for WebotsNode on ROS 2 Foxy & Eloquent

Describe the Bug
Using ROS 2 Foxy (master), any WebotsNode crashes on __init__ when trying to declare synchronisation parameter.

Steps to Reproduce

  1. Use ROS 2 foxy (master) built from source
  2. Build webots_ros2 from master
  3. Run any example/demo code using WebotsNode base node from webots_ros2_core

Expected behavior
Parameter synchronisation must be declared successfully

Affected Packages
List of affected packages:

  • webots_ros2_core

Stracktrace

Traceback (most recent call last):
  File "/home/user/ros/ros/install/test_package/lib/test_package/test_controller", line 11, in <module>
    load_entry_point('test_package', 'console_scripts', 'test_controller')()
  File "/home/user/ros/ros/build/test_package/test_package/test_controller.py", line 36, in main
    test_controller = TestController(args=args)
  File "/home/user/ros/ros/build/test_package/test_package/test_controller.py", line 21, in __init__
    super().__init__('test_controller', args)
  File "/home/user/ros_ws/build/webots_ros2_core/webots_ros2_core/webots_node.py", line 44, in __init__
    self.declare_parameter('synchronization',
  File "/home/user/ros2_foxy/install/rclpy/lib/python3.8/site-packages/rclpy/node.py", line 343, in declare_parameter
    return self.declare_parameters('', [(name, value, descriptor)], ignore_override)[0]
  File "/home/user/ros2_foxy/install/rclpy/lib/python3.8/site-packages/rclpy/node.py", line 438, in declare_parameters
    parameter_list.append(Parameter(name, value=value))
  File "/home/user/ros2_foxy/install/rclpy/lib/python3.8/site-packages/rclpy/parameter.py", line 127, in __init__
    type_ = Parameter.Type.from_parameter_value(value)
  File "/home/user/ros2_foxy/install/rclpy/lib/python3.8/site-packages/rclpy/parameter.py", line 70, in from_parameter_value
    raise TypeError('The given value is not one of the allowed types.')
TypeError: The given value is not one of the allowed types.

System

  • Webots Version: R2020a revision 1
  • ROS Version: Foxy (master)
  • Operating System: Ubuntu Focal Fossa (20.04LTS) / macOS 10.15.4
  • Graphics Card: N/A
  • Python : Python 3.8.2

Additional context
Parameter declaration is no longer compatible with ros foxy

self.declare_parameter('synchronization',
Parameter('synchronization', Parameter.Type.BOOL, False))

The following line is effective

self.declare_parameter('synchronization', False)

Webots_ros2 requires specific Webots version

Describe the Bug
I found, that webots_ros2 only works with the exact version of Webots specified here:
https://github.com/cyberbotics/webots_ros2/blob/master/webots_ros2_core/webots_ros2_core/utils.py#L35

As of yesterday, the master branch of webots_ros2 required 2020b,
I built the develop branch, so I could use 2021a, However this did not work, as I had compiled the latest develop branch of Webots "2021b"
So I recompiled the master branch of Webots. It still did not work, as webots_ros2 requires "2021a" and I now had "2021 revision 1"

Expected behavior

  • building both master branches together should work
  • webots_ros2 should accept newer versions (perhaps with a warning)

Proposed solutions

  • Turn the hard rquirement into a soft requirement, allowing the user to use any version they want and simply warn them if not the expected version was found. The popup window should probably include the Version that was actually found
  • Add multiple valid versions to cover develop and built versions. This could look like this:
def get_required_webots_version():
    """Return the Webots version compatible with this version of the package."""
    return ['R2021a', 'R2021a revision 1', 'R2021b']

LaserPublisher Publishes Wrong LaserScan Topics

Describe the Bug
Layers from LiDAR device are not correctly described in this line:

angleStep = lidar.getVerticalFov() / (lidar.getNumberOfLayers() - 1)
angle = -0.5 * lidar.getVerticalFov() + i * angleStep
q3 = transforms3d.quaternions.axangle2quat([0, 0, 1], angle)
result = transforms3d.quaternions.qmult(result, q3)

Steps to Reproduce

  1. Run ros2 launch webots_ros2_universal_robot universal_robot_rviz.launch.py
  2. Add LiDAR device to UR5e in toolSlot
  3. Add lidar_0, lidar_1 and lidar_2 topics in RViz

Expected behavior
The lines should not cross. Point cloud in RViz doesn't correspond to the point cloud in Webots.

Affected Packages

  • webots_ros2_core

Screenshots
image

Got errors while testing the examples

while ros2 launch the universal examples in webots_ros2, i got error like below. And i test is it in anaconda and default python environment, the errors are the same. Could somebody help to fix it?
In Webots the environment runs, but the ur robots didn't move.

(base) kb@kb-TM1705:~/ros_projects/ros2_ws$ ros2 launch webots_ros2_universal_robot universal_robot_multiple.launch.py
[INFO] [launch]: All log files can be found below /home/kb/.ros/log/2020-04-05-17-36-18-988216-kb-TM1705-10292
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [webots_launcher-1]: process started with pid [10302]
[INFO] [universal_robot-2]: process started with pid [10303]
[INFO] [universal_robot-3]: process started with pid [10304]
[universal_robot-2] Cannot open file: /tmp/webots-10305/WEBOTS_SERVER (retrying in 1 second)
[universal_robot-3] Cannot open file: /tmp/webots-10305/WEBOTS_SERVER (retrying in 1 second)
[universal_robot-2] Cannot open file: /tmp/webots-10305/WEBOTS_SERVER (retrying in 2 seconds)
[universal_robot-3] Cannot open file: /tmp/webots-10305/WEBOTS_SERVER (retrying in 2 seconds)
[universal_robot-2] Cannot open file: /tmp/webots-10305/WEBOTS_SERVER (retrying in 3 seconds)
[universal_robot-3] Cannot open file: /tmp/webots-10305/WEBOTS_SERVER (retrying in 3 seconds)
[universal_robot-2] Cannot open file: /tmp/webots-10305/WEBOTS_SERVER (retrying in 4 seconds)
[universal_robot-3] Cannot open file: /tmp/webots-10305/WEBOTS_SERVER (retrying in 4 seconds)
[universal_robot-2] Cannot open file: /tmp/webots-10305/WEBOTS_SERVER (retrying in 5 seconds)
[universal_robot-3] Cannot open file: /tmp/webots-10305/WEBOTS_SERVER (retrying in 5 seconds)
[universal_robot-2] Traceback (most recent call last):
[universal_robot-2]   File "/opt/ros/dashing/lib/python3.6/site-packages/rosidl_generator_py/import_type_support_impl.py", line 40, in import_type_support
[universal_robot-2]     return importlib.import_module(module_name, package=pkg_name)
[universal_robot-2]   File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
[universal_robot-2]     return _bootstrap._gcd_import(name[level:], package, level)
[universal_robot-2]   File "<frozen importlib._bootstrap>", line 994, in _gcd_import
[universal_robot-2]   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
[universal_robot-2]   File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
[universal_robot-2] ModuleNotFoundError: No module named 'webots_ros2_msgs.webots_ros2_msgs_s__rosidl_typesupport_c'
[universal_robot-2] 
[universal_robot-2] During handling of the above exception, another exception occurred:
[universal_robot-2] 
[universal_robot-2] Traceback (most recent call last):
[universal_robot-2]   File "/home/kb/ros_projects/ros2_ws/install/webots_ros2_universal_robot/lib/webots_ros2_universal_robot/universal_robot", line 11, in <module>
[universal_robot-2]     load_entry_point('webots-ros2-universal-robot==0.0.2', 'console_scripts', 'universal_robot')()
[universal_robot-2]   File "/home/kb/ros_projects/ros2_ws/install/webots_ros2_universal_robot/lib/python3.6/site-packages/webots_ros2_universal_robot/universal_robot.py", line 44, in main
[universal_robot-2]     actionServer = ActionServerNode(args=args)
[universal_robot-2]   File "/home/kb/ros_projects/ros2_ws/install/webots_ros2_universal_robot/lib/python3.6/site-packages/webots_ros2_universal_robot/universal_robot.py", line 29, in __init__
[universal_robot-2]     super().__init__('ur_driver', args=args)
[universal_robot-2]   File "/home/kb/ros_projects/ros2_ws/install/webots_ros2_core/lib/python3.6/site-packages/webots_ros2_core/webots_node.py", line 57, in __init__
[universal_robot-2]     self.stepService = self.create_service(SetInt, 'step', self.step_callback)
[universal_robot-2]   File "/opt/ros/dashing/lib/python3.6/site-packages/rclpy/node.py", line 1219, in create_service
[universal_robot-2]     check_for_type_support(srv_type)
[universal_robot-2]   File "/opt/ros/dashing/lib/python3.6/site-packages/rclpy/type_support.py", line 29, in check_for_type_support
[universal_robot-2]     msg_type.__class__.__import_type_support__()
[universal_robot-2]   File "/home/kb/ros_projects/ros2_ws/install/webots_ros2_msgs/lib/python3.7/site-packages/webots_ros2_msgs/srv/_set_int.py", line 256, in __import_type_support__
[universal_robot-2]     module = import_type_support('webots_ros2_msgs')
[universal_robot-2]   File "/opt/ros/dashing/lib/python3.6/site-packages/rosidl_generator_py/import_type_support_impl.py", line 42, in import_type_support
[universal_robot-2]     raise UnsupportedTypeSupport(pkg_name)
[universal_robot-2] rosidl_generator_py.import_type_support_impl.UnsupportedTypeSupport: Could not import 'rosidl_typesupport_c' for package 'webots_ros2_msgs'
[universal_robot-3] Traceback (most recent call last):
[universal_robot-3]   File "/opt/ros/dashing/lib/python3.6/site-packages/rosidl_generator_py/import_type_support_impl.py", line 40, in import_type_support
[universal_robot-3]     return importlib.import_module(module_name, package=pkg_name)
[universal_robot-3]   File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
[universal_robot-3]     return _bootstrap._gcd_import(name[level:], package, level)
[universal_robot-3]   File "<frozen importlib._bootstrap>", line 994, in _gcd_import
[universal_robot-3]   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
[universal_robot-3]   File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
[universal_robot-3] ModuleNotFoundError: No module named 'webots_ros2_msgs.webots_ros2_msgs_s__rosidl_typesupport_c'
[universal_robot-3] 
[universal_robot-3] During handling of the above exception, another exception occurred:
[universal_robot-3] 
[universal_robot-3] Traceback (most recent call last):
[universal_robot-3]   File "/home/kb/ros_projects/ros2_ws/install/webots_ros2_universal_robot/lib/webots_ros2_universal_robot/universal_robot", line 11, in <module>
[universal_robot-3]     load_entry_point('webots-ros2-universal-robot==0.0.2', 'console_scripts', 'universal_robot')()
[universal_robot-3]   File "/home/kb/ros_projects/ros2_ws/install/webots_ros2_universal_robot/lib/python3.6/site-packages/webots_ros2_universal_robot/universal_robot.py", line 44, in main
[universal_robot-3]     actionServer = ActionServerNode(args=args)
[universal_robot-3]   File "/home/kb/ros_projects/ros2_ws/install/webots_ros2_universal_robot/lib/python3.6/site-packages/webots_ros2_universal_robot/universal_robot.py", line 29, in __init__
[universal_robot-3]     super().__init__('ur_driver', args=args)
[universal_robot-3]   File "/home/kb/ros_projects/ros2_ws/install/webots_ros2_core/lib/python3.6/site-packages/webots_ros2_core/webots_node.py", line 57, in __init__
[universal_robot-3]     self.stepService = self.create_service(SetInt, 'step', self.step_callback)
[universal_robot-3]   File "/opt/ros/dashing/lib/python3.6/site-packages/rclpy/node.py", line 1219, in create_service
[universal_robot-3]     check_for_type_support(srv_type)
[universal_robot-3]   File "/opt/ros/dashing/lib/python3.6/site-packages/rclpy/type_support.py", line 29, in check_for_type_support
[universal_robot-3]     msg_type.__class__.__import_type_support__()
[universal_robot-3]   File "/home/kb/ros_projects/ros2_ws/install/webots_ros2_msgs/lib/python3.7/site-packages/webots_ros2_msgs/srv/_set_int.py", line 256, in __import_type_support__
[universal_robot-3]     module = import_type_support('webots_ros2_msgs')
[universal_robot-3]   File "/opt/ros/dashing/lib/python3.6/site-packages/rosidl_generator_py/import_type_support_impl.py", line 42, in import_type_support
[universal_robot-3]     raise UnsupportedTypeSupport(pkg_name)
[universal_robot-3] rosidl_generator_py.import_type_support_impl.UnsupportedTypeSupport: Could not import 'rosidl_typesupport_c' for package 'webots_ros2_msgs'
[ERROR] [universal_robot-2]: process has died [pid 10303, exit code 1, cmd '/home/kb/ros_projects/ros2_ws/install/webots_ros2_universal_robot/lib/webots_ros2_universal_robot/universal_robot --webots-robot-name=UR3e __ns:=/UR3e __params:=/tmp/launch_params_91faa_6u'].
[ERROR] [universal_robot-3]: process has died [pid 10304, exit code 1, cmd '/home/kb/ros_projects/ros2_ws/install/webots_ros2_universal_robot/lib/webots_ros2_universal_robot/universal_robot --webots-robot-name=UR5e __ns:=/UR5e __params:=/tmp/launch_params_5pvlzidx'].

Include Webots in a webots_ros2-desktop package

We should create a package (probably called webots_ros2-desktop, as it is done for ros itself: ros-melodic-ros-base VS ros-melodic-desktop) that contains the complete Webots installation folder.

Test on Crystal

The package is not 100% functionnal on crystal because of:

  • Function argument new to Dashing not supported in crystal.
  • control_msgs release outdated (does not include actions).

We should either:

  • Fix them.
  • Remove the Crystal release.

The current state (even if not promoted) gives a bad image because it is not working out of the box.

Generic Differential Drive Node

Now that we do provide a generic class (https://github.com/cyberbotics/webots_ros2/blob/master/webots_ros2_core/webots_ros2_core/webots_differential_drive_node.py) to create differential drive nodes, it would be nice to slightly extend it to include also a generic differential drive node.

For this we would need to add a main to this class, something like (untested draft):

def main(args=None):
    rclpy.init(args=args)

    # TODO: we need to get 'wheel_distance' and 'wheel_radius' from the ros params.
    differential_drive = WebotsDifferentialDriveNode(args=args, wheel_distance, wheel_radius)

    rclpy.spin(differential_driver)
    rclpy.shutdown()


if __name__ == '__main__':
    main()

This will provide a very simple (and limited) ros node allowing to control any differential drive out of the box.

No rosdep command in windows10

122753BB-F063-4C23-B5D1-C3EFBB1DD191

System: ros2 foxy, windows 10 19041

Build failed!
I didn’t run: rosdep update
Because no this command. How to install rosdep.

rosdep - Windows build install

ros2 and webots are set but rosdep does not seem to be working

i use the windows command prompt and when i run rosdep update i get this error message:
'rosdep' is not recognized as an internal or external command, operable program or batch file

has anyone faced that problem?

Remove PIP Dependencies

Describe the Bug
We are currently using PIp dependencies in some packages.
Unfortunately, this is only partially supported by ROS 2 and cause issues on the ROS 2 build farm to create the debian package.

Extend Robot Support

The next objective in term of supported robot types (from the ROSIN project] goals) are:

macOS Catalina example_controller fails to load dyld

Describe the Bug
When attempting to test the webots_ros2 package, I get an error saying that my WEBOTS_HOME was not set correctly, but the real issue is that _controller.so file for python 3.8 cannot be found. Webots will start up but the ROS2 controller will fail.

Steps to Reproduce

  1. Set the following:
~$ export WEBOTS_HOME=/Applications/Webots.app
~$ export PYTHONPATH=$PYTHONPATH:${WEBOTS_HOME}/lib/controller/python38
~$ export DYLD_LIBRARY_PATH=${WEBOTS_HOME}/lib/controller:$DYLD_LIBRARY_PATH
  1. Install webots_ros2
  2. Attempt to run the example controller: ros2 launch webots_ros2_examples example.launch.py

Expected behavior
Webots should open along with the functioning ROS2 controller.

Affected Packages
List of affected packages:

  • webots_ros2_A
  • webots_ros2_B

Screenshots

zmk5-MBP:webots_ws zmk5$ ros2 launch webots_ros2_examples example.launch.py
[INFO] [launch]: All log files can be found below /Users/zmk5/.ros/log/2020-08-04-17-22-12-071529-zmk5-MBP-22355
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [webots_launcher-1]: process started with pid [22367]
[INFO] [example_controller-2]: process started with pid [22368]
[example_controller-2] "WEBOTS_HOME" is not correctly set.Traceback (most recent call last):
[example_controller-2]   File "/Users/zmk5/ROS2/webots_ws/install/webots_ros2_examples/lib/webots_ros2_examples/example_controller", line 33, in <module>
[example_controller-2]     sys.exit(load_entry_point('webots-ros2-examples', 'console_scripts', 'example_controller')())
[example_controller-2]   File "/Users/zmk5/ROS2/webots_ws/install/webots_ros2_examples/lib/webots_ros2_examples/example_controller", line 25, in importlib_load_entry_point
[example_controller-2]     return next(matches).load()
[example_controller-2]   File "/usr/local/Cellar/[email protected]/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/metadata.py", line 77, in load
[example_controller-2]     module = import_module(match.group('module'))
[example_controller-2]   File "/usr/local/Cellar/[email protected]/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py", line 127, in import_module
[example_controller-2]     return _bootstrap._gcd_import(name[level:], package, level)
[example_controller-2]   File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
[example_controller-2]   File "<frozen importlib._bootstrap>", line 991, in _find_and_load
[example_controller-2]   File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
[example_controller-2]   File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
[example_controller-2]   File "<frozen importlib._bootstrap_external>", line 783, in exec_module
[example_controller-2]   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
[example_controller-2]   File "/Users/zmk5/ROS2/webots_ws/build/webots_ros2_examples/webots_ros2_examples/example_controller.py", line 17, in <module>
[example_controller-2]     from webots_ros2_core.webots_node import WebotsNode
[example_controller-2]   File "/Users/zmk5/ROS2/webots_ws/build/webots_ros2_core/webots_ros2_core/webots_node.py", line 39, in <module>
[example_controller-2]     raise e
[example_controller-2]   File "/Users/zmk5/ROS2/webots_ws/build/webots_ros2_core/webots_ros2_core/webots_node.py", line 35, in <module>
[example_controller-2]     from controller import Supervisor
[example_controller-2]   File "/Applications/Webots.app/lib/controller/python38/controller.py", line 31, in <module>
[example_controller-2]     import _controller
[example_controller-2] ImportError: dlopen(/Applications/Webots.app/lib/controller/python38/_controller.so, 2): Library not loaded: /Library/Frameworks/Python.framework/Versions/3.8/Python
[example_controller-2]   Referenced from: /Applications/Webots.app/lib/controller/python38/_controller.so
[example_controller-2]   Reason: image not found
[ERROR] [example_controller-2]: process has died [pid 22368, exit code 1, cmd '/Users/zmk5/ROS2/webots_ws/install/webots_ros2_examples/lib/webots_ros2_examples/example_controller --ros-args --params-file /var/folders/wq/bwd_8njd6lz3ggtfzt6k_5cc0000gn/T/launch_params__453um_9'].
[webots_launcher-1] AL lib: (WW) UpdateDeviceParams: SSE performs best with multiple of 4 update sizes (1114)
[INFO] [webots_launcher-1]: process has finished cleanly [pid 22367]

System

  • Webots Version: R2020b
  • ROS Version: Foxy
  • Operating System: macOS Catalina
  • Graphics Card: Radeon Pro 560X and Intel UHD Graphics 630

Additional context
After playing around with it a bit, I think the system is attempting to load the dyld from /Library/Frameworks/Python.framework/Versions/3.8/Python. However, this does not exist since I use the homebrew version of Python 3.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.