380 Commits

Author SHA1 Message Date
Matthias Grob
f912ee2c8b Commander: send out parachute MAVLink command when kill switch engaged 2021-11-19 17:15:04 +01:00
Matthias Grob
3193b554ca Add optional preflight check for healthy MAVLink parachute system 2021-11-19 17:15:04 +01:00
Matthias Grob
43c529f294 Add MAVLink parachute system heartbeat detection 2021-11-19 17:15:04 +01:00
Matthias Grob
4c6621f6cf Commander: Allow arming a rover with the throttle stick in the middle 2021-11-19 10:10:32 +01:00
RomanBapst
439400f76e commander: don't ack gimbal commands
- this leads to an unnecessary amount of acks which can in turn overflow
the orb queue

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-11-13 11:59:28 -05:00
kevindsp
17ad7071c3 fix the quaternion normalization issue
Be course of the numerical computing error . The normalization of the quaternion can't always equal to 1 precisely. It could occasionally trigger the error"attitude estimate no longer valid". So enlarge the threshold to 1e-6f. That keeps it silence.
2021-11-12 16:31:40 +01:00
Matthias Grob
fabf865411 Use backwards compatible manual_control_setpoint instead of manual_control_input 2021-11-09 16:05:25 +01:00
Matthias Grob
7e4a079e09 Commander: report when RC selected mode is not available 2021-11-09 16:05:25 +01:00
Matthias Grob
a593a51f05 Commander: fix mode initialization with RC 2021-11-09 16:05:25 +01:00
Matthias Grob
38ab7e6ab9 Commander: separate function for action request execution 2021-11-09 16:05:25 +01:00
Matthias Grob
0a02d8e774 Commander: handle denying disarm when not landed centrally 2021-11-09 16:05:25 +01:00
Matthias Grob
dcd26bd2b8 Commander: fix "Manual control lost" showing double in QGC
because of the missing tab in the deprecated message.
2021-11-09 16:05:25 +01:00
Matthias Grob
956997eb1e Replace arm_request and mode_request with combined action_request
Which saves flash space, log size and is extensible to handle e.g.
the VTOL transition and future actions.
2021-11-09 16:05:25 +01:00
Matthias Grob
052e29267d Use mode_request for RC mode switching 2021-11-09 16:05:25 +01:00
Matthias Grob
f8e4846851 Use arm_request for manual killing 2021-11-09 16:05:25 +01:00
Matthias Grob
af607e3040 Use separate arm_request instead of vehicle_command for RC arming 2021-11-09 16:05:25 +01:00
Matthias Grob
7a2ef4a917 Commander: don't publish RC_IN_MODE to vehicle_status
This just contains the content of the parameter which
is redundant and results in multiple sources of truth.
2021-11-09 16:05:25 +01:00
Matthias Grob
4dc165efd0 Commander: don't retry to reach the desired_main_state if we reached it 2021-11-09 16:05:25 +01:00
Matthias Grob
d48302c841 Commander: send out manual control lost event 2021-11-09 16:05:25 +01:00
Matthias Grob
93bed7f670 vehicle_command: shorten arming action/origin enum names 2021-11-09 16:05:25 +01:00
Julian Oes
b3a5072de5 commander/manual_control: use msg enum for params
Instead of using a private enum class we should define the enum in the
vehicle_command message and then use it consistently.
2021-11-09 16:05:25 +01:00
Julian Oes
f1b1068824 commander: remove unused mode/main_state methods
With the previous changes these seem no longer required.
2021-11-09 16:05:25 +01:00
Julian Oes
53bd254502 commander: add valid check
Better checking once too much than once too little.
2021-11-09 16:05:25 +01:00
Julian Oes
93c505b163 commander: force arming is not an option from RC 2021-11-09 16:05:25 +01:00
Julian Oes
6a6b8d49fc msg: re-use manual_control_input in setpoint
This way we avoid duplication between manual_control_input and
manual_control_setpoint.
2021-11-09 16:05:25 +01:00
Julian Oes
5ae76bdc17 commander: fix potentially wrong user message 2021-11-09 16:05:25 +01:00
Julian Oes
bd0c1014d9 manual_control: support arming button
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.
2021-11-09 16:05:25 +01:00
Julian Oes
2e9edfcd89 commander: only override according to param
This got lost in the refactor earlier.
2021-11-09 16:05:25 +01:00
Julian Oes
97d01f200e commander: move manual_control and switches out
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.
2021-11-09 16:05:25 +01:00
Julian Oes
e49b596edc commander: add desired main state
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.
2021-11-09 16:05:25 +01:00
Julian Oes
b6af068f25 commander: always reset posvel validity
I assume reseting posvel validity is ok for any case, not just all cases
except manual, acro, stabilized.
2021-11-09 16:05:25 +01:00
Julian Oes
52563264e6 commander: move valid mission check inside
I think it makes more sense to move this check inside of
main_state_transition.
2021-11-09 16:05:25 +01:00
Julian Oes
a91fa7f3c1 commander: only move to POSCTL when armed
I don't think we want to switch to POSCTL when the sticks are moved when
armed.
2021-11-09 16:05:25 +01:00
Julian Oes
66b069e788 commander: move main_state_transition out
This is a first step to having a desired main state.
2021-11-09 16:05:25 +01:00
Julian Oes
97aa06cc19 commander: move switch handling to manual_control 2021-11-09 16:05:25 +01:00
Julian Oes
08e58a44e9 Fix style 2021-11-09 16:05:25 +01:00
Julian Oes
1c15cc11d8 manual_control: implement (dis)arming via command 2021-11-09 16:05:25 +01:00
JaeyoungLim
cda7c6ceaa
Enable offboard actuator setpoints 2021-11-07 15:38:42 -05:00
bresch
1e94512719 FD: use flags union instead of bitmask 2021-11-05 09:45:52 -04:00
bresch
3f1025fb1e FD: add dedicated topic to log more internal states
log imbalanced propeller check metric

add failure_detector_status message
2021-11-05 09:45:52 -04:00
bresch
b8ed457371 Commander: trigger failsafe action if imbalanced propeller detected 2021-11-05 09:45:52 -04:00
Silvan Fuhrer
f02786d112 Navigator/Commander: make GPS failsafe consitent: switch to Descend also for FW and VTOL
- 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>
2021-11-05 12:09:39 +03:00
Thomas Debrunner
32be88404a
commander: Only run estimator navigation checks when armed 2021-10-28 12:06:31 -04:00
RomanBapst
d84b0296d2 support orbit command in fixed wing mode
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>
2021-10-25 09:48:27 +02:00
Beat Küng
ad1bcfd77c commander: correct lockdown CLI description 2021-10-18 18:45:19 -04:00
Daniel Agar
d35cf78e4a commander: PX4_ERR if attitude or angular velocity become invalid 2021-10-14 09:17:50 -04:00
Jukka Laitinen
5509235517 commander: Fix implicit NaN conversion from double to float compiler warning
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2021-10-13 15:01:26 -04:00
Silvan Fuhrer
eeb6244c6b Commander: add wind speed warning
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>
2021-10-06 11:31:13 -04:00
Julian Oes
6b8840a01b commander: fix switch to ALTCTL when RC regained
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.
2021-10-06 10:30:08 +02:00
Daniel Agar
6d78054f50
mavlink USB auto start/stop on boards with VBUS
- 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
2021-10-03 15:32:54 -04:00