cyberbotics / wrestling-bob-ros-2

ROS 2 controller example for the Humanoid Robot Wrestling Competition. Demonstrates how to use the Motion_library class.
Apache License 2.0
0 stars 0 forks source link

running docker file doesn't connect to the webots #3

Open Ali-J-Fesharaki opened 1 year ago

Ali-J-Fesharaki commented 1 year ago

when I run the docker file it doesn't connect to webots and external controller.

docker run -it --net host --ipc=host --pid=host --user $(id -u):$(id -g) -v $HOME/.ros/log:/.ros/log -v /dev/shm:/dev/shm --cap-drop list 569e4d88ce69

I want to develop a controller inside the container so can anyone guide me to the appropriate devcontainer.json too

should I change these parameters ? ARG WEBOTS_CONTROLLER_URL ENV WEBOTS_CONTROLLER_URL=${WEBOTS_CONTROLLER_URL} ENV USER=root

omichel commented 1 year ago

I guess you are trying to run it locally, right? Before starting it, you should set the WEBOTS_CONTROLLER_URL environment variable to participant. Maybe this is what is missing. You should also start Webots in a separate docker. See how this done for Webots and for the participant on the simulation server.

Ali-J-Fesharaki commented 1 year ago

HI omichel thanks for your answer, yes i'm trying run webots locally due to more performance but i run controller on docker , there is no solution to run webots locally and run controllers and other packages from docker?

omichel commented 1 year ago

If you want to replicate what happens on the simulation server, you should run your controller in a docker and also Webots in another docker, see details here: https://github.com/cyberbotics/competition-record-action/blob/main/metascript/animation.py

You can also adapt the code a little bit and run only your controller in a docker, but Webots natively. That should work as well.