Which version of MavLink to use?

Hi,

I’m new to the PX4 software stack, though I’ve been seen people around using it for a long time. I’m still trying to get myself familiar with the code base and the first thing I find confusing is the version of MavLink. I saw some discussions on the new MavLink 2 and it seems to include a lot of improvements over version 1. But on the other hand, I find the version 1 is used almost everywhere. So my questions are: what’s the roadmap for MavLink? which version should I look at and use? where MavLink 2 is currently used in the px4 ecosystem?

Thanks.
rdu

It’s still (mostly) the same message set. Unless you have a particular need for mavlink 2 over 1 you can use either. If you’re using it within PX4 or QGC you can generate both v1 and v2 headers from the same message definitions and use either.

Thanks for your reply. By default both PX4 and QGC are using v1, right? I’m not familiar with the code base enough to know any particular needs for v2 yet. So probably I should just stick with v1. But I’m curious what’s the role that v2 is currently playing if v1 is still mostly used?

They use both (one or the other), and can auto negotiate the version. Think of v2 as an extension of v1.
You’ll likely be fine with v1 and it’ll be easy to switch to v2 later on if you need to by only changing how you call the mavlink generator.

Got it. Thanks again.