cyberbotics / webots_ros2

Webots ROS 2 packages
Apache License 2.0
389 stars 141 forks source link

Ros2: Connect to webots remotely #906

Closed elad-eyal closed 4 months ago

elad-eyal commented 4 months ago

I have a robot software which is currently in simulation. Ros2 and webots with two no plugins, one for ros2_control and one direct driver. All rubbing fine under WSL2 Ubuntu 22.04.

As a step in robot bring up, I thought I would be able to host all the software on the robot host (raspberry pi 4b) and communicate with a webots simulation running on my PC through TCP.

I thought it would be a simple matter of setting WEBOTS_CONTROLLER_URL to the PC's IP address.

It seems that this package does not support this. It only connects to localhost? Or am I missing anything

I was able to jury-rig https://github.com/cyberbotics/webots_ros2/blob/master/webots_ros2_driver%2Fwebots_ros2_driver%2Fwebots_controller.py by copying it to my project and forcing the url, and this enabled the simple plugin, but it did not enable the ros2_control driver to communicate with webots on PC.

Is there a way to configure the webots controller url that I am not familiar with?

How does the ros2 control plugin know where to find the controller?

Thanks