From fb2384d8026d39d46dc8f672428671efc2bc439e Mon Sep 17 00:00:00 2001 From: Christopher Lee Date: Thu, 7 May 2026 23:16:09 -0700 Subject: [PATCH 1/4] chore: update mavsdk version to 3.17.1 --- docker/Dockerfile.arm | 2 +- docker/Dockerfile.jetson | 2 +- docker/Dockerfile.x86 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/Dockerfile.arm b/docker/Dockerfile.arm index d1ae17cc..6af55191 100644 --- a/docker/Dockerfile.arm +++ b/docker/Dockerfile.arm @@ -89,7 +89,7 @@ RUN wget https://github.com/boostorg/boost/releases/download/boost-1.87.0/boost- && rm -rf boost-1.87.0 boost-1.87.0-b2-nodocs.tar.gz # install MAVSDK from source -RUN git clone --depth 1 https://github.com/mavlink/MAVSDK.git --branch v3.15.0 --single-branch \ +RUN git clone --depth 1 https://github.com/mavlink/MAVSDK.git --branch v3.17.1 --single-branch \ && cd MAVSDK \ && git submodule update --init --recursive \ && cmake -DCMAKE_BUILD_TYPE=Release -Bbuild/default -H. \ diff --git a/docker/Dockerfile.jetson b/docker/Dockerfile.jetson index 7113c548..8c3906d8 100644 --- a/docker/Dockerfile.jetson +++ b/docker/Dockerfile.jetson @@ -69,7 +69,7 @@ RUN wget https://github.com/boostorg/boost/releases/download/boost-1.87.0/boost- # install MAVSDK from source ENV PIP_INDEX_URL=https://pypi.org/simple -RUN git clone --depth 1 https://github.com/mavlink/MAVSDK.git --branch v3.15.0 --single-branch \ +RUN git clone --depth 1 https://github.com/mavlink/MAVSDK.git --branch v3.17.1 --single-branch \ && cd MAVSDK \ && git submodule update --init --recursive \ && cmake -DCMAKE_BUILD_TYPE=Release -Bbuild/default -H. \ diff --git a/docker/Dockerfile.x86 b/docker/Dockerfile.x86 index b60f862d..13a2ef28 100644 --- a/docker/Dockerfile.x86 +++ b/docker/Dockerfile.x86 @@ -166,7 +166,7 @@ RUN wget "https://github.com/pytorch/vision/archive/refs/tags/v${TORCHVISION_VER && make install # install MAVSDK from source -RUN git clone --depth 1 https://github.com/mavlink/MAVSDK.git --branch v3.15.0 --single-branch \ +RUN git clone --depth 1 https://github.com/mavlink/MAVSDK.git --branch v3.17.1 --single-branch \ && cd MAVSDK \ && git submodule update --init --recursive \ && cmake -DCMAKE_BUILD_TYPE=Release -Bbuild/default -H. \ From 0589e47a3692e4a24898168bd8a1bec97aa7773a Mon Sep 17 00:00:00 2001 From: Christopher Lee Date: Fri, 8 May 2026 13:52:29 -0700 Subject: [PATCH 2/4] feat: consolidate versions, make download directory standard --- docker/Dockerfile.arm | 87 ++++++++++++++++++++++------------------ docker/Dockerfile.jetson | 33 +++++++++------ docker/Dockerfile.x86 | 86 ++++++++++++++++++++++----------------- docker/Makefile | 16 ++++++-- docker/versions.env | 6 +++ 5 files changed, 137 insertions(+), 91 deletions(-) create mode 100644 docker/versions.env diff --git a/docker/Dockerfile.arm b/docker/Dockerfile.arm index 6af55191..9e6a86b7 100644 --- a/docker/Dockerfile.arm +++ b/docker/Dockerfile.arm @@ -1,6 +1,12 @@ FROM arm64v8/ubuntu:22.04 ARG USERNAME=tuas USER_UID=1000 USER_GID=1000 DEBIAN_FRONTEND=noninteractive +ARG PYTHON_VERSION +ARG CMAKE_VERSION +ARG BOOST_VERSION +ARG LIBTORCH_VERSION +ARG TORCHVISION_VERSION +ARG MAVSDK_VERSION # Needed to spawn up a GUI in headless mode for matplotplus to work ENV QT_QPA_PLATFORM="vnc" @@ -59,8 +65,8 @@ RUN apt-get install -y cpplint ENV PYENV_ROOT="/.pyenv" ENV PATH="$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH" RUN curl https://pyenv.run | bash -RUN pyenv install 3.11 -RUN pyenv global 3.11 +RUN pyenv install ${PYTHON_VERSION} +RUN pyenv global ${PYTHON_VERSION} RUN pip3 install typing-extensions PyYAML cpplint numpy RUN echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ @@ -71,29 +77,33 @@ RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \ --mount=target=/var/cache/apt,type=cache,sharing=locked \ rm -f /etc/apt/apt.conf.d/docker-clean \ && apt-get update \ - && wget https://github.com/Kitware/CMake/releases/download/v3.27.7/cmake-3.27.7-linux-aarch64.sh \ + && wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-aarch64.sh \ -q -O /tmp/cmake-install.sh \ && chmod u+x /tmp/cmake-install.sh \ - && mkdir /opt/cmake-3.24.1 \ - && /tmp/cmake-install.sh --skip-license --prefix=/opt/cmake-3.24.1 \ + && mkdir /opt/cmake-${CMAKE_VERSION} \ + && /tmp/cmake-install.sh --skip-license --prefix=/opt/cmake-${CMAKE_VERSION} \ && rm /tmp/cmake-install.sh \ - && ln -s /opt/cmake-3.24.1/bin/* /usr/local/bin + && ln -s /opt/cmake-${CMAKE_VERSION}/bin/* /usr/local/bin -# Download and install Boost 1.87.0 -RUN wget https://github.com/boostorg/boost/releases/download/boost-1.87.0/boost-1.87.0-b2-nodocs.tar.gz \ - && tar -xzf boost-1.87.0-b2-nodocs.tar.gz \ - && cd boost-1.87.0 \ +# Download and install Boost +WORKDIR /tmp +RUN wget https://github.com/boostorg/boost/releases/download/boost-${BOOST_VERSION}/boost-${BOOST_VERSION}-b2-nodocs.tar.gz \ + && tar -xzf boost-${BOOST_VERSION}-b2-nodocs.tar.gz \ + && cd boost-${BOOST_VERSION} \ && ./bootstrap.sh \ && ./b2 install \ - && cd .. \ - && rm -rf boost-1.87.0 boost-1.87.0-b2-nodocs.tar.gz + && cd /tmp \ + && rm -rf boost-${BOOST_VERSION} boost-${BOOST_VERSION}-b2-nodocs.tar.gz # install MAVSDK from source -RUN git clone --depth 1 https://github.com/mavlink/MAVSDK.git --branch v3.17.1 --single-branch \ +WORKDIR /tmp +RUN git clone --depth 1 https://github.com/mavlink/MAVSDK.git --branch v${MAVSDK_VERSION} --single-branch \ && cd MAVSDK \ && git submodule update --init --recursive \ && cmake -DCMAKE_BUILD_TYPE=Release -Bbuild/default -H. \ - && cmake --build build/default -j4 --target install + && cmake --build build/default -j4 --target install \ + && cd /tmp \ + && rm -rf MAVSDK # the official docs say also these # https://docs.opencv.org/4.x/d7/d9f/tutorial_linux_install.html @@ -102,13 +112,12 @@ RUN git clone --depth 1 https://github.com/mavlink/MAVSDK.git --branch v3.17.1 - # Make sure to install the same version of torchvision as the version of # libtorch we built in the Jetson -ARG LIBTORCH_VERSION=2.3.1 -ARG LIBTORCH_INSTALL_DIR=/libtorch-tmp -WORKDIR ${LIBTORCH_INSTALL_DIR} -RUN git clone --recursive --branch v${LIBTORCH_VERSION} https://github.com/pytorch/pytorch.git -RUN mkdir pytorch-build -RUN cd pytorch-build && \ - USE_CUDA=0 \ +WORKDIR /tmp +RUN git clone --recursive --branch v${LIBTORCH_VERSION} https://github.com/pytorch/pytorch.git \ + && cd pytorch \ + && mkdir build \ + && cd build \ + && USE_CUDA=0 \ USE_CUDNN=0 \ USE_NCCL=0 \ BUILD_TORCH=ON \ @@ -136,11 +145,10 @@ RUN cd pytorch-build && \ -DBUILD_SHARED_LIBS:BOOL=ON \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DPYTHON_EXECUTABLE:PATH=$(which python3) \ - -DCMAKE_INSTALL_PREFIX=${LIBTORCH_INSTALL_DIR}/libtorch \ + -DCMAKE_INSTALL_PREFIX=/opt/libtorch \ -DBUILD_CUSTOM_PROTOBUF=OFF \ - ../pytorch -RUN cd pytorch-build && \ - USE_CUDA=0 \ + .. \ + && USE_CUDA=0 \ USE_CUDNN=0 \ USE_NCCL=0 \ BUILD_TORCH=ON \ @@ -151,28 +159,31 @@ RUN cd pytorch-build && \ BUILD_CAFFE2_OPS=0 \ BUILD_CAFFE2=0 \ cmake --build . -j4 --target install \ - && rm -f ${LIBTORCH_INSTALL_DIR}/libtorch/bin/protoc \ - && rm -rf ${LIBTORCH_INSTALL_DIR}/libtorch/lib/libprotobuf* \ - && rm -rf ${LIBTORCH_INSTALL_DIR}/libtorch/lib/libprotoc* \ - && rm -rf ${LIBTORCH_INSTALL_DIR}/libtorch/include/google/protobuf + && rm -f /opt/libtorch/bin/protoc \ + && rm -rf /opt/libtorch/lib/libprotobuf* \ + && rm -rf /opt/libtorch/lib/libprotoc* \ + && rm -rf /opt/libtorch/include/google/protobuf \ + && cd /tmp \ + && rm -rf pytorch -ENV CMAKE_PREFIX_PATH="${LIBTORCH_INSTALL_DIR}/libtorch" +ENV CMAKE_PREFIX_PATH="/opt/libtorch" -ARG TORCHVISION_VERSION=0.18.1 -ARG TORCHVISION_INSTALL_DIR=/torchvision-tmp -WORKDIR ${TORCHVISION_INSTALL_DIR} +WORKDIR /tmp RUN wget "https://github.com/pytorch/vision/archive/refs/tags/v${TORCHVISION_VERSION}.zip" \ && unzip "v${TORCHVISION_VERSION}.zip" \ - && mkdir -p "${TORCHVISION_INSTALL_DIR}/vision-${TORCHVISION_VERSION}/build" \ - && cd "${TORCHVISION_INSTALL_DIR}/vision-${TORCHVISION_VERSION}/build" \ + && cd vision-${TORCHVISION_VERSION} \ + && mkdir build \ + && cd build \ && cmake -DWITH_CUDA=off -D_GLIBCXX_USE_CXX11_ABI=1 -DCMAKE_BUILD_TYPE=Release .. \ && make -j4 \ - && make install + && make install \ + && cd /tmp \ + && rm -rf vision-${TORCHVISION_VERSION} v${TORCHVISION_VERSION}.zip RUN pip3 install gdown ENV PATH="${PATH}:/root/.local/bin" # login as non-root user USER $USERNAME - -ENV PATH="${PATH}:/home/${USERNAME}/.local/bin" +ENV HOME="/home/${USERNAME}" +ENV PATH="${PATH}:${HOME}/.local/bin" diff --git a/docker/Dockerfile.jetson b/docker/Dockerfile.jetson index 8c3906d8..f069dcf6 100644 --- a/docker/Dockerfile.jetson +++ b/docker/Dockerfile.jetson @@ -1,6 +1,9 @@ FROM dustynv/l4t-pytorch:r36.2.0 ARG USERNAME=tuas USER_UID=1000 USER_GID=1000 DEBIAN_FRONTEND=noninteractive +ARG BOOST_VERSION +ARG TORCHVISION_VERSION +ARG MAVSDK_VERSION # Needed to spawn up a GUI in headless mode for matplotplus to work ENV QT_QPA_PLATFORM="vnc" @@ -58,24 +61,27 @@ RUN pip3 install --no-cache-dir --index-url https://pypi.org/simple typing-exten RUN echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ && chmod 0440 /etc/sudoers.d/$USERNAME -# Download and install Boost 1.87.0 -RUN wget https://github.com/boostorg/boost/releases/download/boost-1.87.0/boost-1.87.0-b2-nodocs.tar.gz \ - && tar -xzf boost-1.87.0-b2-nodocs.tar.gz \ - && cd boost-1.87.0 \ +# Download and install Boost +WORKDIR /tmp +RUN wget https://github.com/boostorg/boost/releases/download/boost-${BOOST_VERSION}/boost-${BOOST_VERSION}-b2-nodocs.tar.gz \ + && tar -xzf boost-${BOOST_VERSION}-b2-nodocs.tar.gz \ + && cd boost-${BOOST_VERSION} \ && ./bootstrap.sh \ && ./b2 install \ - && cd .. \ - && rm -rf boost-1.87.0 boost-1.87.0-b2-nodocs.tar.gz + && cd /tmp \ + && rm -rf boost-${BOOST_VERSION} boost-${BOOST_VERSION}-b2-nodocs.tar.gz # install MAVSDK from source ENV PIP_INDEX_URL=https://pypi.org/simple -RUN git clone --depth 1 https://github.com/mavlink/MAVSDK.git --branch v3.17.1 --single-branch \ +WORKDIR /tmp +RUN git clone --depth 1 https://github.com/mavlink/MAVSDK.git --branch v${MAVSDK_VERSION} --single-branch \ && cd MAVSDK \ && git submodule update --init --recursive \ && cmake -DCMAKE_BUILD_TYPE=Release -Bbuild/default -H. \ - && cmake --build build/default -j`nproc` --target install + && cmake --build build/default -j`nproc` --target install \ + && cd /tmp \ + && rm -rf MAVSDK -ARG TORCHVISION_VERSION=0.18.1 # Space separated list of CUDA architecture versions. # The version nubmers depend on the NVIDIA GPU model we're using and the installed CUDA version. # For the Jetson Orin Nano with the "Ampere" architecture and CUDA 12.1 we can use version 8.6 (written as 86 in CUDA_ARCH_LIST). @@ -83,9 +89,8 @@ ARG TORCHVISION_VERSION=0.18.1 # See https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#gpu-feature-list # and https://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/ # and https://stackoverflow.com/a/74962874 -ARG TORCHVISION_INSTALL_DIR=/tmp/torchvision ARG CUDA_ARCH_LIST="5.0 5.2 5.3 6.0 6.1 6.2 7.0 7.2 7.5 8.0 8.6 8.7 8.9 9.0" -WORKDIR ${TORCHVISION_INSTALL_DIR} +WORKDIR /tmp RUN wget "https://github.com/pytorch/vision/archive/refs/tags/v${TORCHVISION_VERSION}.zip" \ && unzip "v${TORCHVISION_VERSION}.zip" \ && cd vision-${TORCHVISION_VERSION} \ @@ -93,10 +98,12 @@ RUN wget "https://github.com/pytorch/vision/archive/refs/tags/v${TORCHVISION_VER && cd build \ && cmake -DWITH_CUDA=1 -DTORCH_CUDA_ARCH_LIST="${CUDA_ARCH_LIST}" -DCUDA_HAS_FP16=1 -DCUDA_NO_HALF_OPERATORS=1 -DCUDA_NO_HALF_CONVERSIONS=1 -DCUDA_NO_HALF2_OPERATORS=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="/usr/local/lib/python3.10/dist-packages/torch/share/cmake/Torch" .. \ && make -j`nproc` \ - && make install + && make install \ + && cd /tmp \ + && rm -rf vision-${TORCHVISION_VERSION} v${TORCHVISION_VERSION}.zip RUN pip3 install gdown -ENV PATH="${PATH}:${HOME}/.local/bin" +ENV PATH="${PATH}:/root/.local/bin" WORKDIR /obcpp COPY . . diff --git a/docker/Dockerfile.x86 b/docker/Dockerfile.x86 index 13a2ef28..53185a8c 100644 --- a/docker/Dockerfile.x86 +++ b/docker/Dockerfile.x86 @@ -1,6 +1,12 @@ FROM amd64/ubuntu:22.04 ARG USERNAME=tuas USER_UID=1000 USER_GID=1000 DEBIAN_FRONTEND=noninteractive +ARG PYTHON_VERSION +ARG CMAKE_VERSION +ARG BOOST_VERSION +ARG LIBTORCH_VERSION +ARG TORCHVISION_VERSION +ARG MAVSDK_VERSION # Needed to spawn up a GUI in headless mode for matplotplus to work ENV QT_QPA_PLATFORM="vnc" @@ -58,8 +64,8 @@ ENV PYENV_ROOT="/.pyenv" RUN curl https://pyenv.run | bash ENV PATH="${PATH}:${PYENV_ROOT}/bin" RUN eval "$(pyenv init -)" -RUN pyenv install 3.11 -RUN pyenv global 3.11 +RUN pyenv install ${PYTHON_VERSION} +RUN pyenv global ${PYTHON_VERSION} RUN pip3 install typing-extensions PyYAML cpplint numpy RUN echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ @@ -70,22 +76,23 @@ RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \ --mount=target=/var/cache/apt,type=cache,sharing=locked \ rm -f /etc/apt/apt.conf.d/docker-clean \ && apt-get update \ - && wget https://github.com/Kitware/CMake/releases/download/v3.27.7/cmake-3.27.7-linux-x86_64.sh \ + && wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.sh \ -q -O /tmp/cmake-install.sh \ && chmod u+x /tmp/cmake-install.sh \ - && mkdir /opt/cmake-3.24.1 \ - && /tmp/cmake-install.sh --skip-license --prefix=/opt/cmake-3.24.1 \ + && mkdir /opt/cmake-${CMAKE_VERSION} \ + && /tmp/cmake-install.sh --skip-license --prefix=/opt/cmake-${CMAKE_VERSION} \ && rm /tmp/cmake-install.sh \ - && ln -s /opt/cmake-3.24.1/bin/* /usr/local/bin + && ln -s /opt/cmake-${CMAKE_VERSION}/bin/* /usr/local/bin -# Download and install Boost 1.87.0 -RUN wget https://archives.boost.io/release/1.87.0/source/boost_1_87_0.tar.gz \ - && tar -xzf boost_1_87_0.tar.gz \ - && cd boost_1_87_0 \ +# Download and install Boost +WORKDIR /tmp +RUN wget https://github.com/boostorg/boost/releases/download/boost-${BOOST_VERSION}/boost-${BOOST_VERSION}-b2-nodocs.tar.gz \ + && tar -xzf boost-${BOOST_VERSION}-b2-nodocs.tar.gz \ + && cd boost-${BOOST_VERSION} \ && ./bootstrap.sh \ && ./b2 install \ - && cd .. \ - && rm -rf boost_1_87_0 boost_1_87_0.tar.gz + && cd /tmp \ + && rm -rf boost-${BOOST_VERSION} boost-${BOOST_VERSION}-b2-nodocs.tar.gz # the official docs say also these # https://docs.opencv.org/4.x/d7/d9f/tutorial_linux_install.html @@ -96,13 +103,12 @@ RUN wget https://archives.boost.io/release/1.87.0/source/boost_1_87_0.tar.gz \ # Make sure to install the same version of torchvision as the version of # libtorch we built in the Jetson -ARG LIBTORCH_VERSION=2.3.1 -ARG LIBTORCH_INSTALL_DIR=/libtorch-tmp -WORKDIR ${LIBTORCH_INSTALL_DIR} -RUN git clone --recursive --branch v${LIBTORCH_VERSION} https://github.com/pytorch/pytorch.git -RUN mkdir pytorch-build -RUN cd pytorch-build && \ - USE_CUDA=0 \ +WORKDIR /tmp +RUN git clone --recursive --branch v${LIBTORCH_VERSION} https://github.com/pytorch/pytorch.git \ + && cd pytorch \ + && mkdir build \ + && cd build \ + && USE_CUDA=0 \ USE_CUDNN=0 \ USE_NCCL=0 \ BUILD_TORCH=ON \ @@ -130,11 +136,10 @@ RUN cd pytorch-build && \ -DBUILD_SHARED_LIBS:BOOL=ON \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DPYTHON_EXECUTABLE:PATH=$(which python3) \ - -DCMAKE_INSTALL_PREFIX=${LIBTORCH_INSTALL_DIR}/libtorch \ + -DCMAKE_INSTALL_PREFIX=/opt/libtorch \ -DBUILD_CUSTOM_PROTOBUF=OFF \ - ../pytorch -RUN cd pytorch-build && \ - USE_CUDA=0 \ + .. \ + && USE_CUDA=0 \ USE_CUDNN=0 \ USE_NCCL=0 \ BUILD_TORCH=ON \ @@ -145,38 +150,45 @@ RUN cd pytorch-build && \ BUILD_CAFFE2_OPS=0 \ BUILD_CAFFE2=0 \ cmake --build . -j$(nproc) --target install \ - && rm -f ${LIBTORCH_INSTALL_DIR}/libtorch/bin/protoc \ - && rm -rf ${LIBTORCH_INSTALL_DIR}/libtorch/lib/libprotobuf* \ - && rm -rf ${LIBTORCH_INSTALL_DIR}/libtorch/lib/libprotoc* \ - && rm -rf ${LIBTORCH_INSTALL_DIR}/libtorch/include/google/protobuf + && rm -f /opt/libtorch/bin/protoc \ + && rm -rf /opt/libtorch/lib/libprotobuf* \ + && rm -rf /opt/libtorch/lib/libprotoc* \ + && rm -rf /opt/libtorch/include/google/protobuf \ + && cd /tmp \ + && rm -rf pytorch -ENV CMAKE_PREFIX_PATH="${LIBTORCH_INSTALL_DIR}/libtorch" +ENV CMAKE_PREFIX_PATH="/opt/libtorch" # pull and build torchvision # refer to this page for version compatibilty with pytorch (libtorch) https://github.com/pytorch/pytorch/wiki/PyTorch-Versions -ARG TORCHVISION_VERSION=0.18.1 -ARG TORCHVISION_INSTALL_DIR=/torchvision-tmp -WORKDIR ${TORCHVISION_INSTALL_DIR} +WORKDIR /tmp RUN wget "https://github.com/pytorch/vision/archive/refs/tags/v${TORCHVISION_VERSION}.zip" \ && unzip "v${TORCHVISION_VERSION}.zip" \ - && mkdir -p "${TORCHVISION_INSTALL_DIR}/vision-${TORCHVISION_VERSION}/build" \ - && cd "${TORCHVISION_INSTALL_DIR}/vision-${TORCHVISION_VERSION}/build" \ + && cd vision-${TORCHVISION_VERSION} \ + && mkdir build \ + && cd build \ && cmake -DWITH_CUDA=off -D_GLIBCXX_USE_CXX11_ABI=1 -DCMAKE_BUILD_TYPE=Release .. \ && make -j$(nproc) \ - && make install + && make install \ + && cd /tmp \ + && rm -rf vision-${TORCHVISION_VERSION} v${TORCHVISION_VERSION}.zip # install MAVSDK from source -RUN git clone --depth 1 https://github.com/mavlink/MAVSDK.git --branch v3.17.1 --single-branch \ +WORKDIR /tmp +RUN git clone --depth 1 https://github.com/mavlink/MAVSDK.git --branch v${MAVSDK_VERSION} --single-branch \ && cd MAVSDK \ && git submodule update --init --recursive \ && cmake -DCMAKE_BUILD_TYPE=Release -Bbuild/default -H. \ - && cmake --build build/default -j$(nproc) --target install + && cmake --build build/default -j$(nproc) --target install \ + && cd /tmp \ + && rm -rf MAVSDK RUN pip3 install gdown -ENV PATH="${PATH}:${HOME}/.local/bin" +ENV PATH="${PATH}:/root/.local/bin" # login as non-root user USER $USERNAME +ENV HOME="/home/${USERNAME}" RUN pip3 install gdown ENV PATH="${PATH}:${HOME}/.local/bin" \ No newline at end of file diff --git a/docker/Makefile b/docker/Makefile index eec566be..de512527 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -2,8 +2,18 @@ all: echo "select one of the other targets" +include versions.env +export + +BUILD_ARGS = --build-arg PYTHON_VERSION=$(PYTHON_VERSION) \ + --build-arg CMAKE_VERSION=$(CMAKE_VERSION) \ + --build-arg BOOST_VERSION=$(BOOST_VERSION) \ + --build-arg LIBTORCH_VERSION=$(LIBTORCH_VERSION) \ + --build-arg TORCHVISION_VERSION=$(TORCHVISION_VERSION) \ + --build-arg MAVSDK_VERSION=$(MAVSDK_VERSION) + build-x86-image: - docker buildx build --platform linux/amd64 --tag ghcr.io/tritonuas/obcpp:x86 --file Dockerfile.x86 --load .. + docker buildx build --platform linux/amd64 --tag ghcr.io/tritonuas/obcpp:x86 $(BUILD_ARGS) --file Dockerfile.x86 --load .. # NOTE: the jetson Docker image is based on a custom base image we generate from # https://github.com/dusty-nv/jetson-containers/ @@ -12,10 +22,10 @@ build-x86-image: # - Push that image to dockerhub as whatever tag the FROM line in our Dockerfile.jetson is # - Run the following build-jeston-image target build-jetson-image: - docker buildx build --platform linux/arm64 --tag ghcr.io/tritonuas/obcpp:jetson --file Dockerfile.jetson --load .. + docker buildx build --platform linux/arm64 --tag ghcr.io/tritonuas/obcpp:jetson $(BUILD_ARGS) --file Dockerfile.jetson --load .. build-arm-image: - docker buildx build --platform linux/arm64 --tag ghcr.io/tritonuas/obcpp:arm --file Dockerfile.arm --load .. + docker buildx build --platform linux/arm64 --tag ghcr.io/tritonuas/obcpp:arm $(BUILD_ARGS) --file Dockerfile.arm --load .. push-jetson-image: docker push ghcr.io/tritonuas/obcpp:jetson diff --git a/docker/versions.env b/docker/versions.env new file mode 100644 index 00000000..a3404c27 --- /dev/null +++ b/docker/versions.env @@ -0,0 +1,6 @@ +BOOST_VERSION=1.87.0 +CMAKE_VERSION=3.27.7 +LIBTORCH_VERSION=2.3.1 +MAVSDK_VERSION=3.17.1 +PYTHON_VERSION=3.11 +TORCHVISION_VERSION=0.18.1 From 99c600c3fe6a0f532fc503da4ea9c14ea7fa53c0 Mon Sep 17 00:00:00 2001 From: Christopher Lee Date: Sat, 9 May 2026 12:24:48 -0700 Subject: [PATCH 3/4] qol: supress cpp17-->cpp14 warnings --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 532d9de3..5640f9d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,7 +31,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS True) # set(CMAKE_POSITION_INDEPENDENT_CODE True) -SET(GCC_COMPILE_FLAGS "") +SET(GCC_COMPILE_FLAGS "-Wno-psabi") SET(GCC_LINK_FLAGS "-lprotobuf -lopencv_core -lopencv_highgui -lopencv_features2d -lopencv_flann -lopencv_imgcodecs -lopencv_dnn -lopencv_videoio -lopencv_imgproc -lopencv_ml -lopencv_photo -lprotobuf") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COMPILE_FLAGS}") From 15583012f9dfb899832235c979112dc2220c2316 Mon Sep 17 00:00:00 2001 From: Christopher Lee Date: Sat, 9 May 2026 12:25:03 -0700 Subject: [PATCH 4/4] chore: change c string type from int to float --- src/network/mavlink.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/mavlink.cpp b/src/network/mavlink.cpp index 19346af5..de51ff67 100644 --- a/src/network/mavlink.cpp +++ b/src/network/mavlink.cpp @@ -186,7 +186,7 @@ MavlinkClient::MavlinkClient(OBCConfig config) }); this->telemetry->subscribe_heading([this](mavsdk::Telemetry::Heading heading) { - VLOG_F(DEBUG, "Heading: %d", heading.heading_deg); + VLOG_F(DEBUG, "Heading: %f", heading.heading_deg); Lock lock(this->data_mut); this->data.heading_deg = heading.heading_deg; });