The arming button required some refactoring in order to support to
toggle arm/disarm using the vehicle_command. Otherwise manual_control
would have to subscribe to the arming topic and we would spread out the
logic again, and risk race conditions.
This moves the remaining handling of the manual control stuff out
of commander. All communication between manual control now goes through
vehicle commands, and the landing gear topic.
This is an intermediate solution to carry forward the initial state of
the mode slot. Basically, it allows that we start up in Stabilized but
switch to POSCTL as soon we have the required GPS.
- remove GPS failsafe mode
- for VTOL: transition to hover in Descend (unless NAV_FORCE_VT is not set)
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
Signed-off-by: RomanBapst <bapstroman@gmail.com>
commander: support orbit mode for fixed wings
Signed-off-by: RomanBapst <bapstroman@gmail.com>
FwPositionControl: publish orbit status
Signed-off-by: RomanBapst <bapstroman@gmail.com>
commander:reject orbit mode while doing a vtol transition
Signed-off-by: RomanBapst <bapstroman@gmail.com>
FixedWingPositionControl: explicitly cast waypoint for Orbit status
FixedwingPositionControl: fill missing orbit_status fields
navigator_main: handle reposition/orbit corner cases
- set orbit rotation direction correctly
- send mavlink message when orbit is rejected
FixedWingPositionControl: correctly report rotation direction in orbit_status
navigator: hack to not break orbit while doing altitude changes
Signed-off-by: RomanBapst <bapstroman@gmail.com>
navigator: set cruise throttle for orbit command
Signed-off-by: RomanBapst <bapstroman@gmail.com>
Publishes periodically (max every 1 min) a warning if the current wind estimate
is above COM_WIND_WARN.
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This fixes the case where we sometimes switch to altitude control
instead of position control when RC is regained.
What happens is that we detect that the pilot wants to take over control
right when RC comes back. This means that we try to go in position
control in main_state_transition, however, we are already in position
control because we come back from the failsafe state. The result of
main_state_transition is then TRANSITION_NOT_CHANGED, and therefore we
"fall back" to altitude control even though being already in position
control would have been fine.
This fix checks the return result of main_state_transition correctly and
only reacts to TRANSITION_CHANGED and TRANSITION_DENIED but ignores
TRANSITION_NOT_CHANGED.
- no longer start sercon or mavlink usb by default
- on USB connection (VBUS) monitor serial USB at low rate and start Mavlink if there's a HEARTBEAT or nshterm on 3 consecutive carriage returns
- the mavlink USB instance is automatically stopped and serdis executed if USB is disconnected
- skipping Mavlink USB (and sercon) saves a considerable amount of memory on older boards
Using mixers on the IO side had a remote benefit of being able to
override all control surfaces with a radio remote on a fixed wing.
This ended up not being used that much and since the original design
10 years ago (2011) we have been able to convince ourselves that the
overall system stability is at a level where this marginal benefit,
which is not present on multicopters, is not worth the hazzle.
Co-authored-by: Beat Küng <beat-kueng@gmx.net>
Co-authored-by: Daniel Agar <daniel@agar.ca>
EKF2 has a grace period of 10 seconds after boot where it doesn't need
to warn the user while the sensors (especially GNSS) are still
converging.
A connection to a GCS shouldn't skip this grace period but
an arming request should.