14860 Commits

Author SHA1 Message Date
Daniel Agar
9824c6b4ae
[WIP] sliding DFT 2022-01-12 20:45:16 -05:00
Daniel Agar
bb1177d504 sensor_calibration: refactor and centralize calibration slot logic
- centralize logic for selecting a preferred calibration slot
   - automatically use existing calibration slot if it exists, otherwise
find first available slot, with a preference for a requested index
 - existing commander calibration methods rewrite all calibration slots
to match current sensor ordering
2022-01-12 16:16:26 -05:00
Silvan Fuhrer
3cd1e0ce19 MCLandDetector: clean up logic for ground effect
Before: in_ground_effect was always true with the default settings (LNDMC_ALT_GND =-1)
 and when a distance sensor was present with valid data.
Now: default of LNDMC_ALT_GND is set to 2m by default, and if set to a negative value
then in_ground_effect is never set to true

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-01-12 18:41:16 +01:00
Matthias Grob
443406ea2b FlightTaskAuto: use longerThan() when possible in vector calculations 2022-01-12 15:12:24 +01:00
bresch
4fc7348582 mpc: leave room for altitude error control during descent and descent
Since the same parameter is used to generate the trajectory and to
saturate the controller, there is no additional space for the output of
the position controller once it is filled with the feedforward, letting
the altitude grow uncontrolled.
2022-01-12 13:33:48 +01:00
bresch
ea7d2334c9 mpc: add parameter for ascent/descent speed in auto modes 2022-01-12 13:33:48 +01:00
Daniel Agar
2eec7842ae sensors/vehicle_imu: fix SENS_IMU_AUTOCAL saving logic
- on cycles that don't check for updated calibraton (estimated bias) we
check if there's anything valid to save (when disarmed)
2022-01-11 11:47:02 -05:00
romain-chiap
4e06b40e2b
sih: add tailsitter support, disable UAVCAN 2022-01-11 08:29:19 +01:00
Julian Oes
b3d830dd11 Mantis: move power off tune to commander
This way we don't allocate inside the interrupt context.
2022-01-10 23:04:10 -05:00
Julian Oes
73044c51f9 vmount: only send CONFIGURE cmd if type changes
We don't always have to send MOUNT_CONFIGURE but really only when the
control data type actually changes.
2022-01-10 23:04:10 -05:00
Julian Oes
22180a2639 mavlink: make range params optional
If there is no range sensor compiled in, these two params do not seem to
be available. Hence, we need to make them optional.
2022-01-10 23:04:10 -05:00
Julian Oes
ca1fabf80a logger: add rate factor to slow logging down
This is required for the Mantis to reduce the log streaming rate.
2022-01-10 23:04:10 -05:00
Julian Oes
c2e0e09b2d commander: reduce PWM max again
This is no longer required now.
2022-01-10 23:04:10 -05:00
Julian Oes
e4763f15f6 Mantis: add RC hacks
This changes the way RC is handled for the Mantis:
- The RC values are re-written when arriving over MAVLink. They are
  rescaled from 0..4095 to 1000..2000 and the channel bits added to
  separate channels. This makes the downstream handling easier.
- Gimbal pitch is moved from Aux1 to Aux2 as that should be the default.
- Aux3 and Aux4 are used for the photo and video trigger.
- The speed button is used as the FLTMODE channel and set to switch
  between POSCTL and ALTCTL.
2022-01-10 23:04:10 -05:00
Julian Oes
9fe7a40673 manual_control: enable sending camera commands 2022-01-10 23:04:10 -05:00
Julian Oes
1754e25920 vmount: add param to use RC input for angular rate
Until now RC input was translated to angles only. I added the param
MNT_RC_IN_MODE which allows the RC input to be used for angular rate.
2022-01-10 23:04:10 -05:00
Julian Oes
cb15728536 Mantis: save mission in RAM
This is using a reduced number of mission items of 1000 instead of 2000
in order to fit in RAM.
2022-01-10 23:04:10 -05:00
Julian Oes
880292f5d7 commander: relax RC min/max 2022-01-10 23:04:10 -05:00
Julian Oes
aa007dadee commander: fix emergency power off
From what I can see the CONFIG_BOARDCTL_POWEROFF is not really used
anywhere, however, the BOARD_HAS_POWER_CONTROL is something that is set,
e.g. for the Mantis, to allow power off.
2022-01-10 23:04:10 -05:00
Julian Oes
6301fa35c1 commander: add command to power off 2022-01-10 23:04:10 -05:00
Julian Oes
dd00e43ca3 mavlink: set signal_quality (and sane variance)
Otherwise this distance data is actually not used at all.
2022-01-10 23:04:10 -05:00
Julian Oes
aefbd80b53 mavlink: use optical flow limits from params
This makes more sense than hard-coding arbitrary values.
2022-01-10 23:04:10 -05:00
Julian Oes
f48c3a2cc6 mavlink: don't handle RC_CHANNELS
This is a status/output but should not be an input for the autopilot.
Instead RC_CHANNELS_OVERRIDE should be used.
2022-01-10 23:04:10 -05:00
Daniel Agar
cc1fee525a lib/sensor_calibration: handle calibration slot change on parameter update 2022-01-10 17:16:50 -05:00
Daniel Agar
ab547bb982 sensors/vehicle_angular_velocity: RPM notch don't fully disable if first harmonic frequency drops below minimum frequency
- keep higher frequency harmonics enabled per ESC
 - cleanup timestamp handling (timeouts, etc)
2022-01-10 14:51:29 -05:00
Daniel Agar
b58922a5d7 sensors/vehicle_angular_velocity: notch filters automatically reset on sufficient parameter change 2022-01-10 14:51:29 -05:00
Daniel Agar
7d632254be NotchFilter push initialization/reset into filter
- this simplifies the reset by allowing a notch filter to reset as
needed
 - improves cascade initialization, on reset each filter will reset
properly from the previous
2022-01-10 14:51:29 -05:00
Daniel Agar
d9e7315420 sensors: automatically set initial accel/gyro calibration if stable bias available 2022-01-10 10:46:37 -05:00
Daniel Agar
e731fcdbc0
sensors (accel/gyro/mag) determine if external with device id 2022-01-10 10:31:07 -05:00
Daniel Agar
45040be669 ekf2: accel/gyro/mag sensor cal minor cleanup
- cleanup obsolete comments
 - remove debug helpers
 - add additional variance requirements to mag bias stable (matching accel & gyro)
2022-01-10 09:55:59 -05:00
Daniel Agar
daa925137c boards: move default battery calibration defines to parameter defaults 2022-01-10 09:49:36 -05:00
Daniel Agar
71d8b15b73 commander: fix COM_HOME_EN missing case
- VEHICLE_CMD_COMPONENT_ARM_DISARM is yet another path that calls set_home_position()
2022-01-09 20:52:07 -05:00
bresch
57fa9c545a PosControl: fix hover update equation
The integrator now absorbs properly the change in hover thrust
2022-01-08 15:42:10 +01:00
Daniel Agar
6c97700eaa move sensor calibration parameters to yaml 2022-01-07 19:00:41 -05:00
Matthias Grob
bbad4a5397 FlightTaskAuto: Respect altitude with offtrack state
To avoid weird cases where the altitude is different enough and
the offtrack state flies to the target altitude instead of the closest
point on the track between the waypoints.
2022-01-07 10:30:39 -05:00
Daniel Agar
c17a9e8003 sensors/vehicle_imu: refactor SensorCalibrationUpdate() to separate accel/gyro cal saving 2022-01-07 09:40:51 -05:00
Daniel Agar
aec97e0020 sensors: minor IMU bias saving updates
- sensors/vehicle_imu: reset learned cal on any calibration change
during parameter update
 - sensors/vehicle_imu: cleanup logic estimated bias -> calibration offset
saving
   - don't invalidate saved calibration (the point is to keep the last valid)
   - remove old debug code, etc
 - sensors/vehicle_imu: notify parameter changes if accel or gyro
calibration has changed
 - lib/sensor_calibration: add calibrated() and calibration_index()
getters, keep Accelerometer/Gyroscope/Magnetometer in sync
2022-01-07 09:40:51 -05:00
Silvan Fuhrer
5d7ddf5734 FW Pos Control: use SlewRate library for airspeed setpoint
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-01-07 09:39:10 -05:00
Daniel Agar
30ccfdb2ed
sensors/vehicle_magnetomeer: fix copyright year 2022-01-06 20:27:56 -05:00
Julian Oes
952cfe2fd7 ekf2: fix uninitalized memory warning
The imu and sensor_combined data should not be used when it has not been
updated yet, otherwise this triggers a memory sanitizer warning:

Conditional jump or move depends on uninitialised value(s)
   at 0x2DA7AA: __sanitizer_cov_trace_const_cmp1 (in build/px4_sitl_default-clang/bin/px4)
   by 0x3C4E79: EKF2::Run() (src/modules/ekf2/EKF2.cpp:401)
   by 0x6EB881: px4::WorkQueue::Run() (platforms/common/px4_work_queue/WorkQueue.cpp:187)
   by 0x6ECB9D: px4::WorkQueueRunner(void*) (platforms/common/px4_work_queue/WorkQueueManager.cpp:230)
   by 0x4C07258: start_thread (in /usr/lib/libpthread-2.33.so)
   by 0x4D415E2: clone (in /usr/lib/libc-2.33.so)

Conditional jump or move depends on uninitialised value(s)
   at 0x3C4E7C: EKF2::Run() (src/modules/ekf2/EKF2.cpp:401)
   by 0x6EB881: px4::WorkQueue::Run() (platforms/common/px4_work_queue/WorkQueue.cpp:187)
   by 0x6ECB9D: px4::WorkQueueRunner(void*) (platforms/common/px4_work_queue/WorkQueueManager.cpp:230)
   by 0x4C07258: start_thread (in /usr/lib/libpthread-2.33.so)
   by 0x4D415E2: clone (in /usr/lib/libc-2.33.so)
2022-01-05 16:20:06 -05:00
Silvan Fuhrer
0a82025faf FW Position Control: some airspeed setpoint handling adaptions
- introuce slew rate limiting of airspeed setpoint (with slew rate of 1 m/s/s)
- some refactoring and clean up

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-01-05 17:06:41 +01:00
Silvan Fuhrer
20a1e5f77c FW Position Control: simplify underspeed disabling logic for tecs
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-01-05 17:06:41 +01:00
Matthias Grob
bbb04ab4b8 Remove relaying of maximum altitude through land detector 2022-01-05 14:54:59 +01:00
Julian Oes
2445fa8b4c commander: prevent uninitialized warning
This prevents a memory sanitizer/valgrind warning:

Conditional jump or move depends on uninitialised value(s)
   at 0x2DA536: __sanitizer_cov_trace_cmp4 (in build/px4_sitl_default-clang/bin/px4)
   by 0x6590D8: FailureDetector::update(vehicle_status_s const&, vehicle_control_mode_s const&) (src/modules/commander/failure_detector/FailureDetector.cpp:76) by 0x3817DF: Commander::run() (src/modules/commander/Commander.cpp:2605)
   by 0x38B10B: ModuleBase<Commander>::run_trampoline(int, char**) (platforms/common/include/px4_platform_common/module.h:180)
2022-01-05 10:53:51 +01:00
Daniel Agar
170849c8f8 ekf2: expand accel bias stability criteria 2022-01-04 13:57:49 -05:00
PX4 BuildBot
846f807eff Update submodule mavlink to latest Tue Jan 4 12:39:05 UTC 2022
- mavlink in PX4/Firmware (a8c88f1c98212e72a266fec8a9e7c0da2a14f3af): 4bc0de9c38
    - mavlink current upstream: 75204adad2
    - Changes: 4bc0de9c38...75204adad2

    75204ada 2022-01-04 Hamish Willee - Add ability to specify axis to autotune (#1759)
2022-01-04 09:32:43 -05:00
bresch
d094fbbd70 ekf2: fix delta angle coning metric 2022-01-04 09:28:48 -05:00
PX4BuildBot
6fbc0e95d0 [AUTO COMMIT] update change indication 2022-01-04 09:12:45 -05:00
Daniel Agar
9d1558af25 ekf2: selector use status timestamp for timeout rather than timestamp_sample (delayed time horizon)
- update stale checks for publication to use hrt elapsed time from
timestamp sample
2022-01-03 09:20:44 -05:00
Daniel Agar
333edfe12f ekf2: use delayed IMU timestamp for publication's timestamp_sample 2022-01-03 09:20:44 -05:00