From d579992ad6298cd5edd9a75f1ff6d734b0681c47 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 30 Sep 2024 22:25:01 +0100 Subject: [PATCH] Auton Docker --- .env.prod | 6 ++-- docker_auton/Dockerfile | 29 +++++++++++++------ .../Dockerfile | 0 rb_ws/= | 1 + rb_ws/python-requirements.txt | 13 +++++++++ rb_ws/src/buggy/launch/debug_steer.launch | 1 + rb_ws/src/buggy/launch/nand-system.launch | 2 +- rb_ws/src/buggy/scripts/debug/debug_steer.py | 3 +- setup_prod.sh | 4 +-- 9 files changed, 43 insertions(+), 16 deletions(-) rename {docker_tester_outofdate => docker_tester}/Dockerfile (100%) create mode 100644 rb_ws/= create mode 100644 rb_ws/python-requirements.txt diff --git a/.env.prod b/.env.prod index ab907a32..61a48c24 100755 --- a/.env.prod +++ b/.env.prod @@ -1,6 +1,6 @@ -GPS_PORT=/dev/serial/by-id/usb-Lord_Microstrain_Lord_Inertial_Sensor_0000_6284.114124-if00 +GPS_PORT=/dev/null GPS_PORT_AUX=/dev/null WEBCAM_PORT=/dev/null RLSENSE_PORT=/dev/bus/usb -TEENSY_PORT=/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_AD01TF04-if00-port0 -FEATHER_PORT=/dev/serial/by-id/usb-Adafruit_Adafruit_Feather_M0_77D70E005154384153202020FF18250B-if00 +TEENSY_PORT=/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_AL037JPG-if00-port0 +FEATHER_PORT=/dev/null diff --git a/docker_auton/Dockerfile b/docker_auton/Dockerfile index a05558e6..2d9d3128 100755 --- a/docker_auton/Dockerfile +++ b/docker_auton/Dockerfile @@ -1,33 +1,44 @@ # FROM nvidia/cuda:11.6.2-base-ubuntu20.04 as CUDA -FROM osrf/ros:noetic-desktop-full-focal - +#FROM arm64v8/ros:noetic-perception-focal +#FROM ros:noetic-ros-base-focal # COPY --from=CUDA /usr/local/cuda /usr/local/ +#FROM arm64v8/ros:noetic-ros-base-focal + +FROM ubuntu:focal@sha256:420b6f4cc783dc199667eae3316d9e066bd6e19931448c1e4b6f9a3759e52106 +ENV DEBIAN_FRONTEND noninteractive RUN apt update RUN apt-get install -y -qq \ python3-pip \ python3-tk \ - vim git tmux tree sl htop x11-apps + vim git tmux tree sl htop x11-apps curl -RUN apt-get install -y -qq \ +RUN apt-get update && apt-get install -y lsb-release && apt-get clean all + +# RUN curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc +# RUN apt-key add - + +# https://wiki.ros.org/noetic/Installation/Ubuntu + +# RUN apt-get install -y -qq \ +# ros-noetic-desktop-full \ ros-noetic-rosserial \ ros-noetic-foxglove-bridge \ ros-noetic-microstrain-inertial-driver \ ros-noetic-realsense2-camera \ ros-noetic-realsense2-description \ - ros-${ROS_DISTRO}-mavros ros-${ROS_DISTRO}-mavros-extras ros-${ROS_DISTRO}-mavros-msgs + ros-noetic-mavros ros-noetic-mavros-extras ros-noetic-mavros-msgs # Run this now to cache it separately from other requirements # COPY cuda-requirements_TEMP_DO_NOT_EDIT.txt cuda-requirements.txt # RUN pip3 install -r cuda-requirements.txt +# COPY ./python-requirements_TEMP_DO_NOT_EDIT.txt python-requirements.txt +# RUN pip3 install -r python-requirements.txt -COPY python-requirements_TEMP_DO_NOT_EDIT.txt python-requirements.txt -RUN pip3 install -r python-requirements.txt - -RUN echo 'source "/opt/ros/$ROS_DISTRO/setup.bash" --' >> ~/.bashrc +# RUN echo 'source "/opt/ros/$ROS_DISTRO/setup.bash" --' >> ~/.bashrc RUN echo 'cd rb_ws' >> ~/.bashrc RUN echo 'catkin_make >/dev/null' >> ~/.bashrc RUN echo 'source devel/setup.bash' >> ~/.bashrc diff --git a/docker_tester_outofdate/Dockerfile b/docker_tester/Dockerfile similarity index 100% rename from docker_tester_outofdate/Dockerfile rename to docker_tester/Dockerfile diff --git a/rb_ws/= b/rb_ws/= new file mode 100644 index 00000000..ef0f84ea --- /dev/null +++ b/rb_ws/= @@ -0,0 +1 @@ +Requirement already satisfied: numpy in /usr/local/lib/python3.8/dist-packages (1.20.3) diff --git a/rb_ws/python-requirements.txt b/rb_ws/python-requirements.txt new file mode 100644 index 00000000..9e12c3fe --- /dev/null +++ b/rb_ws/python-requirements.txt @@ -0,0 +1,13 @@ +matplotlib==3.1.2 +NavPy==1.0 +numba==0.58.0 +numpy<1.21.0 +osqp==0.6.3 +pandas==2.0.3 +pymap3d==3.0.1 +scipy==1.10.1 +trimesh==3.23.5 +utm==0.7.0 +keyboard==0.13.5 +tk==0.1.0 +pyembree diff --git a/rb_ws/src/buggy/launch/debug_steer.launch b/rb_ws/src/buggy/launch/debug_steer.launch index a200e728..76f83bc0 100644 --- a/rb_ws/src/buggy/launch/debug_steer.launch +++ b/rb_ws/src/buggy/launch/debug_steer.launch @@ -2,4 +2,5 @@ + \ No newline at end of file diff --git a/rb_ws/src/buggy/launch/nand-system.launch b/rb_ws/src/buggy/launch/nand-system.launch index 21416a5e..973cbf91 100644 --- a/rb_ws/src/buggy/launch/nand-system.launch +++ b/rb_ws/src/buggy/launch/nand-system.launch @@ -2,7 +2,7 @@ - + diff --git a/rb_ws/src/buggy/scripts/debug/debug_steer.py b/rb_ws/src/buggy/scripts/debug/debug_steer.py index 142920f2..7f30641e 100755 --- a/rb_ws/src/buggy/scripts/debug/debug_steer.py +++ b/rb_ws/src/buggy/scripts/debug/debug_steer.py @@ -24,7 +24,7 @@ def __init__(self, self_name) -> None: # Outputs a continuous sine wave ranging from -50 to 50, with a period of 500 ticks def sin_steer(self, tick_count): - return 50 * np.sin((2 * np.pi) * tick_count/500) + return 20 * np.sin((2 * np.pi) * tick_count/1000) #returns a constant steering angle of 42 degrees def constant_steer(self, _): @@ -42,6 +42,7 @@ def loop(self): tick_count += 1 steer_cmd = self.sin_steer(tick_count) + # print(steer_cmd) rate.sleep() diff --git a/setup_prod.sh b/setup_prod.sh index 6afef617..82c97e2c 100755 --- a/setup_prod.sh +++ b/setup_prod.sh @@ -87,10 +87,10 @@ cp cuda-requirements.txt docker_auton mv docker_auton/cuda-requirements.txt docker_auton/cuda-requirements_TEMP_DO_NOT_EDIT.txt echo "Building containers..." -docker compose -f $dockerfile build +docker-compose -f $dockerfile build echo "Starting containers..." -docker compose -f $dockerfile --env-file .env.prod up -d +docker-compose -f $dockerfile --env-file .env.prod up -d sleep 0.5