17229 Commits

Author SHA1 Message Date
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
Silvan Fuhrer
5513dfa95d AirspeedSelector: define start/stop delay params as floats
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-06-10 12:42:54 +02:00
Julian Oes
0932f50d79 mavlink: enable gimbal controls in QGC over USB 2024-06-10 21:56:37 +12:00
Julian Oes
3710a9ef6e gimbal: fix auto RC and MAVLink mode
This fixes various edge cases when input is set to both: RC and
MAVLink gimbal protocol v2.

Specifically:
- We no longer immediately reset primary control if there is no update,
  otherwise this will reset immediately after an commands.
- Talking of commands: GIMBAL_MANAGER_CONFIGURE no longer switches
  control to MAVLink but only an actual incoming setpoint command does.
- And incoming setpoint command only triggers UpdatedActiveOnce which
  means we will check RC again afterwards and if there is big movement
  switch back to RC. That's the intuitive thing to do until we have
  better reporting about who/what is in control.
- Also, with RC we no longer always set us to be in control but only on
  major movement.
2024-06-10 21:56:37 +12:00
chfriedrich98
5c64a3ed93
Rover Ackermann module (#23024)
New module handling Ackermann rover guidance and control.
Only enabled in SITL and in the rover builds for now.
2024-06-07 17:15:12 +02:00
Silvan Fuhrer
831160389e VTOL Tailsitter: remove throttle spike also for quad-chute
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-06-07 16:11:59 +02:00
Silvan Fuhrer
199a2f43be VTOL Tailsitter: treat back transition abort like a front transition
for throttle blending.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-06-07 16:11:59 +02:00
Silvan Fuhrer
b5988ed38f VTOL Tailsitter: add back transition throttle blending
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-06-07 16:11:59 +02:00
Silvan Fuhrer
f119b15ff1 VTOL Tailsitter: set differential thrust to 0 in first 50ms of front transition
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-06-07 16:11:59 +02:00
Silvan Fuhrer
77a3099154 VTOL Tailsitter: fix motor spikes to 0 when starting back transition
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-06-07 16:11:59 +02:00
Silvan Fuhrer
3a2b973aba VTOL Tailsitter: add front transition throttle blending
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-06-07 16:11:59 +02:00
Silvan Fuhrer
a081354933 VTOL tailsitter: fix motor spike to 0 when finishing front transition
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-06-07 16:11:59 +02:00
Silvan Fuhrer
1f7b4843dd FW position control: specify modes where FW_PN_R_SLEW_MAX applies
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-06-07 09:32:23 +02:00
Daniel Agar
fb659ae200 ekf2: stopMagFusion() reset yaw_align if mag heading was active
- we also need to clear mag_aligned_in_flight
2024-06-06 10:08:20 -04:00
Daniel Agar
bfe3c86aeb ekf2: merge mag yaw angle observability into heading consistency
- the additional hyteresis logic for "yaw angle observable" was
   needed when it controlled time dependent mag_3d
2024-06-06 10:07:31 -04:00
Matthias Grob
68769ea0ec mavlink: use reference instead of pointer to access the MAVLink instance from protocol classes 2024-06-05 16:13:52 +02:00
Matthias Grob
9a7a977625 mavlink_receiver: put all message handling in the same function 2024-06-05 16:13:52 +02:00
Daniel Agar
157f7cf40b simplify world_magnetic_model interface (degrees in, degrees out)
- this hopefully helps avoid accidental mis-use
 - try to clarify units everywhere
2024-06-04 09:14:36 -04:00
Daniel Agar
5fa3b9d86a lib/world_magnetic_model: fetch_noaa_table.py refactor and scaling improvements
- upate to NOAA grid API to build WMM table in one pass
 - refactor declination/inclination/totalintensity table printing to
   shared method
 - compute scaling factor to maximize resolution
2024-06-04 09:14:36 -04:00
Matteo Del Seppia
a8617cf681
Fix float and uint64_t comparison (#23199)
fix: ControlAllocator float and int comparison bug

There was an incorrect comparison between a float variable `dt` and a `uint64_t` value representing 5 milliseconds (`5_ms`). As a result, `do_update` could never become true even if the last torque setpoint was received more than 5 milliseconds before.

To solve this, the `5_ms` value has been converted to seconds (0.005f) for the comparison with `dt`.
2024-06-03 17:48:38 -08:00
Matteo Del Seppia
de5087ae3e
Patch for issue #22818 (#23170)
When calling "differential_drive stop" a missing return statement was causing a segmentation fault due to access to already freed memory.
2024-06-03 21:10:28 +02:00
bresch
0a665a526c ekf2: add mag type init
In this mode, the mag is used to inilialize the heading.
During flight, the heading is predicted using gyros and corrected
by GNSS measurements if available.
2024-06-03 13:28:12 +02:00
Beat Küng
ca112fea8a fix commander: make sure to count all valid mags in preflight check
Previously, if a mag was not required (not index 0 and not used by ekf),
it was not counted in num_enabled_and_valid_calibration.
If a user set SYS_HAS_MAG to e.g. 3, it would then trigger a preflight
failure, even if there were 3 calibrated and enabled mags.
2024-05-31 12:30:34 -04:00
bresch
53210dd8f3 ekf2-mag: with NE aiding, constrain heading drift only before takeoff
After takeoff, the heading is easily observable
2024-05-31 10:38:17 -04:00
bresch
3dac9af09e ekf2-mag: do not reset on WMM change when NE aiding is active
The mag field states are observed. No need to reset them.
2024-05-31 10:38:17 -04:00
bresch
ee765e7859 ekf2-mag: do not reset when NE aiding is active 2024-05-31 10:38:17 -04:00
bresch
6515935b52 ekf2-mag: do not limit the earth mag field estimate
The EKF can recover from an initial bad earth mag field estimate.
Constraining the field is not necessary and can lead to an unpredicted
behavior of the filter.
Declination fusion is safe to run even when the horizontal field is 0
2024-05-31 10:38:17 -04:00
bresch
774b6ed3b8 ekf2-mag: do not use yaw emergency estimator to reset mag states
On slowly moving vehicles (e.g.: boats, rovers), the yaw estimator has
worse convergence than the main EKF. Resetting the mag states using the
yaw estimator as reference can lead to poor heading. Also, the EKF can
recover really well from initially incorrect mag states.
2024-05-31 10:38:17 -04:00
bresch
c3d984703c ekf2-mag: remove immediate declination fusion after reset 2024-05-31 10:38:17 -04:00
bresch
a6007e4b93 ekf2-mag: turn around update_all_states condition
Non-functional
2024-05-31 10:38:17 -04:00
bresch
c11c75d32e ekf2-mag: always add process noise until initial value 2024-05-31 10:38:17 -04:00
Silvan Fuhrer
752051470f Navigator: increase default of MIS_DIST_1WP to 10km
The previous default of 900m leads to many warnings if left
unchanged, especially if the vehicle is already in-air when
the Mission is started.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-05-29 21:00:35 -04:00
bresch
993782cffa ekf2: only trigger position timeout reset when hpos fusion is active 2024-05-29 20:49:14 -04:00
Jacob Dahl
a4650fd70d
HealthCheck: added health check for logger to report if it's running (#22781) 2024-05-29 11:56:50 +02:00
Matthias Grob
d1db0addf9 CameraFeedback: shorten line length such that documentation parser works
This broke in 4f64acb3524d39967bd7f516ae2ebfe4be5246bc and was also flagged by CI in the pr and since then.
2024-05-29 11:24:53 +02:00
Silvan Fuhrer
032ae69eee VTOL: remove _dt passing as it's no longer used (and was wrong)
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-05-28 14:54:33 +02:00
Silvan Fuhrer
f8fe7c7aa3 VTOL Standard: fix transition pusher motor slew rate
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-05-28 14:54:33 +02:00
Matthias Grob
dfee9ca4c6 MAVLink: remove never used _mavlink_link_termination_allowed 2024-05-28 10:41:00 +02:00
Silvan Fuhrer
42bca65cbf RTL_mission_reverse: start from previous WP if RTL is triggered while in Mission
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-05-27 12:03:16 +02:00
Silvan Fuhrer
b9d3b9f211 RTL_mission_fast: continue mission if RTL is triggered while in Mission
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-05-27 12:03:16 +02:00
Hamish Willee
4f64acb352
Docs for camera_feedback module (#23103)
* Docs for camera_feedback module

* Update src/modules/camera_feedback/CameraFeedback.cpp

* Update src/modules/camera_feedback/CameraFeedback.cpp
2024-05-23 08:44:34 +10:00
Beat Küng
e1ffc2cdaa commander: add check for 5V overcurrent 2024-05-22 09:34:04 +02:00
Konrad
664a0f2cda HomePosition: Add minimum position change needed to be recognised as new home position 2024-05-21 09:11:56 +02:00
Jacob Dahl
70304fe715
[mavlink] Parameter to always start on USB (#22234)
* usb: Added parameter to enable always starting mavlink on USB.

    Refactored cdcacm_init into a module and added a paramter to allow always starting mavlink on
    USB, also added a paramter to choose the mode. The current default behavior is to wait and listen
    for data on USB and auto-detect the protocol (mavlink, nsh, ublox). This results in the mavlink
    stream not starting until something else on the mavlink network sends a packet first. The new
    default behavior is to always start mavlink.

    Added parameters
    MAV_USB_ENABLE -- default 1 (always start mavlink on USB)
    MAV_USE_MODE -- default 3 (onboard)

* added 3 retries for opening serial port in mavlink, removed sleep before sercon

* added DRIVERS_CDCACM_AUTOSTART to ark-v6x default.px4board

* added CONFIG_DRIVERS_CDCACM_AUTOSTART=y to default.px4board for boards with CONFIG_CDCACM in their nsh/defconfig

* format

* remove PGA460 from COMMON_DISTANCE_SENSOR to save flash

* remove LIS2MDL from COMMON_MAGNETOMETER to save flash

* disable CONFIG_DRIVERS_CDCACM_AUTOSTART for fmu-v5 protected.px4board

* moved and renamed parameters, removed mode logic in mavlink

* changed parameter names, added mode none

* remove parameters from mavlink
2024-05-20 12:35:29 -06:00
Daniel Agar
d359f6236e
ekf2: symforce zero more efficiently (#23133)
- increase symforce CppConfig zero_initialization_sparsity_threshold so
   that a Matrix setZero() call is performed instead of individually zeroing

Co-authored-by: bresch <brescianimathieu@gmail.com>
2024-05-17 11:20:30 +02:00
bresch
ea39032b45 mag_ctrl: combine common conditions for mag_hdg and mag_3d 2024-05-17 11:19:04 +02:00
bresch
d796009302 mag_ctrl: do not fuse synthetic mag but do not zero the innovation 2024-05-17 11:19:04 +02:00