13494 Commits

Author SHA1 Message Date
Daniel Agar
88f8da27ef
save learned mag bias per sensor (Multi-EKF support)
- handle saving the mag bias per sensor (across all estimator instances using that mag) in sensors/vehicle_magnetometer
 - this is now saving back to the actual mag calibration CAL_MAGn_OFF{X,Y,Z}
 - ekf2 reset mag mag bias on any magnetometer or calibration change
 - use Kalman filter scheme to update stored mag bias parameters using all available bias estimates for that sensor

Co-authored-by: Paul Riseborough <gncsolns@gmail.com>
2021-01-07 09:54:13 -05:00
Matthias Grob
f435bea57c state_machine_helper: orbit failsafe just with data link loss
RC is like the comment says not required.
2021-01-07 13:31:05 +01:00
Jaeyoung-Lim
d2b0f63e1f Handle offboard mode with acceleration setpoints
The case when acceleration setpoints were being passed in offboard mode was triggering control_climbrate_mode. This prevented the vehicle from taking off, since it made the vehicle skip the rampup phase of the takeoff
This commit fixes this by handling the case properly
2021-01-06 20:38:18 +01:00
Paul Riseborough
64ed96bd95
ekf2: Correct airspeed used by EKF for calibration errors 2021-01-05 19:22:53 -05:00
Silvan Fuhrer
850d0bc588 vtol_type: remvoe const from function declaration
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-01-04 15:32:00 +01:00
RomanBapst
0871f0f52d vtol: refactor of maximum pwm value settings for main and alternate motors
- main motors are the ones which are meant to be used as propulsion in fw mode
- alternate motors are the ones usually meant to be switched off in fw mode

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-04 15:32:00 +01:00
Silvan Fuhrer
92634e7549 RTL: during climb, set NAV_CMD_WAYPOINT for RW modes, NAV_CMD_LOITER_TO_ALT for FW
Do not use LOITER_TO_ALT for rotary wing mode as it would then always climb to
at least MIS_LTRMIN_ALT, even if current clib altitude is below
(e.g. RTL immediately after take off)

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-01-04 11:58:16 +01:00
Silvan Fuhrer
0b86c11c66 FW POS: remove setting of curr_sp to LOITER if next wp invalid
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-01-04 11:58:16 +01:00
Silvan Fuhrer
55a1d090a1 RTL: use NAV_CMD_LOITER_TO_ALT for Climb state
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-01-04 11:58:16 +01:00
RomanBapst
68f27ba7b7 navigator: deactivate line following after backt-ransition and before landing
- especially when there are strong winds it's better to just go straight
to the landing point instead of trying to follow the planned path

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-04 11:58:16 +01:00
RomanBapst
b63f756745 navigator: don't execute land pattern if vtol in rotary wing mode
- if vtol and in rotary wing mode then don't execute the mission landing
because it's designed to be flow as a fixed wing
- if vtol and in rotary wing mode and mission land is available then fly directly
to landing point and don't go home!

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-04 11:58:16 +01:00
RomanBapst
6c3f413379 mission: reset work_item_type during mission inactivation
- this fixes a race condition which happens when an RTL is triggered
during the final approach of a mission landing. In that case the mission inactive
method is never called.

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-04 11:58:16 +01:00
RomanBapst
b63f202b3c various fixed for bugs encountered during testing
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-04 11:58:16 +01:00
RomanBapst
cfb3cdc82f rtl: use math namespace
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-04 11:58:16 +01:00
RomanBapst
94d3ab28ee rtl: fixed computation of return altitude when mission landing is available
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-04 11:58:16 +01:00
RomanBapst
12875f7869 mission: when land start marker present, look for loiter to altitude item
instead of using the previous waypoint as landing target
- the previous waypoint could be miles away

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-04 11:58:16 +01:00
RomanBapst
e0c394a00b mission: fixed bug in computation of landing altitude
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-04 11:58:16 +01:00
RomanBapst
a4a03e86da mission: be more intelligent about saying that we are on a mission landing
- previously the decision of being on a landing pattern was taken by just
looking at the current mission index. However, even if the current mission
index indicates a landing pattern the vehicle could be at an arbitrary location, far
from being established on the pattern.

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-04 11:58:16 +01:00
RomanBapst
29c3ce6d5d reworked RTL cone implementation
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-04 11:58:16 +01:00
RomanBapst
dad5ce1e41 rtl: set proper acceptance radius for move_to_land item
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-04 11:58:16 +01:00
RomanBapst
6ff95ae645 RTL: implement proper RTL sequence for VTOL
- descend to RTL descend altitude
- transition
- move to land waypoint
- loiter and then land

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-04 11:58:16 +01:00
RomanBapst
197a21a22e rtl: for fixed wing (also vtol) make the descend state of RTL use type
NAV_CMD_LOITER_TO_ALT

- this allows vtol to track the loiter circle during the transition instead
of trying to fly to the landing position

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-04 11:58:16 +01:00
RomanBapst
bb2826ad27 rtl: for vtol first desend down to RTL descend altitude before doing a transition
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-04 11:58:16 +01:00
RomanBapst
e81d5daa66 rtl: if very close to home then do not descend if higher than RTL_DESCEND_ALT
before reaching home

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-04 11:58:16 +01:00
Silvan Fuhrer
7c727edc3f Simple mixer: add output slew rate
This adds the option to limit the rate of change (slew rate) of an output that's mixed by a simple mixer.
To enable it, a positive number has to be added at the end (6th number) of the output scaler line of the mixer,
specifying the min rise time of this output.
E.g. O:      10000  10000      0 -10000  10000 20000 for a rise time of 2s, resp. a max slew rate of 0.5s^-1.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2021-01-04 11:32:22 +01:00
Daniel Agar
98cff94702 px4_work_queue: directly support SITL lockstep
- the purpose is to ensure that every WorkItem (and WorkItems scheduled
by WorkItems) is allowed to run to completion every step
 - per workqueue register a lockstep component whenever a work item is
added (if not already registered)
 - once the work queue is empty unregister component
2021-01-04 09:38:05 +01:00
RomanBapst
d502292d07 mission: for vtol takeoff don't use next waypoint as target during transition
- this caused the navigator to use the next waypoint (after the vtol takeoff item)
to be used as target during the transition. If the altitude of that waypoint
was much higher than the takeoff altitude then there were FOH effects
after the transition which caused the vehicle to first descend before
climbing again.

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2021-01-02 02:18:59 +01:00
Lorenz Meier
8d6239f11f PX4IO: Use DSM frame drops
These will now be reported the same as on SBUS.
2021-01-01 14:26:36 +01:00
Lorenz Meier
4237c8be25 Commander: Do not acknowledge binding
This is now done in the respective modules directly and based on implementation and execution state.
2020-12-31 13:22:52 +01:00
Lorenz Meier
a34e57a4cc Simulator: Increase stack, publication affinity
This commit increases the send thread stack size and changes the thread affinity of the lockstep clocking topic. It also improves verbosity in case error states occur.
2020-12-31 01:05:30 +01:00
Lorenz Meier
e27d80abc4 Camera feedback: Indicate success
If the feedback module is loaded then we want to provide capture feedback.
2020-12-30 23:36:47 +01:00
RomanBapst
fe2e299046 FlightModeManager: small rebase change
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2020-12-30 10:25:08 -05:00
Matthias Grob
e92795b474 Temporary logging addition to debug CI 2020-12-30 10:25:08 -05:00
Matthias Grob
fafbb687d8 FlightModeManager: fix integral reset on ground
This information could also be used for yaw and integral
resets of the lower level controllers.
2020-12-30 10:25:08 -05:00
Matthias Grob
7de288877a MulticoperPositionControl: 3rd pass get rid of zombie members 2020-12-30 10:25:08 -05:00
Matthias Grob
62ada2e2dc FlightModeManager: restore weathervane calls
I had to do an extra subscription to the vehicle attitude.
I don't know how to test this.
2020-12-30 10:25:08 -05:00
Matthias Grob
aa888223f0 FlightModeManager: fix takeoff state in stabilized mode 2020-12-30 10:25:08 -05:00
Matthias Grob
8edb06e94f FlightModeManager: make sure emergency failsafe works 2020-12-30 10:25:08 -05:00
Matthias Grob
8329208b84 FlightModeManager: fix takeoff ramp from zero 2020-12-30 10:25:08 -05:00
Matthias Grob
88c274b3cd MulticopterPositionControl: 2nd pass to move to FlightModeManager 2020-12-30 10:25:08 -05:00
Matthias Grob
f52bad87e2 mc_pos_control: separate out flight_tasks (into FlightModeManager) 2020-12-30 10:25:08 -05:00
Matthias Grob
fa7170bc4f Add FlightModeManager
to separate out setpoint generation from controllers
2020-12-30 10:25:08 -05:00
Daniel Agar
49d4cc7d5b commander: CMD_NAV_LAND/CMD_NAV_PRECLAND reply RESULT_ACCEPTED unless transition is denied 2020-12-30 12:05:41 +01:00
Daniel Agar
91f5f26618 commander: main_state_transition call trivial style fixes 2020-12-30 00:26:14 +01:00
Daniel Agar
4f62355dec
msg: new estimator_status_flags message for more accessible ekf2 status logging
- log all estimator (ekf2) flags as separate booleans in a new dedicated low rate message (only publishes at 1 Hz or immediately on any change)
 - this is a bit verbose, but it avoids the duplicate bit definitions we currently have across PX4 msgs, ecl analysis script, flight review, and many other custom tools and it's much easier for casual log review in FlightPlot, PlotJuggler, csv, etc
 - for compatibility I've left estimator_status filter_fault_flags, innovation_check_flags, and solution_status_flags in place, but they can gradually be removed as tooling is updated

Co-authored-by: Mathieu Bresciani <brescianimathieu@gmail.com>
2020-12-29 11:27:21 -05:00
Daniel Agar
adb98d5702 mavlink: move HIL_ACTUATOR_CONTROLS to separate streams header 2020-12-28 11:09:46 +01:00
Daniel Agar
3b20310e9c mavlink: move POSITION_TARGET_GLOBAL_INT to separate streams header 2020-12-28 11:09:46 +01:00
Daniel Agar
672a1c90aa mavlink: move POSITION_TARGET_LOCAL_NED to separate streams header
- position type_mask
2020-12-28 11:09:46 +01:00
Daniel Agar
6b1d02feb7 mavlink: move RC_CHANNELS to separate streams header 2020-12-28 11:09:46 +01:00
Daniel Agar
48be6962d1 mavlink: move MANUAL_CONTROL to separate streams header 2020-12-28 11:09:46 +01:00