Beat Küng
666b84027d
GyroFFT: disable 4096 for IMU_GYRO_FFT_LEN
...
saves around 10.5KB flash on px4-fmu-v5
2022-08-25 22:02:15 -04:00
Beat Küng
060738cae1
src: avoid use of double precision pow & exp
...
saves around 5KB flash on px4-fmu-v5
2022-08-25 22:02:15 -04:00
Beat Küng
983a9815eb
libevents: update submodule
2022-08-25 22:02:15 -04:00
Beat Küng
4c41934bb4
commander: inline HealthComponentIndex::HealthComponentIndex
...
Saves around 1KB flash
2022-08-25 22:02:15 -04:00
Beat Küng
1c89b0c9c8
commander: use actuator_function for ESC reporting
2022-08-25 22:02:15 -04:00
Beat Küng
13c93db11a
commander: use circuit breaker params directly in arming checks
2022-08-25 22:02:15 -04:00
Beat Küng
4230eee24f
commander: print 'ready for takeoff' to console for sitl after startup
2022-08-25 22:02:15 -04:00
Beat Küng
2fccb576ad
commander: remove unused includes and variables
2022-08-25 22:02:15 -04:00
Beat Küng
dbb814ff24
HealthAndArmingChecks: CONSOLE_PRINT_ARMING_CHECK_EVENT & reduce flash usage
...
- print list of events whenever they change if
CONSOLE_PRINT_ARMING_CHECK_EVENT is set, instead of on each update call
- reduce flash usage by moving out templated code into non-template method
2022-08-25 22:02:15 -04:00
Beat Küng
b2cb164c12
commander: replace health flags with health_report from arming checks
2022-08-25 22:02:15 -04:00
Beat Küng
6d1fb92eb7
commander: rework arming checks to use the events interface
2022-08-25 22:02:15 -04:00
Beat Küng
b3fe0eeae8
mavlink_events: send reset sequence out immediately on startup
2022-08-25 22:02:15 -04:00
Beat Küng
c7b64e3c01
commander: check for ack when calling 'commander takeoff'
2022-08-25 22:02:15 -04:00
Beat Küng
406b0bbc86
commander: handle VEHICLE_CMD_RUN_PREARM_CHECKS
2022-08-25 22:02:15 -04:00
Beat Küng
8f9be0541f
HealthAndArmingChecks: add support for legacy mavlink_log reporting
2022-08-25 22:02:15 -04:00
Beat Küng
f23363f88c
HealthAndArmingChecks: add unit tests for Report
2022-08-25 22:02:15 -04:00
Beat Küng
fcadc69e52
mavlink_receiver: set timestamp to gps_inject_data_topic
2022-08-25 22:02:15 -04:00
Beat Küng
b7a6de05df
arming checks: add health topic
2022-08-25 22:02:15 -04:00
Beat Küng
07afcf4586
commander preflight checks: new structure using events interface
...
- Reporter class that keeps track of results (list of events + whether
arming is possible + health).
And only reports when one or more checks change.
2022-08-25 22:02:15 -04:00
Beat Küng
04f7df3848
SubscriptionMultiArray: use Subscription instead of SubscriptionInterval
...
Saves ~3KB RAM on fmu-v5.
2022-08-25 22:02:15 -04:00
Daniel Agar
9b0b0d1168
ekf2: update test change indication csv
2022-08-25 15:55:45 -04:00
Daniel Agar
4040e4cdf2
simulation organization and cleanup
...
- new modules/simulation directory to collect all simulators and related modules
- new Tools/simulation directory to collect and organize scattered simulation submodules, scripts, etc
- simulation module renamed to simulator_mavlink
- sih renamed to simulator_sih (not a great name, but I wanted to be clear it was a simulator)
- ignition_simulator renamed to simulator_ignition_bridge
- large sitl_target.cmake split by simulation option and in some cases pushed to appropriate modules
- sitl targets broken down to what's actually available (eg jmavsim only has 1 model and 1 world)
- new Gazebo consistently referred to as Ignition for now (probably the least confusing thing until we fully drop Gazebo classic support someday)
2022-08-25 09:10:03 -04:00
Jukka Laitinen
f8f1213841
board_adc: Small fix for printf formatter
...
Print sizeof type with %zu to be compatible with 64 bit targets, where it is unsigned long
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae >
2022-08-25 07:50:23 +02:00
bresch
0061ef8b89
[AUTO COMMIT] update change indication
2022-08-24 09:16:11 -04:00
bresch
090d03eea2
ekf2: publish GNSS, rng and EV height biases
2022-08-24 09:16:11 -04:00
bresch
a2a29ba0dd
ekf2: verify parameter configuration for height sources
2022-08-24 09:16:11 -04:00
bresch
8dd5d0d1a3
ekf2: don't reset height when in conditional range aiding
2022-08-24 09:16:11 -04:00
bresch
20cd599bb7
ekf2: fix param migration
2022-08-24 09:16:11 -04:00
bresch
2d39097f60
ekf2: move rng height to file
2022-08-24 09:16:11 -04:00
bresch
28b4cd0579
ekf2: move GNSS hgt control to file
2022-08-24 09:16:11 -04:00
bresch
b6f76b5eaa
ekf2: move ev control to file
2022-08-24 09:16:11 -04:00
bresch
f555281c94
ekf2: move height control-related function to file
2022-08-24 09:16:11 -04:00
bresch
d87feee5b0
ekf2: move baro control logic to file
2022-08-24 09:16:11 -04:00
bresch
12e25eba62
ekf2: add common height fusion timeout parameter
2022-08-24 09:16:11 -04:00
bresch
52f726c5b7
ekf2: in bias estimator, use psd instead of var for prediction
...
PSD is independent from the sampling time while variance isn't
2022-08-24 09:16:11 -04:00
bresch
b04d61c411
ekf2: param migration for rng aid, aid mask (gps) and hgt mode
2022-08-24 09:16:11 -04:00
bresch
3fb218600a
ekf2_test: add multi height source unit tests
2022-08-24 09:16:11 -04:00
bresch
aba2eac0df
ekf2: publish GNSS, rng and EV height biases
2022-08-24 09:16:11 -04:00
bresch
8962cf2d25
ekf2: GPS, baro and range finder control parameters
...
Also remove the legacy "range aid" than can be achieved by setting the
height reference to range finder and the range finder control parameter
to "conditional".
Conditional range aiding cal also be set when the height reference isn't
the range finder. This prevents the ratchetting effect due to switching
between references.
2022-08-24 09:16:11 -04:00
bresch
578e1339ca
ekf2: re-implement range aid
...
range aid simply forces the range finder to be the height reference when
starting
2022-08-24 09:16:11 -04:00
bresch
88ac5ea210
ekf2_test: add test case for accel clipping handling
2022-08-24 09:16:11 -04:00
bresch
375753eba8
ekf2_test: add inertial nav falling detection tests
2022-08-24 09:16:11 -04:00
bresch
66ce1a002b
ekf2_test: rename VisionHeight -> ExternalVisionHeight
2022-08-24 09:16:11 -04:00
bresch
82ec7a495a
ekf2: refactor inertial nav falling check
2022-08-24 09:16:11 -04:00
bresch
f9188b2a14
ekf2: refactor vertical acceleration check for multiple height sources
2022-08-24 09:16:11 -04:00
bresch
8fd79688c0
ekf2: enable multiple height sources fusion
...
Instead of having a single height source fused into the EKF and the
other ones "waiting" for a failure or the primary sensor, fuse all
sources in EKF2 at the same time. To prevent the sources from fighting against each
other, the "primary" source is set as reference and the other ones are
running a bias estimator in order to make all the secondary height
sources converge to the primary one.
If the reference isn't available, another one is automatically selected
from a priority list. This secondary reference keeps its current bias
estimate but stops updating it in order to be the new reference as close
as possible to the primary one.
2022-08-24 09:16:11 -04:00
bresch
f5f31006a0
Ekf2: create HeightBiasEstimator class
...
Contains some logic common to all height bias estimators
2022-08-24 09:16:11 -04:00
JacobCrabill
57125a4c8f
cyphal: Fix FMUv5 config; throw error if no CAN driver exists
2022-08-23 21:24:24 -04:00
huiyulhy
c81efd0174
Fix velocity smoothing functional test
2022-08-23 21:11:35 -04:00
Beat Küng
bae275898b
rc/sbus: restart parser after sucessful decoding & increase time limit
...
Instead of directly passing the next packet to the parser after successful
parsing, switch the state to SBUS2_DECODE_STATE_SBUS_START and search for
the start byte again.
The timeout is increased as the IO main loop also takes a bit of time
(max ~0.7ms).
Tested on v5x with Futaba R7008SB (60Hz update rate) and FrSky X8R (111Hz
update rate).
Background:
When using the Futaba R7008SB, I noticed there's additional bytes added in
between packets. Often it's a null byte, but sometimes more. There's some
consistency but I did not find any documentation for it.
Sample data:
a8 fd 07 16 5b 81 05 d4 a0 06 20 00 01 08 40 00 02 10 80 00 34 00 0f 05 ec
1f a8 fd 07 16 5b 81 05 d4 a0 06 20 00 01 08 40 00 02 10 80 00 04 00 c0 8b
00 0f 04 ec 1f a8 fb 07 16 5b 81 05 d4 a0 06 20 00 01 08 40 00 02 10 80 00
14 00 0f 04 ec 1f a8 fb 07 16 5b 81 05 d4 a0 06 20 00 01 08 40 00 02 10 80
00 24 00 0f 05 ec 1f a8 fd 07 16 5b 81 05 d4 a0 06 20 00 01 08 40 00 02 10
80 00 34 00 0f 05 ec 1f 30 60 bf 1c bd 07 16 5b 81 05 d4 a0 06 20 00 01 08
40 00 02 10 80 00 34 00 0f 07 ec 1f a8 fd 07 16 5b 81 05 d4 a0 06 20 00 01
08 40 00 02 10 80 00 04 00 03 c0 31 00 0f 05 fc 1f a8 fb 07 16 5b 81 05 d4
a0 06 20 00 01 08 40 00 02 10 80 00 14 00 0f 05 fc 1f a8 fb 07 16 5b 81 05
d4 a0 06 20 00 01 08 40 00 02 10 80 00 24 00 0f 04 ec 1f a8 fd 07 16 5b 81
05 d4 a0 06 20 00 01 08 40 00 02 10 80 00 34 00 0f 04 ec 1f a8 fd 07 16 5b
81 05 d4 a0 06 20 00 01 08 40 00 02 10 80 00 04 00 03 c4 00 00 0f 04 ec 1f
a8 fd 07 16 5b 81 05 d4 a0 06 20 00 01 08 40 00 02 10 80 00 14 00 0f 04 ec
1f a8 fd 07 16 5b 81 05 d4 a0 06 20 00 01 08 40 00 02 10 80 00 24 00 0f 04
ec 1f a8 fd 07 16 5b 81 05 d4 a0 06 20 00 01 08 40 00 02 10 80 00 34 00 0f
05 ec 1f a8 fd 07 16 5b 81 05 d4 a0 06 20 00 01 08 40 00 02 10 80 00 04 00
03 c0 31 00 0f 05 ec 1f a8 fd 07 16 5b 81 05 d4 a0 06 20 00 01 08 40 00 02
10 80 00 14 00 0f 05 fc 1f a8 fd 07 16 5b 81 05 d4 a0 06 20 00 01 08 40 00
02 10 80 00 24 00 0f 05 fc 1f a8 fd 07 16 5b 81 05 d4 a0 06 20 00 01 08 40
00 02 10 80 00 34 00 0f 05 ec 1f a8 fd 07 16 5b 81 05 d4 a0 06 20 00 01 08
40 00 0f 05 ec 1f a8 fd 07 16 5b 81 05 d4 a0 06 20 00 01 08 40 00 02 10 80
00 04 00 03 c0 31 00 0f 05 ec 1f a8 fd 07 16 5b 81 05 d4 a0 06 20 00 01 08
40 00 02 10 80 00 14 00 0f 05 ec 1f a8 fd 07 16 5b 81 05 d4 a0 06 20 00 01
08 40 00 02 10 80 00 24 00 0f 05 ec 1f a8 fd 07 16 5b 81 05 d4 a0 06 20 00
01 08 40 00 02 10 80 00 34 00 0f 05 f4 1f a8 fb 07 16 5b 81 05 d4 a0 06 20
00 01 08 40 00 02 10 80 00 04 00 03 c4 00 00 b0 60 7f 1c bd 07 16 5b 81 05
d4 a0 06 20 00 01 08 40 00 02 10 80 00 14 00 0f 05 ec 1f a8 fd 07 16 5b 81
05 d4 a0 06 20 00 01 08 40 00 02 10 80 00 24 00 0f 05 ec 1f a8 fd 07 16 5b
81 05 d4 a0 06 20 00 01 08 40 00 02 10 80 00 34 00 0f 05 ec 1f a8 fb 07 16
5b 81 05 d4 a0 06 20 00 01 08 40 00 02 10 80 00 04 00 03 c0 31 00 b0 60 bf
1c bd 07 16 5b 81 05 d4 a0 06 20 00 01 08 40 00 02 10 80 00 14 00 0f 04 f4
1f a8 fd 07 16 5b 81 05 d4 a0 06 20 00 01 08 40 00 02 10 80 00 24 00 30 70
7f 1c bd 07 16 5b 81 05 d4 a0 06 20 00 01 08 40 00 02 10 80 00 34 00 0f 05
f4 1f a8 fd 07 16 5b 81 05 d4 a0 06 20 00 01 08 40 00 02 10 80 00 04 00 03
c4 00 00 0f 05 fc 1f a8 fd 07 16 5b 81 05 d4 a0 06 20 00 01 08 40 00 02 10
80 00 14 00 0f 05 ec 1f b0 60 bf 1c bd 07 16 5b 81 05 d4 a0 06 20 00 01 08
40 00 02 10 80 00 14 00 0f 05 ec 1f a8 fd 07 16 5b 81 05 d4 a0 06 20 00 01
08 40 00 02 10 80 00 24 00 0f 05 ec 1f a8 fd 07 16 5b 81 05 d4 a0 06 20 00
This was causing the parser to skip entire packets resulting in an update
rate of ~31Hz on the FMU side.
With this patch the update rate increases to 42-48Hz.
The investigation was triggered by an RC glitch with a packet containing
random channel data. It's likely, although not completely verified that
the frequent desync randomly happend to pass the CRC check with garbage
data.
2022-08-23 21:07:18 -04:00