17275 Commits

Author SHA1 Message Date
Daniel Agar
9dfd82ab06 ekf2: optical flow remove _flow_data_ready flag 2024-07-09 10:10:01 -04:00
Daniel Agar
7047f9441c ekf2: fix calcOptFlowBodyRateComp() gyro bias
- adjust flow sample gyro_rate immediately after popping from ring
   buffer
 - always update flow gyro bias (calcOptFlowBodyRateComp()) regardless
   of flow quality or magnitude
2024-07-09 10:10:01 -04:00
Daniel Agar
4d324da9f8 ekf2: update flow aid src status every sample 2024-07-09 10:10:01 -04:00
Daniel Agar
bcd666b3f8 ekf2: fix optical flow start logic
- remove fallthrough that enables flow regardless of success
 - add appropriate start messages for each case
2024-07-09 10:10:01 -04:00
Daniel Agar
bf4e564b23 ekf2: resetTerrainToFlow() reset aid src status appropriately 2024-07-09 10:10:01 -04:00
Daniel Agar
ced609daa8 ekf2: flow fusion start require valid fusion 2024-07-09 10:10:01 -04:00
Daniel Agar
1df8f3f9d2 ekf2: resetFlowFusion() reset aid src status appropriately 2024-07-09 10:10:01 -04:00
Roman Bapst
8221940b60
Added pitot tube icing detection (#23206)
* lib: add FilteredDerivative class

* AirspeedValidator: add first principle check

- filters throttle, pitch and airspeed rate, and triggers
if the airspeed rate is negative even though the vehicle
is pitching down and giving high throttle.
Check has to fail for duration defined by ASPD_FP_T_WINDOW
to trigger an airspeed failure.

* AirspeedValidator: define constants for first principle check

* FilteredDerivative: set initialised to false if sample interval is invalid

* airspeed_selector: improved comment

* increase IAS derivative filter time constant from 4 to 5

* use legacy parameter handling for FW_PSP_OFF

* handle FW_THR_MAX as well

* ROMFS/airframes: exclude some airframes for v6x and v4pro to save flash on them

---------

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
Signed-off-by: RomanBapst <bapstroman@gmail.com>
Co-authored-by: Silvan Fuhrer <silvan@auterion.com>
2024-07-09 11:16:40 +02:00
Silvan Fuhrer
77709c2948 FW Position control: clean up param descriptions
Mostly to save flash, but also to improve generally.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-07-08 16:44:09 +02:00
Claudio Chies
aed0fd41cf
SIH - change how LAT and LON is used for Takeoff location (#23363)
change how lat long is used for SIH
2024-07-08 14:51:08 +02:00
Marco Hauswirth
4bc0286eb8
fix error from refactring commit, fix reset on ground (#23370) 2024-07-08 13:55:05 +02:00
Marco Hauswirth
e04c53241a
EKF2: reset position by fusion (#23279)
* reset position by fusion

* handle local_pos_valid for fixed wing in gnss denied

* [WIP] ekf2: setEkfGlobalOrigin respect current height reference and vertical position aiding

* global origin, also reset vertical pos without gps as ref

* fix wo gnss, that bitcraze ci passes

* revert some changes as requested

* remove duplicate reset messages

* undo unrelated whitespace changes, I'll fix it everywhere in a followup

* [SQUASH] ekf2: add vehicle_command_ack

* resetGlobalPosToExternalObservation consolidate logic

* remove gnss check from local_pos validation check

* reset when  0<accuracy<1, otherwise fuse

* replace gps param with flag

* ekf2: dead reckon time exceeded, respect ZUPT preflight if air data or optical flow expected

* subtract timeout from last inertial dead-reck, change fake pos conditions, save flash

---------

Co-authored-by: Daniel Agar <daniel@agar.ca>
2024-07-07 22:43:55 +02:00
Marco Hauswirth
a1f43636f3
ekf2: EV fusion in body frame (#23191) 2024-07-04 21:17:19 -04:00
Silvan Fuhrer
33701aa3d5 BatteryStatus: remove voltage_filtered_a
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-07-03 16:41:49 +02:00
Silvan Fuhrer
c2ae6a7e24 BatteryStatus: remove current_filtered_a
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-07-03 16:41:49 +02:00
zhangteng0526
e03e0261a1 Fix buffer overflow in mavlink_receive.cpp 2024-07-03 08:11:32 +02:00
chfriedrich98
f65653a391 battery: add internal resistance estimation 2024-07-02 19:05:13 +02:00
Marco Hauswirth
3880073716
ekf2: fix timeout after gps failure (#23346) 2024-07-02 10:38:49 -04:00
Daniel Agar
0742d356f5
ekf2: more conservative clipping checks for bad_acc_clipping fault status (#23337)
- track accel clipping count per axis
 - only set bad_acc_clipping fault_status if at least one axis is
   clipping continuously or if all have been clipping at warning level
 - Note: this doesn't impact the clipping projections that boost the
   accel process noise, pause bias estimation, and skip gravity fusion
   on a per sample basis
2024-06-28 16:45:08 -04:00
Matthias Grob
e4446adba1 Add check for high RAM usage
We had a case where someone took off with an experimental
system with 100% RAM usage on the embedded system
without noticing. This lead to problems during flight.

Since we already have a CPU load check it seems natural
to also check the reported RAM usage.
2024-06-27 11:20:22 +02:00
Daniel Agar
30b854da35
ekf2: verbose logging control (new EKF2_LOG_VERBOSE)
- new parameter EKF2_LOG_VERBOSE to enable (currently enabled by default)
 - force advertise topics immediately (based on EKF2_LOG_VERBOSE and per aid source configuration)
 - logger optionally log all estimator topics at minimal rate
2024-06-27 01:10:57 -04:00
Patrik Dominik Pordi
8070c70f2c
uxrce_dds_client: dds_topics.yaml add vehicle_land_detected
- px4_msgs::msg::VehicleLandDetected has been added to dds_topics.yaml
2024-06-27 01:10:04 -04:00
Daniel Agar
78fd9a15f8 flight_mode_manager: delete unused avoidance waypoint 2024-06-27 01:08:16 -04:00
Daniel Agar
338bcc6ca3 ekf2: disable EKF2_EV_CTRL and EKF2_AGP_CTRL by default 2024-06-26 17:10:28 -04:00
Silvan Fuhrer
1ae96d6509 EKF2: fix builds without CONFIG_EKF2_RANGE_FINDER
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-06-26 11:05:38 +02:00
bresch
a50ef2eb5e ekf2-terrain: make terrain validity based on uncertainty
When using optical flow for terrain aiding, we cannot assume that the
terrain estimate is valid if flow is fused as is can only be observed
during motion. When no direct observation is available, the terrain is
assumed to be valid if its 1sigma uncertainty is < 10% of the hagl.
2024-06-26 11:05:38 +02:00
bresch
a665764b0e ekf2: remove unused EKF2_TERR_MASK 2024-06-26 11:05:38 +02:00
bresch
7903ddf5df ekf2-terrain: terrain is not a separate estimator 2024-06-26 11:05:38 +02:00
bresch
9001c23926 ekf2: clean up hagl vs terrain naming
Terrain is the state: terrain vertical position
Hagl (height above ground level) is the vertical distance between the
vertical position and the terrain vertical position
2024-06-26 11:05:38 +02:00
bresch
68980b59e2 ekf2: add terrain state 2024-06-26 11:05:38 +02:00
KonradRudin
09f066a73a
mission: skip a vtol takoff mission item if already in air (#23319)
* mission: skip a vtol takoff mission item if already in air and a fixed wing

* MissionBase: also skip FW takeoff when already in-air

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

* mission: use setNextMissionItem to skip vtol takeoff when already in air

* mission: Only skip the VTOL takeoff in air for mission and rtl mission

If flying RTL mission reverse it must still include the takeoff point.

---------

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
Co-authored-by: Silvan Fuhrer <silvan@auterion.com>
2024-06-25 16:33:45 +02:00
Matthias Grob
8cc7c99b59
mavlink: report generator error (#23313)
Without this flag the command silently succeeds even though the logs contains
an error. It's much more developer friendly to fail early in case of an error.
The log path is then also shown in the console output.
2024-06-24 10:00:03 +02:00
Daniel Agar
30ce560e3a ekf2: mag control reset filtered test ratio on start (if aligning yaw) 2024-06-20 13:41:54 -04:00
Daniel Agar
dcb1103299 ekf2: move estimator_status test ratios to filtered values 2024-06-20 13:41:54 -04:00
fury1895
e4fc3022f2 gimbal - input_mavlink: return NoUpdate by default 2024-06-19 13:52:27 +02:00
PX4 BuildBot
38956e50ce Update submodule mavlink to latest Tue Jun 18 12:39:42 UTC 2024
- mavlink in PX4/Firmware (7d9b119283b5aff3976431bd48e4308a0bce7b56): 9e0d01df69
    - mavlink current upstream: da3223ff93
    - Changes: 9e0d01df69...da3223ff93

    da3223ff 2024-06-13 Thomas Frans - gps: add status and integrity information (#2110)
2024-06-18 11:48:00 -04:00
Daniel Agar
8b9900cce3
mc_pos_control: new velocity low pass and notch filter (optional, disabled by default)
- MPC_VEL_LP: new velocity first order low pass filter (off by default)
 - MPC_VEL_NF_FRQ/MPC_VEL_NF_BW: new velocity notch filter (off by default)
 - MPC_VELD_LP: existing velocity derivative low pass filter, but I've dropped the remaining controllib usage
2024-06-18 11:47:19 -04:00
PX4 BuildBot
ac13fb77a9 boards: update all NuttX defconfigs 2024-06-18 09:37:58 -04:00
Matthias Grob
9c83f842be
autostart scripts: Reintroduce SYS_PARAM_VER (#22813)
The case where the airframe maintainer wants to enforce a reset to airframe is
not covered anymore with the `param set-default` mechanism. For products based
on PX4 this is still required to ensure proper functionality after a major update.
2024-06-18 09:32:51 +02:00
Jonas Eschmann
54c8f9e8c9 Adding vehicle_acceleration and actuator_motors to the logged topics for system identification 2024-06-17 22:19:24 -04:00
Nuno Marques
450ae033e4 modules: mavlink: only include FUEL_STATUS stream if the dialect includes it 2024-06-17 12:58:46 -07:00
Nuno Marques
a8cb5a7715 Add fuel tank status report support
* Adds support to DroneCAN FuelTankStatus messages
* Adds fuel_tank_status uORB message
* Adds FUEL_STATUS MAVLink stream
* Adds parameter to define max fuel tank capacity
2024-06-17 12:58:46 -07:00
Nuno Marques
954225a5c0 submodules: mavlink: bring latest definitions as per Thu, Jun 6 2024 2024-06-17 12:58:46 -07:00
Daniel Agar
206488b844 ekf2: innovation sequence monitoring for all aid sources
- add new 'innovation_filtered' and 'test_ratio_filtered' fields to
   estimator_aid_source topics
2024-06-17 15:30:42 -04:00
Daniel Agar
f9160853fa rc_update: purge deprecated RC switch parameters
- these are old RC switch configuration parameters that haven't been used for
   years, but were hardcoded into old versions of QGC
 - RC_MAP_RATT_SW, RC_MAP_POSCTL_SW, RC_MAP_ACRO_SW, RC_MAP_STAB_SW, RC_MAP_MAN_SW deleted

 -
2024-06-17 12:03:13 -04:00
Silvan Fuhrer
f646f1ba98
AirspeedSelector: only update with lpos if coming from GNSS (#23268)
Compared to GNSS, alternate position observation methods are less accurate
and thus generally not good enough to do airspeed validation with.
Airspeed validation is thus disabled if no GNSS fusion is happening.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-06-14 17:10:08 +02:00
Silvan Fuhrer
f4e76cd392
remove deprecated BAT_ params (#22872)
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-06-14 14:42:32 +02:00
Roman Bapst
0ce64e1b92
ekf2: don't fuse optical flow samples when the current distance to the ground is larger than the reported maximum flow sensor distance
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2024-06-11 21:20:40 -04:00
Roman Bapst
8ad93464c7
AirspeedValidator: Remove extra delay from airspeed innovation check (#23244)
* AirspeedValidator: remove additional one second of hysteresis for triggering
innovation checks

- this check already uses an integrator and so adding more delay just makes
log analysis more difficult and does not really add any value

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* removed unnecessary conditions

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* AirspeedValidator: only disable innov checks if ASPD_FS_INTEG is negative

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

* get rid of unnecessary check on innovation threshold parameter

Signed-off-by: RomanBapst <bapstroman@gmail.com>

---------

Signed-off-by: RomanBapst <bapstroman@gmail.com>
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
Co-authored-by: Silvan Fuhrer <silvan@auterion.com>
2024-06-11 14:09:36 +02:00
Silvan Fuhrer
30b63f6a82 AirspeedSelector: set default of ASPD_FS_T_STOP to 1 and clean up meta data
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-06-10 12:42:54 +02:00