Skip to content

Commit 3ff2f8c

Browse files
committed
Build mavros from source.
1 parent ac40973 commit 3ff2f8c

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

.docker/Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,18 @@ RUN sudo apt-get -q update \
108108
&& sudo apt-get clean -y \
109109
&& sudo rm -rf /var/lib/apt/lists/*
110110

111+
# Manually install MAVROS from source in the ws_blue/ workspace
112+
WORKDIR $USER_WORKSPACE/src/
113+
ARG MAVROS_RELEASE=ros2
114+
ARG MAVLINK_RELEASE=release/rolling/mavlink
115+
RUN git clone --depth 1 -b ${MAVROS_RELEASE} https://github.com/mavlink/mavros.git
116+
RUN git clone --depth 1 --recursive -b ${MAVLINK_RELEASE} https://github.com/mavlink/mavlink-gbp-release.git mavlink
117+
# mavgen uses future.standard_library for backwards compatibility with Python2;
118+
# However, this caused issues Python3.12 as installed in "noble".
119+
# Comment those lines out in mavlink.
120+
# n.b. This may not be the best way to do this. A sed one-liner?
121+
RUN patch -d mavlink -p 1 < $USER_WORKSPACE/src/blue/.docker/patches/mavlink_standard_library.patch
122+
111123
WORKDIR $USER_WORKSPACE
112124
RUN sudo apt-get -q update \
113125
&& sudo apt-get -q -y upgrade \
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff --git a/pymavlink/generator/mavgen.py b/pymavlink/generator/mavgen.py
2+
index ea62c961..35353184 100755
3+
--- a/pymavlink/generator/mavgen.py
4+
+++ b/pymavlink/generator/mavgen.py
5+
@@ -23,8 +23,8 @@ General process:
6+
'''
7+
8+
from __future__ import print_function
9+
-from future import standard_library
10+
-standard_library.install_aliases()
11+
+#from future import standard_library
12+
+#standard_library.install_aliases()
13+
from builtins import object
14+
import os
15+
import re

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@
99
!blue.repos
1010
!sim.repos
1111
!.docker/entrypoints
12+
!.docker/patches
1213
!requirements-build.txt

0 commit comments

Comments
 (0)