Failed Assert in .//src/utils/interface/cf_math.h:78

Topics related to the Lighthouse positioning system, configuration and use
Post Reply
jjan3640
Beginner
Posts: 8
Joined: Tue Mar 30, 2021 4:18 am

Failed Assert in .//src/utils/interface/cf_math.h:78

Post by jjan3640 »

I am receiving this error in the console

Code: Select all

SYS: The system resumed after a failed assert [WARNING] 
SYS: Assert failed at .//src/utils/interface/cf_math.h:78
and the drone is unable to use the Lighthouse deck for positioning. The assertion failure looks like it is happening within the arm_sqrt(float32_t in) method.

I am unsure why this started happening or how I could go about resolving it. Any help would be much appreciated. I have reflashed the drone and deck multiple times and ensured that the cfclient and cflib were up to date.

The error does not come up when the Lighthouse deck is not attached.
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: Failed Assert in .//src/utils/interface/cf_math.h:78

Post by kristoffer »

Yeah, the problem with the assert log is that it does not give you any clue of what code that called the arm_sqrt().

What firmware are you using? Do you see this problem on the latest official release (2021.03) flashed from the python client as well?

As far as I know, we have not heard about similar problems on 2021.03 so it seems to work OK.
jjan3640
Beginner
Posts: 8
Joined: Tue Mar 30, 2021 4:18 am

Re: Failed Assert in .//src/utils/interface/cf_math.h:78

Post by jjan3640 »

Thank you for the reply. I am using the latest official release (2021.03). I have switched to a different drone now and everything seems to be working fine so I believe it could be something to do with the hardware.
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: Failed Assert in .//src/utils/interface/cf_math.h:78

Post by kristoffer »

Did you switch both the Crazyflie and Lighthouse deck? If you have access to two CFs and decks it would be interesting to know which permutations of CFs and decks that trigger the assert to figure out if the problem is in the CF or deck.
oryx
Beginner
Posts: 2
Joined: Fri Jul 16, 2021 2:27 pm

Re: Failed Assert in .//src/utils/interface/cf_math.h:78

Post by oryx »

Hello! Just wanted to say that I think I'm seeing this same issue with the lighthouse deck. The error only seems to show up when the base stations (V1) are powered on and within sight of the board. Here's some example console output, generated with FW compiled from the current master branch in DEBUG mode. In the first half, I power up the board with a box around the crazyflie to block the lighthouse - the CF seems to power up normally and is happy. However, as soon as I remove the box and let the lighthouse board 'see' the base stations, it seems like a system reboot is triggered that ends in the above mentioned assert error.

Code: Select all

SYS: ----------------------------
SYS: Crazyflie 2.1 is up and running!
SYS: Build 11:9e78a1228157 (2021.06 +11) MODIFIED
SYS: I am 0x20373357594B5007003D0046 and I have 1024KB of flash!
CFGBLK: v1, verification [OK]
DECK_DRIVERS: Found 19 drivers
DECK_DRIVERS: VID:PID BC:01 (bcLedRing)
DECK_DRIVERS: VID:PID BC:04 (bcBuzzer)
DECK_DRIVERS: VID:PID BC:07 (bcGTGPS)
DECK_DRIVERS: VID:PID 00:00 (bcCPPM)
DECK_DRIVERS: VID:PID BC:08 (bcUSD)
DECK_DRIVERS: VID:PID BC:09 (bcZRanger)
DECK_DRIVERS: VID:PID BC:0E (bcZRanger2)
DECK_DRIVERS: VID:PID BC:06 (bcDWM1000)
DECK_DRIVERS: VID:PID BC:0A (bcFlow)
DECK_DRIVERS: VID:PID BC:0F (bcFlow2)
DECK_DRIVERS: VID:PID BC:0B (bcOA)
DECK_DRIVERS: VID:PID BC:0C (bcMultiranger)
DECK_DRIVERS: VID:PID BC:10 (bcLighthouse4)
DECK_DRIVERS: VID:PID BC:11 (bcActiveM)
DECK_DRIVERS: VID:PID 00:00 (CCS811deck)
DECK_DRIVERS: VID:PID BC:12 (bcAI)
DECK_DRIVERS: VID:PID BC:FF (bcExpTest)
DECK_DRIVERS: VID:PID BC:FE (bcExpTestRR)
DECK_DRIVERS: VID:PID BC:FD (bcBoltTest)
DECK_INFO: Found 1 deck memory.
DECK_INFO: Enumerating deck 0
DECK_INFO: Deck BC:10 bcLighthouse4 (Rev. D)
DECK_INFO: Used pin: 00010001
DECK_INFO: Driver implements: [ init ]
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.
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: 19224 bytes
LHFL: Lighthouse bootloader version: 2
STAB: Ready to fly.
LHFL: Bitstream CRC32: 112BC794 [PASS]
LHFL: Firmware version 6 verified, booting deck!
SYS: ----------------------------
SYS: Crazyflie 2.1 is up and running!
SYS: Build 11:9e78a1228157 (2021.06 +11) MODIFIED
SYS: I am 0x20373357594B5007003D0046 and I have 1024KB of flDECK_DRIVERS: Found 19 drivers
DECK_DRIVERS: VID:PID BC:01 (bcLedRing)
DECK_DRIVERS: VID:PID BC:04 (bcBuzzer)
DECK_DRIVERS: VID:PID BC:07 (bDECK_DRIVERS: VID:PID 00:00 (bDECK_DRIVERS: VID:PID BC:08 (bDECK_DRIVERS: VID:PID BC:09 (bcZRanger)
DECK_DRIVERS: VID:PID BC:0E (bcZRanger2)
DECK_DRIVERS: VID:PID BC:06 (bcDWM1000)
DECK_DRIVERS: VID:PID BC:0A (bcFlow)
DECK_DRIVERS: VID:PID BC:0F (bcFlow2)
DECK_DRIVERS: VID:PID BC:0B (bcOA)
DECK_DRIVERS: VID:PID BC:0C (bcMultiranger)
DECK_DRIVERS: VID:PID BC:10 (bcLighthouse4)
DECK_DRIVERS: VID:PID BC:11 (bcActiveM)
DECK_DRIVERS: VID:PID 00:00 (CCS811deck)
DECK_DRIVERS: VID:PID BC:12 (bcAI)
DECK_DRIVERS: VID:PID BC:FF (bcExpTest)
DECK_DRIVERS: VID:PID BC:FE (bcExpTestRR)
DECK_DRIVERS: VID:PID BC:FD (bcBoltTest)
DECK_INFO: Found 1 deck memory.
DECK_INFO: Enumerating deck 0
OW: Cmd 0x22 timeout.
DECK_INFO: Reading deck nr:0 [FAILED]. No driver will be initialized!
DECK_CORE: 0 deck(s) found
IMU: BMI088: Using I2C interface.
IMU: BMI088 Gyro connection [OK].
IMU: BMI088 Accel connection [OK]
IMU: BMP388 I2C connection [OK]
ESTIMATOR: Using Complementary (1) estimator
CONTROLLER: Using PID (1) controller
MTR-DRV: Using brushed motor driver
SYS: About to run tests in system.c.
EEPROM: I2C connection [OK].
STORAGE: Storage check [OK].
IMU: BMI088 gyro self-test [OK]
SYS: The system resumed after a failed assert [WARNING]
SYS: Assert failed at .//src/utils/interface/cf_math.h:78
SYS: cfAssertNormalStart [FAIL]
One thought I had was that maybe the geometry stored on the CF is incompatible with my current base station geometry? I've definitely moved them around since I last set the geometry through the CF client, though previously that just required a new calibration, it didn't cause the CF the stop. Is there a way to clear the geometry on the CF when it is out of sight of the base stations? Maybe starting from scratch and re-calibrating would reveal something.

Thanks!
oryx
Beginner
Posts: 2
Joined: Fri Jul 16, 2021 2:27 pm

Re: Failed Assert in .//src/utils/interface/cf_math.h:78

Post by oryx »

Hi again! So, I missed this newer forum post on the same issue, where there is some guidance on how to resolve the lighthouse issue: viewtopic.php?f=20&t=4949

The guidance there helped me resolve the problem, but I just wanted to record the exact process I used:
  1. Turn on base stations, but block the view between them and the crazyflies.
  2. Connect to the CF in the cfclient and go to the lighthouse tab. 'Change the system type' between V1 to V2.
  3. Unblock the line of sight betweenthe base stations and the CF. (I think this is necessary to actually reset the CF geometry- just switching the system type between V1 and V2 and back while blinded did not resolve the issue.)
  4. Now that the CF can see the base stations, change the system type back to V1 and remanage/ calibrate/ write the geometry to the CF.
After these steps my CF is happy with the lighthouse system again :-)
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Failed Assert in .//src/utils/interface/cf_math.h:78

Post by arnaud »

Great that you fixed your problem! Thanks for posting the solution.

This definitely looks like a bug in the pulse-processing part of the lighthouse deck driver. I created a ticker and we will investigate if we can reproduce and isolate the crash: https://github.com/bitcraze/crazyflie-f ... issues/818.
Post Reply