Skip to content

Commit 8d42564

Browse files
Merge pull request #374 from TayebAlsh/add-mavlink-osx-patch
Add mavlink/mavros support for macOS (osx-arm64)
2 parents 5e18255 + d61b7e8 commit 8d42564

File tree

3 files changed

+29
-4
lines changed

3 files changed

+29
-4
lines changed

patch/ros-humble-mavlink.osx.patch

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
diff --git a/pymavlink/generator/CPP11/include_v2.0/msgmap.hpp b/pymavlink/generator/CPP11/include_v2.0/msgmap.hpp
2+
index a3956aa2..2abe2a5e 100644
3+
--- a/pymavlink/generator/CPP11/include_v2.0/msgmap.hpp
4+
+++ b/pymavlink/generator/CPP11/include_v2.0/msgmap.hpp
5+
@@ -4,7 +4,14 @@
6+
#include <algorithm>
7+
#ifdef FREEBSD
8+
#include <sys/endian.h>
9+
-#elif __APPLE__
10+
+#elif defined(__APPLE__)
11+
+#include <libkern/OSByteOrder.h>
12+
+#define htole16(x) OSSwapHostToLittleInt16(x)
13+
+#define htole32(x) OSSwapHostToLittleInt32(x)
14+
+#define htole64(x) OSSwapHostToLittleInt64(x)
15+
+#define le16toh(x) OSSwapLittleToHostInt16(x)
16+
+#define le32toh(x) OSSwapLittleToHostInt32(x)
17+
+#define le64toh(x) OSSwapLittleToHostInt64(x)
18+
#include <machine/endian.h>
19+
#else
20+
#include <endian.h>

pkg_additional_info.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,5 +151,11 @@ rosidl_generator_cpp:
151151
build_number: 14
152152
rosidl_runtime_cpp:
153153
build_number: 14
154+
mavlink:
155+
build_number: 14
156+
libmavconn:
157+
build_number: 14
154158
mavros:
155159
build_number: 14
160+
mavros_msgs:
161+
build_number: 14

vinca.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -341,10 +341,6 @@ packages_select_by_deps:
341341
# Require Linux-specific joystick interfaces
342342
- joy_linux
343343

344-
# mavros and mavlink (currently Linux only)
345-
- mavlink
346-
- mavros
347-
348344
# These packages are currently only build on Linux,
349345
# as trying to build them in the past on macos or Windows resulted in errors,
350346
# but probably they can work on all platform with some work
@@ -445,3 +441,6 @@ packages_select_by_deps:
445441
- ign_ros2_control
446442
- gz_ros2_control
447443
- ur_simulation_gz
444+
# mavros and mavlink (enabled on macOS for testing)
445+
- mavlink
446+
- mavros

0 commit comments

Comments
 (0)