PX4FirmwarePlugin: use correct unset param1#14605
Conversation
|
Testing pending Qt download... |
|
PX4 SITL tested. |
Build ResultsPlatform Status
All builds passed. Pre-commit
Pre-commit hooks: 0 passed, 0 failed, 0 skipped. Test Resultslinux-coverage-integration: 27 passed, 0 skipped Code Coverage
Artifact Sizes
Updated: 2026-07-15 03:48:42 UTC • Commit: 6637cbc • Triggered by: Linux |
NAV_TAKEOFF param1 allows to set the minimum pitch. Generally, when not setting a param it should be set to NAN or 0. The sentinel value -1 is not in the spec. Note that this value is not used in PX4 anyway. Also, unused param2 can be NAN instead of 0 which is generally preferred.
|
@hamishwillee Mavlink spec says nothing about how to deal with not passing various MAV_CMD_NAV_TAKEOFF params. Is there really a spec that says NAN is always not used. If so, I believe ardupilot tends to puke on NAN in various commands. @julianoes Is this fact in px4 firmware side version agnostic? Not something that change somewhere along the way? |
It used to but that's mostly fixed up by now. In this case that doesn't matter as this is the PX4 plugin. We started rejecting invalid commands on the PX4 side which triggered QGC takeoff to fail. So obviously we had to revert the strict check on the PX4 side. However, instead of just ignoring that QGC sends something non-compliant, I opted to fix it. |
Description
NAV_TAKEOFF param1 allows to set the minimum pitch. Generally, when not setting a param it should be set to NAN or 0. The sentinel value -1 is not in the spec.
Note that this value is not used in PX4 anyway.
Also, unused param2 can be NAN instead of 0 which is generally preferred.
Type of Change
Testing
Platforms Tested
Flight Stacks Tested
Screenshots
Checklist
Related Issues
PX4/PX4-Autopilot#27899
By submitting this pull request, I confirm that my contribution is made under the terms of the project's dual license (Apache 2.0 and GPL v3).