25467 Commits

Author SHA1 Message Date
Matthias Grob
fbe5024fa8 commander_params: remove deprecated COM_RCL_ACT_T
It's now covered with COM_FAIL_ACT_T
2022-11-16 08:11:09 +01:00
Daniel Agar
da82757bf6
ekf2: accumulate multiple vel/pos/orientation reset deltas per update
- if in a single EKF update there are multiple resets we need to track the accumulated delta so the change consumed by the controllers is correct
2022-11-15 13:20:54 -05:00
alexklimaj
2e918eba00 Revert "Update MAVLink so common includes standard (#20542)"
This reverts commit 0e2b1ee9798fc2662dbfdaca68a5a8ae9997b28d.
2022-11-15 13:09:56 -05:00
bresch
22420a7bf1 ekf2: do not fuse ZVU if other velocity source is active 2022-11-15 11:17:07 -05:00
bresch
c67f03f383 ekf2: update change indicator 2022-11-14 11:51:32 -05:00
bresch
f319cc528b ekf2: remove old flow fusion generated code 2022-11-14 11:51:32 -05:00
bresch
2a83dbf81d ekf2_test: compare flow fusion sympy vs symforce 2022-11-14 11:51:32 -05:00
bresch
93564baccf ekf2_flow: recalculate innovation after fusing 1st axis
The state changed so we need to recalculate the innovation of the 2nd
axis after fusing the 1st one
2022-11-14 11:51:32 -05:00
bresch
4dbdf23346 ekf2: update _R_to_earth when the state quat changed through fusion 2022-11-14 11:51:32 -05:00
bresch
28458340e6 ekf2_flow: check innov variance health after fusing 1st axis 2022-11-14 11:51:32 -05:00
bresch
73a8c388e8 ekf2: fuse by looping through axes 2022-11-14 11:51:32 -05:00
bresch
b54a4417fa ekf2: migrate flow fusion to SymForce 2022-11-14 11:51:32 -05:00
Daniel Agar
639d1ddca2
ekf2: update flags (in_air, at_rest, etc) on delayed time horizon (#20576)
- in a lot of cases this won't really matter, although you can see it in logs (especially with things like vehicle_at_rest), but it's something we might as well do properly

Co-authored-by: Mathieu Bresciani <brescianimathieu@gmail.com>
2022-11-14 11:35:40 -05:00
Beat Küng
b0e1cc72f7 fix orbit for mc: handle VEHICLE_CMD_DO_ORBIT command and avoid race condition
Fixes a regression from 8bae4e5c0e29f70d5d1d2427ffdef97092be939c, where
the orbit flight task wasn't an extra task (flight_tasks_to_add) anymore
and therefore the command handling wasn't generated.

There was a race condition that could cause several outcomes. The most severe
was that flight_mode_manager gets the command, switches to orbit and then
in the next iteration switches back because commander did not change
nav_state yet. When commander then switches, flight_mode_manager would still
be in the old mode.
This is prevented by storing the command (allowing it to arrive before or
after mode switch), and then apply it after the switch happens.
2022-11-14 17:31:35 +01:00
Beat Küng
c1f9824396 flight_mode_manager: remove command ack for VEHICLE_CMD_DO_ORBIT
Already acked in commander
2022-11-14 17:31:35 +01:00
Daniel Agar
9e7db0ed54
merge vehicle_angular_acceleration into vehicle_angular_velocity (#20531)
- vehicle_angular_velocity and vehicle_angular_acceleration are produced together from the same input data, consumed together, and share the the same metadata (timestamps)
 - individually these topics each have 16 bytes of metadata (2 timestamps) for 12 bytes of data (x,y,z float32)
2022-11-14 11:03:59 -05:00
bresch
7d1f1d0f84 ekf2: replace macro constants by typed constexpr 2022-11-14 10:45:23 -05:00
bresch
06702da003 ekf2: add GNSS yaw max interval
yaw data usually comes at lower rate than vel/pos
2022-11-14 10:45:23 -05:00
bresch
9834c7917b ekf2: use yaw emergency estimator more aggressively
During the whole flight, if the difference between the yaw estimate from
EKF2 and the emergency estimator is large and that the GNSS velocity
fusion is failing continuously, immediately reset to the emergency yaw
estimate.
2022-11-14 10:45:23 -05:00
GaspardBesacier
dfced1fe46
VTOL: Smarter pusher ramp up during front transtitions for standard VTOLs (#20394)
New param VT_PSHER_SLEW for ramping up throttle of pusher during front/back transition, that replaces the old VT_PSHER_RMP_DT param.
2022-11-14 16:32:51 +01:00
Silvan Fuhrer
f5ecd1106f VTOL: some parater meta data fixes/improvements
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-14 16:25:46 +01:00
Silvan Fuhrer
c04a67401e Remove some @decimal and @increment from integer parameters
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-14 16:25:46 +01:00
Silvan Fuhrer
a018debd37 FW Position controller: fix some parameter meta data
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-14 16:25:46 +01:00
Silvan Fuhrer
0d7a029bfc FW Attitude controller params: fix meta data for Acro rates
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-14 16:25:46 +01:00
Matthias Grob
30d74f124d commander_params: make disarm timeouts more explicit decimals
of 100ms increment
2022-11-14 16:25:46 +01:00
Silvan Fuhrer
464a7fcbed Commander params: add @decimal to COM_SPOOLUP_TIME
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-14 16:25:46 +01:00
Daniel Agar
bd5bc9d207
ekf2: cleanup terrain estimator init (shouldn't be valid by default)
- with Ekf::initialiseFilter() resetting _time_last_hagl_fuse the terrain estimate was technically valid regardless of any range or flow data availability and as a result optical flow fusion is able to start and stay active
 - only consider terrain estimate valid based on control status flags and recent fusion
2022-11-14 09:29:46 -05:00
Michael Schaeuble
d7fde289de Use gimbal attitude for the camera feedback when available
The CameraFeedback module used only the vehicle attitude for the camera orientation so far. With this change, the gimbal_device_attitude_status is used to compute the global camera orientation when a gimbal is used.
2022-11-14 09:26:14 -05:00
Beat Küng
640f9cc801 commander: fix initialization order of _failsafe_flags
In this case it did not cause any problems.
Fixes a compiler warning:
/src/modules/commander/HealthAndArmingChecks/HealthAndArmingChecks.cpp:39:21: error: member ‘HealthAndArmingChecks::_failsafe_flags’ is used uninitialized [-Werror=uninitialized]
   39 |           _reporter(_failsafe_flags)
      |                     ^~~~~~~~~~~~~~~
2022-11-14 11:27:23 +01:00
Paul Erik Frivold
8e5efb0131
simulator_mavlink: Add basic vio failure injection (#20577)
* simulator_mavlink: Add basic vio failure injection

Signed-off-by: Paul Frivold <paul@kefrobotics.com>

* simulator_mavlink: Rm failure not supported warning

Failures commands are also handled in other files,
so warning here could be confusing.

Signed-off-by: Paul Frivold <paul@kefrobotics.com>

Signed-off-by: Paul Frivold <paul@kefrobotics.com>
2022-11-14 13:36:23 +13:00
Igor Mišić
acd8f20a85 systemcmds/ver: remove duplicate header 2022-11-11 07:21:04 +01:00
batinkov
241bcc863b Decimal added for the CAL_ACC[012]* parameters 2022-11-11 07:10:55 +01:00
Zachary Lowell
b6ab7f159f
Qurt MUORB Communication (#20584) 2022-11-10 11:10:18 -08:00
Thomas Stastny
6b9d86680b commander: fix hold after mission logic
previous change in logic to hold after mission clear also broke rtl, as non-mission takeoff still published a mission result which allowed entering the mission finished condition and always changing state to loiter (ignoring rtl). new logic only switches navigation states if mission is finish and the nav state is explicitly in takeoff state, or in mission state
2022-11-10 16:17:18 +01:00
Thomas Stastny
6dad3a5150 commander: hold after mission clear 2022-11-10 12:08:05 +01:00
Matthias Grob
a38bdcfc9d MulticopterPositionControl: fix amending existing idle setpoint from before takeoff
once the rampup starts. The rampup requires a valid vertical velocity setpoint.
The corner case is:
- We are before takeoff and amending the setpoint to be 0,0,100 acceleration
in order to idle
- The rampup starts BUT the setpoint is not yet overwritten by the trajectory
setpoint topic
- The idle setpoint gets amended to not contain a feed-forward vertical
acceleration because the rampup is velocity based
- The result is a brief invalid 0,0,NAN acceleration setpoint
- That invalid setpoint gets overridden by a failsafe that holds zero velocity
- Zero velocity leads to applying ~hover thrust briefly
2022-11-09 17:13:22 +01:00
Daniel Agar
84d1435880 ekf2: ensure minimum output buffer sizing
- buffer at least 2 samples for the IMU output predictor buffers
 - dropping below 2 becomes problematic for the minimum observation
interval calculation and the vertical output buffer trapezoidal
integration
2022-11-09 09:49:35 -05:00
Damien SIX
9246d38667
commander: fix offboard disarm failsafe 2022-11-09 08:20:45 +01:00
Daniel Mesham
1e39c4828f Check for OA interface failures only after it has been activated
The OA interface is 'activated' when it receives the first trajectory message.
2022-11-08 23:20:16 -05:00
Basti
e721d8dd8f Split timeout check on avoidance input.
This split is necessary if the input from the mission computer might
switch from waypoints to bezier points. Otherwise
stays true.
2022-11-08 23:20:16 -05:00
Matthias Grob
c85d4fdb1c MulticopterLandDetector: refactor maybe_landed condition
removing all early returns
2022-11-08 22:50:19 -05:00
Hamish Willee
0e2b1ee979
Update MAVLink so common includes standard (#20542) 2022-11-09 09:24:24 +11:00
Daniel Agar
5239993c88 ekf2: move EV vel to new state machine, introduce EKF2_EV_CTRL param 2022-11-08 11:46:41 -05:00
Daniel Agar
688dae1108 ekf2: add new EKF2_EV_QMIN parameter 2022-11-08 11:46:41 -05:00
Damien SIX
5910f8982a fix warning (mavlink): connection to gcs 2022-11-08 13:02:23 +01:00
Chris Seto
6df2b68d72 Clean msp_osd help string and debug message 2022-11-07 21:05:17 -05:00
Matthias Grob
f1b6f22bac AngularVelocityController: set timestamps on line before publishing 2022-11-07 21:04:25 -05:00
Matthias Grob
ae606488bd MulticopterRateControl: set timestamp last before publishing torque and thrust setpoints 2022-11-07 21:04:25 -05:00
Daniel Agar
4190353192
vehicle_magnetometer: fix standalone mag bias est factored into in flight mag cal
- preflight mag bias estimate is in the vehicle body frame and removed from the raw mag data after it's rotated, calibrated, etc
 - in flight mag bias (from ekf2) is in the vehicle body frame, but stored as a sensor frame offset immediately
2022-11-07 09:31:17 -05:00
JaeyoungLim
a9542baf3c
Enable motor controls for tailsitter VTOLs in fixed wing mode (enable Quad Tailsitters) (#20511)
* Enable motor controls for fixed wing mode in tailsitters

This commit enable motor controls in fixed wing mode for tailsitters

This is needed for enabling quad tailsitters

* VTOL: differential thrust in FW: adapt params to be generic for all axes

Until now only suppoted on yaw axis. Not to be supported also on Roll and Pitch.

- VT_FW_DIFTHR_EN: make bitmask for all three axes independently. First bit is Yaw,
sucht that existing meaning of VT_FW_DIFTHR_EN doesn't change.
- VT_FW_DIFTHR_SC: rename to VT_FW_DIFTHR_S_Y and add same params for roll (_R) and
pitch (_P).

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>

* Integrate differential control bits to three axis control

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-07 15:29:14 +01:00