From c2167c4af62cef8a9145c6b5b37131cc4060acaf Mon Sep 17 00:00:00 2001 From: manx52 Date: Thu, 3 Oct 2024 12:04:03 -0400 Subject: [PATCH] fixed sim docker for the new way to download webots. minor fixes to unit test --- external/.dockerignore | 21 ------------------ external/Dockerfile | 22 +++++++++---------- .../soccer_pycontrol/test/test_placo.py | 5 +---- 3 files changed, 12 insertions(+), 36 deletions(-) diff --git a/external/.dockerignore b/external/.dockerignore index 7d4e5912c..b4533c9d1 100644 --- a/external/.dockerignore +++ b/external/.dockerignore @@ -1,24 +1,3 @@ -webots/.* -webots/.clang-format -webots/msys64 -webots/webots -webots/webots.lnk -webots/webots_debug_output.txt -webots/util -webots/bin/webots-bin -webots/**/*.exe -webots/**/*.o -webots/**/*.d -webots/**/*.class -webots/**/*.so -webots/**/*.dylib -webots/**/*.dll -webots/**/*.lib -webots/**/*.a -webots/**/*.cof -webots/**/*.hex -webots/**/*.pyc -webots/**/*.gch GameController/.* GameController/build/ hlvs_webots/controllers/referee/meshes/* diff --git a/external/Dockerfile b/external/Dockerfile index 508f59907..82e9ce8cb 100644 --- a/external/Dockerfile +++ b/external/Dockerfile @@ -1,7 +1,7 @@ FROM nvidia/cudagl:11.4.2-base ENV DEBIAN_FRONTEND=noninteractive - +#TODO how should i split, should it be its own repo?. The dockerfile should be in hlvs_webots and we can probably rebuild when there is a puch on it # Install dependencies RUN apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 RUN apt update && \ @@ -37,15 +37,16 @@ RUN apt update && apt-fast install -y \ RUN pip3 install transforms3d -WORKDIR /usr/local +ARG WEBOTS_VERSION="2022b" +ARG WEBOTS_DOWNLOAD_URL="https://github.com/cyberbotics/webots/releases/download/R${WEBOTS_VERSION}/webots_${WEBOTS_VERSION}_amd64.deb" + +RUN wget --no-verbose --show-progress "$WEBOTS_DOWNLOAD_URL" -O "/tmp/webots_${WEBOTS_VERSION}.deb" && sudo apt-get install "/tmp/webots_${WEBOTS_VERSION}.deb" -y -COPY webots/scripts webots/scripts -RUN ./webots/scripts/install/linux_compilation_dependencies.sh +ENV WEBOTS_HOME /usr/local/webots +RUN echo "export WEBOTS_HOME=/usr/local/webots" >> ~/.bashrc +RUN echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$WEBOTS_HOME/lib/controller" >> ~/.bashrc +RUN echo "export PYTHONPATH=$PYTHONPATH:$WEBOTS_HOME/lib/controller/python38" >> ~/.bashrc && source ~/.bashrc -COPY webots webots -RUN echo WEBOTS_HOME="/usr/local/webots" >> ~/.bashrc && \ - cd webots && \ - export WEBOTS_HOME="/usr/local/webots" && make COPY GameController GameController RUN apt update && apt-fast -y install ant protobuf-compiler libprotobuf-dev libjpeg9-dev && \ @@ -59,13 +60,12 @@ RUN cd hlvs_webots/controllers/referee && \ RUN apt-get install -y protobuf-compiler libprotobuf-dev libjpeg9-dev && \ cd hlvs_webots && \ - WEBOTS_HOME=/usr/local/webots make clean && \ - WEBOTS_HOME=/usr/local/webots make + make clean && \ + make RUN pip3 install pyyaml ENV QTWEBENGINE_DISABLE_SANDBOX=1 -ENV WEBOTS_HOME /usr/local/webots ENV GAME_CONTROLLER_HOME /usr/local/GameController SHELL ["/bin/bash", "-c"] diff --git a/soccer_control/soccer_pycontrol/test/test_placo.py b/soccer_control/soccer_pycontrol/test/test_placo.py index 005417ba3..592b3188d 100644 --- a/soccer_control/soccer_pycontrol/test/test_placo.py +++ b/soccer_control/soccer_pycontrol/test/test_placo.py @@ -21,11 +21,8 @@ def test_bez1(self): real_time=REAL_TIME, rate=200, ) - self.bez = Bez(robot_model="bez1", pose=Transformation()) + self.bez = Bez(robot_model="bez2", pose=Transformation()) walk = Navigator(self.world, self.bez) - # walk.ready() - # self.bez.motor_control.set_motor() - # walk.wait(50) target_goal = [0.08, 0, 0, 3, 500] # target_goal = Transformation(position=[1, 0, 0], euler=[0, 0, 0]) walk.walk(target_goal)