Mavlink IOS integration over Cxx

13 views
Skip to first unread message

Emirhan Çelik

unread,
Feb 8, 2025, 9:10:13 AMFeb 8
to MAVLink
Hi folks,

I would like to contribute to the iOS side of the MAVLink project. There is already a Swift example in the GitHub repository, but it is very outdated and only supports basic functionalities like arming and disarming. It does not allow sending raw MAVLink messages.

As the developer mentioned, mavlink-swift is outdated and does not support all the features available in the C++ implementation.

I decided to build MAVLink from scratch, and I have already done so, but it only exports mavsdk_server, which is essentially a basic gRPC language wrapper server.

To use MAVLink in Xcode, I generated Objective-C files using the command below. Now, I have mavsdk_server.xcframework along with Objective-C headers and .mm files. However, I am encountering a "mavlink.h" does not exist error.

python -m pymavlink.tools.mavgen --lang=Cpp --wire-protocol=2.0 --output=generated/include/mavlink/v2.0 message_definitions/v1.0/common.xml

Upon inspecting the Objective-C file output, I noticed that one of the files is trying to import mavlink.h, but the file does not exist. Can anyone help me figure out what I’m missing? I really want to run MAVLink on my iOS device and send raw messages through it.

Hamish Willee

unread,
Feb 11, 2025, 7:05:22 PMFeb 11
to MAVLink
Hi 

That command looks like it would output C++ files, not objective C (basd on the Lang).  Can you confirm exactly what you built?

Contributions very welcome! Swift is under-loved. We'd certainly be interested in updates to bring it to parity with the C and Python, which are the best-supported mavgen libraries. 
IF you have specific issues, can you please repost in https://github.com/ArduPilot/pymavlink and then add a link here. That will make this easier to share with more people.

Regards
Hamish

Reply all
Reply to author
Forward
0 new messages