mavlink / MAVSDK

API and library for MAVLink compatible systems written in C++17
https://mavsdk.mavlink.io
BSD 3-Clause "New" or "Revised" License
634 stars 509 forks source link

MAVlink Forwarding - System not detected #1572

Open evanatherton1 opened 3 years ago

evanatherton1 commented 3 years ago

I am currently trying to forward MAVlink messages from QGroundControl to a Raspberry Pi. I'm using MAVSDK to listen to a specific UDP port:

ConnectionResult conn_result = mavsdk.add_any_connection("udp://:14445");

The program doesn't seem to recognize the vehicle. Specifically, mavsdk.systems().size() always equals 0. In QGC, I enabled mavlink forwarding and specified the IP address of the pi and UDP port. Both devices are able to ping each other. Has anybody encountered this issue?

julianoes commented 3 years ago

By the way, you can also forward using MAVSDKS by adding the argument with the ForwardingOption. https://mavsdk.mavlink.io/main/en/cpp/api_reference/classmavsdk_1_1_mavsdk.html#classmavsdk_1_1_mavsdk_1aa43dfb00d5118d26ae5aabd0f9ba56b2

I enabled mavlink forwarding and specified the IP address of the pi and UDP port.

So, you set it to e.g. 192.168.1.42:14445? That all seems like it's correct. I can recommend using Wireshark to check if the packages are forwarded correctly.

evanatherton1 commented 3 years ago

I went ahead and downloaded QGC v4.0.11, and MAVlink forwarding doesn't seem to be available. Is that something that was removed in later versions? If I want to use forwarding on MAVSDK, how do I specify a UDP port in QGC?

julianoes commented 3 years ago

v4.0.11,

That sounds older. Why not the latest?

how do I specify a UDP port in QGC?

Application Settings -> Comm Links -> Add UDP connection