bitcraze / crazyflie-firmware

The main firmware for the Crazyflie Nano Quadcopter, Crazyflie Bolt Quadcopter and Roadrunner Positioning Tag.
GNU General Public License v3.0
1.19k stars 1.06k forks source link

ESTKALMAN: WARNING: Kalman prediction rate low (94) with Lighthouse V1 #1112

Closed krichardsson closed 1 year ago

krichardsson commented 2 years ago

It seems as the kalman task does not run at 100 Hz when using Lighthouse V1. I don't think the positioning is bad but it should be investigated.

Discussed in https://github.com/orgs/bitcraze/discussions/253

Originally posted by **mouhyemen** September 2, 2022 I am using LH base stations V1. I calibrated the LH positioning from the cfclient and estimating the geometry. I looked at the position estimates in the Plotter and it looked reasonable. But I am getting ESTKALMAN warning and can't fly the CF2.1 ``` SYS: ---------------------------- SYS: Crazyflie 2.1 is up and running! SYS: Build 0:8c606d1f8f89 (2022.05) CLEAN SYS: I am 0x20373357594B50070025002C and I have 1024KB of flash! CFGBLK: v1, verification [OK] DECK_CORE: 1 deck(s) found DECK_CORE: Calling INIT on driver bcLighthouse4 for deck 0 IMU: BMI088: Using I2C interface. IMU: BMI088 Gyro connection [OK]. IMU: BMI088 Accel connection [OK] IMU: BMP388 I2C connection [OK] ESTIMATOR: Using Kalman (2) estimator CONTROLLER: Using PID (1) controller MTR-DRV: Using brushed motor driver SYS: About to run tests in system.c. SYS: NRF51 version: 2022.0 EEPROM: I2C connection [OK]. STORAGE: Storage check [OK]. IMU: BMI088 gyro self-test [OK] SYS: Self test passed! STAB: Wait for sensor calibration... SYS: Free heap: 19240 bytes LHFL: Lighthouse bootloader version: 2 STAB: Ready to fly. LHFL: Bitstream CRC32: 112BC794 [PASS] LHFL: Firmware version 6 verified, booting deck! ESTKALMAN: State out of bounds, resetting ESTKALMAN: WARNING: Kalman prediction rate low (97) ESTKALMAN: WARNING: Kalman prediction rate low (95) ESTKALMAN: WARNING: Kalman prediction rate low (98) ESTKALMAN: WARNING: Kalman prediction rate low (94) ``` Here's the task dump output by waiting 4-5 seconds between two sessions. ``` ESTKALMAN: WARNING: Kalman prediction rate low (98) SYSLOAD: Task dump SYSLOAD: Load Stack left Name SYSLOAD: 2.89 205 Tmr Svc SYSLOAD: 41.99 127 IDLE SYSLOAD: 0.0 76 PWRMGNT SYSLOAD: 1.34 211 CRTP-RX SYSLOAD: 18.82 53 LH SYSLOAD: 0.0 255 CMDHL SYSLOAD: 0.0 115 PLATFORM- SYSLOAD: 0.0 249 LOG SYSLOAD: 0.0 221 MEM SYSLOAD: 0.01 258 PARAM SYSLOAD: 0.34 126 SYSTEM SYSLOAD: 0.23 61 CRTP-TX SYSLOAD: 2.03 175 SYSLINK SYSLOAD: 2.27 87 LEDSEQCMD SYSLOAD: 0.63 107 CRTP-SRV SYSLOAD: 5.02 367 STABILIZE SYSLOAD: 6.92 144 SENSORS SYSLOAD: 17.42 281 KALMAN SYSLOAD: 0.0 113 USBLINK ESTKALMAN: WARNING: Kalman prediction rate low (96) ESTKALMAN: WARNING: Kalman prediction rate low (96) ESTKALMAN: WARNING: Kalman prediction rate low (98) ESTKALMAN: WARNING: Kalman prediction rate low (94) ESTKALMAN: WARNING: Kalman prediction rate low (98) ESTKALMAN: WARNING: Kalman prediction rate low (98) ESTKALMAN: WARNING: Kalman prediction rate low (91) ESTKALMAN: WARNING: Kalman prediction rate low (96) SYSLOAD: Task dump SYSLOAD: Load Stack left Name SYSLOAD: 3.15 171 Tmr Svc SYSLOAD: 39.72 127 IDLE SYSLOAD: 0.66 107 CRTP-SRV SYSLOAD: 0.0 76 PWRMGNT SYSLOAD: 1.42 211 CRTP-RX SYSLOAD: 7.04 144 SENSORS SYSLOAD: 19.55 53 LH SYSLOAD: 0.0 115 PLATFORM- SYSLOAD: 0.0 249 LOG SYSLOAD: 0.0 221 MEM SYSLOAD: 0.0 258 PARAM SYSLOAD: 0.31 126 SYSTEM SYSLOAD: 0.25 61 CRTP-TX SYSLOAD: 5.12 367 STABILIZE SYSLOAD: 18.19 281 KALMAN SYSLOAD: 2.13 175 SYSLINK SYSLOAD: 2.39 87 LEDSEQCMD SYSLOAD: 0.0 113 USBLINK SYSLOAD: 0.0 255 CMDHL ESTKALMAN: WARNING: Kalman prediction rate low (98) ESTKALMAN: WARNING: Kalman prediction rate low (92) ``` I tried following the steps in [multi-base-stations](https://www.bitcraze.io/documentation/repository/crazyflie-firmware/master/functional-areas/lighthouse/multi_base_stations/) link to calibrate and run the script `multi_bs_geometry_estimation.py`. After following all the steps, I get this error: ``` Step 6. Estimating geometry... /home/mouhyemen/.local/lib/python3.8/site-packages/cflib/localization/lighthouse_types.py:61: ComplexWarning: Casting complex values to real discards the imaginary part return Pose(Rotation.from_quat(R_quat).as_matrix(), t_vec) Initial guess base stations at: Traceback (most recent call last): File "multi_bs_geometry_estimation.py", line 364, in connect_and_estimate(uri) File "multi_bs_geometry_estimation.py", line 347, in connect_and_estimate bs_poses = estimate_geometry(origin, x_axis, xy_plane, samples) File "multi_bs_geometry_estimation.py", line 219, in estimate_geometry print_base_stations_poses(initial_guess.bs_poses) AttributeError: 'dict' object has no attribute 'bs_poses' ``` What should I do to solve the issue?
krichardsson commented 1 year ago

Seems to work now. Closing