15979 Commits

Author SHA1 Message Date
Daniel Agar
696eeb9a49
ekf2: update EV height state machine (small piece of EV overhaul)
- respect new EKF2_EV_CTRL parameter for VPOS usage
  - EV hgt rotate EV position before usage (there's often a small offset in frames)
  - EV hgt reset use proper EV velocity body frame
  - try to keep EV hgt and EV vel state machines consistent
  - small incremental piece of https://github.com/PX4/PX4-Autopilot/pull/19128
2022-12-13 13:29:18 -05:00
Daniel Agar
805ffa9d0b ekf2: push mag cal reset to delayed time horizon 2022-12-13 10:24:02 -05:00
PX4 BuildBot
8b02b6b661 Update submodule mavlink to latest Tue Dec 13 12:38:57 UTC 2022
- mavlink in PX4/Firmware (8e1e5c4faa7749f6bc16650c7452af249a7dcc3a): 0811208443
    - mavlink current upstream: 0c7792edfe
    - Changes: 0811208443...0c7792edfe

    0c7792ed 2022-12-08 olliw42 - Gimbal Device: Adding more invalid and bitmask attributes (II) (#1927)
771926e6 2022-12-07 olliw42 - gimbal manager cap flags: resolve duplication mistake
2bc32222 2022-12-07 olliw42 - add gimbal device flags to low word of gimbal manager flags (#1928)
2022-12-13 09:06:14 -05:00
Roman Bapst
257d4e473b
fixed tailsitter transitions (#20756)
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2022-12-13 10:38:38 +01:00
Eric Katzfey
e17ddcc0e5
Qurt platform custom icm42688p IMU driver (#20753)
- first version of IMU driver for the VOXL 2 platform (Qurt)
 - this is a customized version of the Invensense ICM42688P driver, it is currently in the VOXL 2 board directory
2022-12-12 22:02:23 -05:00
bresch
41abf695a8 ekf2: use more efficient covariance update computation
KSK' is faster to compute than KHP and is mathematically equivalent
2022-12-12 12:31:54 -05:00
Zachary Lowell
e4f641e9b5
Qurt qshell implementation (#20736) 2022-12-09 16:49:41 -05:00
Daniel Agar
8cf13d50a8
ekf2: EKFGSF_yaw minor cleanup (#20510)
- don't store unnecessary IMU copy in class, pass it through where required
 - remove custom pi constants
 - remove unused fields from ahrs_ekf_gsf (vel_NE, fuse_gps, accel_dt)
 - explicitly initialize everything in header
 - apply PX4 code style
 - set GPS velocity before yaw estimator update, not after
2022-12-09 13:24:00 -05:00
Daniel Agar
f3884d5835
Update world_magnetic_model to latest Fri Dec 9 11:14:09 UTC 2022
Co-authored-by: PX4 BuildBot <bot@px4.io>
2022-12-09 11:40:30 -05:00
Roman Bapst
cfb670fbb3
Refactor quadchute logic (#20704)
* moved computation of _time_since_trans_start into base class

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

* refactor quadchute logic
- move entired logic into VtolType class
- split into smaller functions

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

* Update src/modules/vtol_att_control/vtol_type.h

Co-authored-by: Silvan Fuhrer <silvan@auterion.com>

Signed-off-by: RomanBapst <bapstroman@gmail.com>
Co-authored-by: Silvan Fuhrer <silvan@auterion.com>
2022-12-08 11:56:20 +03:00
Daniel Agar
2b1d8c1d8e
mavlink switch to common dialect by default and update to latest 2022-12-07 15:46:04 -05:00
Daniel Agar
72cb4bee01
SITL gz fixes and init cleanup (#20725)
- remove broken gz version handling and remove x500-legacy
 - fix all shellcheck warnings
 - prepare for Gazebo Garden compatibility (needs more work)
2022-12-07 15:41:13 -05:00
Beniamino Pozzan
5a2e41c4e4 microdds_client: add XRCE_DDS_KEY parameter
Multiple agents can connect to the same client

For sitl builds, if the intance number is different from zero,
  XRCE_DDS_KEY is set to the instance number and
  the microdds_client is automatically started
    with namespace
      px4_"instance_number"
    and udp port 8888
If the instance number is equal to zero
  XRCE_DDS_KEY is left untouched and
  the microdds_client is automatically started
    without namespace
    and udp port 8888

Signed-off-by: Beniamino Pozzan <beniamino.pozzan@phd.unipd.it>
2022-12-07 14:36:23 -05:00
Beniamino Pozzan
a92897fb58 microdds_client: add namespace to partecipant name
The partecipant name is modified into
"client_namespace"/px4_micro_xrce_dds

For sitl builds the microdds_client is automatically started
with namespace
px4_"instance_number"
and udp port
8888+"intance_number"

Signed-off-by: Beniamino Pozzan <beniamino.pozzan@phd.unipd.it>
2022-12-07 14:36:23 -05:00
Daniel Agar
8eb2a0a3ec ekf2: delete orientation_covariances_euler()
- usage replaced with now public calcRotVecVariances()
2022-12-07 12:41:27 -05:00
Mathieu Bresciani
a187bb3b80
ekf2: predict covariance before predicting state (#20715)
* To predict the covariance, the jacobian from the previous to the current state is required.
2022-12-07 09:34:19 -05:00
Silvan Fuhrer
2b8295e30f FW Position control: switch from L1 to NPFG guidance by default
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-12-06 12:54:58 -05:00
Zachary Lowell
91acd494a3
Qurt uORB communicator fixes (#20705)
- there was an issue sending a message from slpi to apps. Seems the code was stuck in an loop and crashed when the message was sent from slpi to apps
2022-12-06 10:33:19 -05:00
Silvan Fuhrer
ac28c6b7e2
VTOL: take home_position into account for ground clearance (#20683)
* VTOL: take home_position into account for ground clearance

For approximating distance to ground in case there is no valid distance sensor
data, subtract the home position altitude from the local position altitude.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
Co-authored-by: Matthias Grob <maetugr@gmail.com>
2022-12-06 13:19:35 +01:00
bresch
8e3517fae0 DataValidator: fix unexpected failover
Instead of always starting with instance 0 (potentially an internal
mag), first take the current sensor as reference to compare the other
ones against it.
The issue is that otherwise we can end up in a
situation where a switch occurs because the currently used sensor isn't
much better than a sensor with a lower index: because the selected one
isn't much better, we cannot "fail-over" to it and get stuck on another
sensor, triggering a fail-over.
2022-12-06 08:16:23 +01:00
Thomas Stastny
c5dc1221b6 failure detector: use multiplication instead of division
Co-authored-by: Daniel Agar <daniel@agar.ca>
2022-11-30 14:51:07 -05:00
Thomas Stastny
4e8381e8cf failure detector: negative guard sqrt in std dev calc 2022-11-30 14:51:07 -05:00
Thomas Stastny
eb80e0410c failure detector: fix imbalanced prop metric time interval 2022-11-30 14:51:07 -05:00
Daniel Agar
89b81b0bd6
create Welford mean Vector with covariance and improve precision with Kahan summation (#20676)
- WelfordMeanVector now computes covariance
 - use Kahan summation for Welford mean (but continue using float32 for actual mean, etc)
 - WelfordMean and WelfordMeanVector handle initial value and count roll over
 - Welford mean count rollover at 16 bit max to prevent numerical issues and shift weight to newer samples
 - sensors/vehicle_imu: update Welford mean usage (now simplified with resets removed)
    - fix vehicle_imu_status accel var, now properly rotated with full covariance matrix
 - gyro_calibration: update Welford mean usage
2022-11-30 14:50:13 -05:00
bresch
5155346d60 ekf2: do not use gnss data when no lock 2022-11-30 08:50:34 -05:00
Jaeyoung Lim
65577a4f89 Fix invalid offboard setpoints for fw pos control
This commit fixes a regression that disables offboard control
2022-11-30 09:14:57 +01:00
bresch
5d7faefa84 ekf2: don't add invalid GNSS samples to the buffer 2022-11-30 00:22:15 -05:00
Silvan Fuhrer
0c923bda4e FW Attitude Control: fix integral resetting
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-29 18:36:15 +01:00
Matthias Grob
babe93c3bf rc_update: adapt throttle trim calibration for [-1,1]
This is fully backwards compatible: If the throttle trim is set to
the minimum then it's the legacy calibration and gets
interpreted such that there is no trim and behavior remains as before.
If the trim is set to a different value than the minimum then it gets
used like with all other channels which was unsupported before.
2022-11-28 19:25:55 +01:00
Matthias Grob
331cb21dee manual_control_setpoint: change stick axes naming
In review it was requested to have a different name for
manual_control_setpoint.z because of the adjusted range.

I started to investigate what naming is most intuitive and found
that most people recognize the stick axes as roll, pitch, yaw, throttle.
It comes at no surprise because other autopilots
and APIs seem to share this convention.

While changing the code I realized that even within the code base
the axes are usually assigned to a variable with that name or
have comments next to the assignment clarifying the axes
using these names.
2022-11-28 19:25:55 +01:00
Matthias Grob
83246c84cf Switch manual_control_setpoint.z scaling from [0,1] to [-1,1]
To be consistent with all other axes of stick input and avoid future
rescaling confusion.

Note: for the MAVLink message 69 MANUAL_CONTROL it's using the full range
according to the message specs now [-1000,1000].
2022-11-28 19:25:55 +01:00
Matthias Grob
5579e319ff mavlink_receiver: refactor forgotten manual_control_setpoint naming 2022-11-28 19:25:55 +01:00
Silvan Fuhrer
79c55614d8 FW PositionController: remove mavlink_log_pub, and only use events
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-25 18:45:36 +01:00
Silvan Fuhrer
3f773809c4 LaunchDetection: fix code style (name class members with trailing underscore)
And also align parameter handle name to real parameter name.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-25 18:45:36 +01:00
Silvan Fuhrer
1d75138659 LaunchDetector: fix counter logic
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-25 18:45:36 +01:00
Silvan Fuhrer
1400f81874 FW Pos C: rename LAUN_* param to FW_LAUN_* to be more explicit
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-25 18:45:36 +01:00
Silvan Fuhrer
5587a47471 Launch Detection: reduce user notification to info from warning
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-25 18:45:36 +01:00
Silvan Fuhrer
5a1adab6fb FW Position controller params: flaring params slight meta data adjustments
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-25 18:45:36 +01:00
Silvan Fuhrer
7fb70c55df FW Position controller: runway takeoff: track initial takeoff yaw if not in Mission Takeoff
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-25 18:45:36 +01:00
Silvan Fuhrer
1b89f26691 FW PosC: remove hack to force _landed to false if (not)launch_detected, as it is now handles in land detector
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-25 18:45:36 +01:00
Silvan Fuhrer
df1cd4f147 LaunchDetection: code style changes and fix info message.
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-25 18:45:36 +01:00
Silvan Fuhrer
e6e2c889e0 FW Position controller: rename LAUN_ALL_ON to LAUN_DECTN_ON
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-25 18:45:36 +01:00
Silvan Fuhrer
c8129fd902 Launch Detection: add briefs
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-25 18:45:36 +01:00
Silvan Fuhrer
59e5c68cb0 FW Position control: use yaw at launch detection as bearing setpoint during hand launch takeoff
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-25 18:45:36 +01:00
Silvan Fuhrer
b2f21b956c FW Position control: move LAUN_ALL_ON param to FW Positon Control main params
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-25 18:45:36 +01:00
Silvan Fuhrer
7691e3ff32 FW Land Detector: force to landed if currently landed and in launch process
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-25 18:45:36 +01:00
Silvan Fuhrer
90e1f98c57 FW Launch Detection: refactor state machine and pubish launch_detection_status message
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-25 18:45:36 +01:00
Silvan Fuhrer
35da7f9bc4 Launch Detection: consolidate in single class (use the only existing method, catapult)
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-25 18:45:36 +01:00
Silvan Fuhrer
b05878690d Launch Detector: remove LAUN_CAT_PMAX
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-25 18:45:36 +01:00
Silvan Fuhrer
5161165d85 FW land detector: expose trigger time in parameter (LNDFW_TRIG_TIME)
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-11-25 18:45:36 +01:00