MAVSDK Server

I’m developing a drone platform for surveillance and am encountering issues with my software setup using MAVSDK as a ground control station. I based my work on the rtk-sender-example from github, adding to it telemetry subscriptions and mission controls with multiple threads and async operations and also web page integration for control. However, this setup often leads to segmentation faults in c++.

To mitigate this, I want to organize my project into multiple scripts. However, I’m facing difficulties because I’m using a serial port, which cannot be accessed from different scripts simultaneously.

I seek advice on structuring MAVSDK as a server that connects to the drone, allowing other scripts to handle specific tasks, like reading battery status or sending mission commands, to create more organized, scalable, and reusable code.

My hunch is that this needs to be fixed, not worked around! If you get segfaults, make sure to get a stack trace and post an issue on github.com/mavlink/MAVSDK/issues.

If there are problems causing segfaults in MAVSDK, I absolutely want to fix them! (Also, are you on the latest version?)

Now, that being said, if you insist on splitting it up, there are two ways of “forwarding” MAVLink traffic.

  1. Split the traffic up before it goes to MAVSDK. You can use any of the tools here, e.g. mavlink-router, mavp2p, or even MAVSDK forwarding.

  2. Forward from one MAVSDK instance to another using a second connection and enabling forwarding, see docs.

1 Like