Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to query PX4 version using MAVSDK #1910

Closed
YalamareddyChaitanya opened this issue Oct 7, 2022 · 3 comments · Fixed by mavlink/MAVSDK-Proto#298 or #1918
Closed

How to query PX4 version using MAVSDK #1910

YalamareddyChaitanya opened this issue Oct 7, 2022 · 3 comments · Fixed by mavlink/MAVSDK-Proto#298 or #1918

Comments

@YalamareddyChaitanya
Copy link
Contributor

I have used MAVSDK Info plugin to query PX4 version that I am using. Info plugin gives PX4 version 1.13.0, But the exact version of PX4 is 1.13.0beta. Is there any another way to query the exact version of PX4?

@julianoes
Copy link
Collaborator

Is the information you need not in this struct somewhere?
https://github.com/mavlink/MAVSDK/blob/main/src/mavsdk/plugins/info/include/plugins/info/info.h#L136-L148

@YalamareddyChaitanya
Copy link
Contributor Author

@julianoes Yes, It has some information. But If git tag of PX4 firmware is v1.13.0-beta*, Info plugin gives version data until v1.13.0 without beta as flight_sw_patch version in Version struct is an Int. I could use git hash instead of tag. Some how Qgroundcontrol managed to query the PX4 version including beta using Additional version type.

Screenshot from 2022-10-10 11-34-10

@julianoes
Copy link
Collaborator

I guess the information should be somewhere and we need to decode it correctly in mavsdk.

https://github.com/PX4/PX4-Autopilot/blob/ce609144b0b8058cf4d05dac691c36c4f0a4ffd0/src/lib/version/version.c#L48-L59

_version.flight_sw_major = (autopilot_version.flight_sw_version >> (8 * 3)) & 0xFF;
_version.flight_sw_minor = (autopilot_version.flight_sw_version >> (8 * 2)) & 0xFF;
_version.flight_sw_patch = (autopilot_version.flight_sw_version >> (8 * 1)) & 0xFF;

Maybe this information is enough for you to figure it out and make a pull request? I'm pretty busy at the moment and can't look into it in detail I'm afraid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants