code was checking for an updated MissionResult twice in a row, leading to _mission_state
not being set correctly when the second check had no new message.
Switched to SubscriptionData to safely retrieve the latest message using .get().
According to the mavlink spec we should be publishing the home attitude
as a quaternion rather than just the yaw/heading.
Additionally, this allows setting the landing roll and pitch angle using
DO_SET_HOME (this yet needs to go into the MAVLink spec though).
The define is used in dataman, not navigator, so this config variable
needs to be moved to the dataman module, otherwise it breaks the build
if navigator is not included in the build.
When a mission finishes with an RTL command, there's a race condition
between:
1. RTL command setting user_mode_intention RTL
2. Mission completion logic forcing LOITER
The auto-loiter transition was checking current nav_state (which is
still AUTO_MISSION) instead of any pending user_mode_intention,
causing it to override the RTL request.
Fix: Only auto-transition to loiter if no mode change is already
pending.
There was a race condition when closing the shell:
- the main thread checks if _mavlink_shell is not nullptr (which is true)
- the receiver thread closes the shell, which clears _mavlink_shell
- the main thread continues with _mavlink_shell->available()
Within the first 2min of a flight, check if the integrated GNSS vertical velocity and the baro
measurements disagree with the reported GNSS altitude, and in that case update the
set home position altitude to cancel out GNSS altitude drift.
* prevent re-init when reaching negative altitudes
* only allow correction during the first 120 second after takeoff
* add dependency to COM_HOME_EN parameter. reset vel-integral for multiple takeoffs
I'm starting the separate battery info message because no char[32] should be published and logged
at high rate and we need a separate battery info message for static information as discussed.
Replaced the local variable landed_amid_mission with the class member _mission_in_progress for consistency and to reduce redundancy.
No functional change.
This makes sure that there is no weird line following logic executed
by the flight task when the vehicle should just come down vertical
for landing.
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
6.5 is a relatively high value that was used mostly on smaller, low inertia vehicles ~250-500mm diagonal. There it works great but on larger, higher intertia vehicles this leads to problems.
After f0b05ea7cfd9de4113f4cd63e8068cf8089bc158
the control allocator only has a callback on the torque setpoint and even though this should work
I'm paranoid and would like to avoid surprises by always publishing the thrust before torque
then the samples that were published together are also allocated together.