Lighthouse V1, Flight Data and State Estimate freeze

Topics related to the Lighthouse positioning system, configuration and use
Post Reply
dpl
Beginner
Posts: 7
Joined: Thu May 20, 2021 8:41 am

Lighthouse V1, Flight Data and State Estimate freeze

Post by dpl »

Greetings all,

I am currently working an a project and usuing the Crazyflie 2.1 with the Crazyradio and the Lighhouse V1 from my prof. He was setting up the system on a raspberry pi last year. So far I switched to the VM on my Window Pc and using updated projects in the VM and flashed the Crazyflie with the new firmware (2021.03 through the bootloader).

When starting the cfclient and connecting to the crazyflie the flight data output and the state estimate data freezes a couple seconds after connecting to the Crazyflie. I can still fly the Crazyflie with a gamepad, but the only values that are changing in the client are the gamepad inputs (Consol output: ESTKALMAN: State out of bounds, resetting). At this point I thought the missing conncection to the lighthouse was the problem.

I flashed the crazyflie with:

Code: Select all

PLATFORM=CF2
CFLAGS += -DDISABLE_LIGHTHOUSE_DRIVER=0
CFLAGS += -DLIGHTHOUSE_FORCE_TYPE=1
and successfully configurate the lighthouse in the cfclient. But I can only plot lighthouse.x/.y/.z, when using "CFLAGS += -DLIGHTHOUSE_AS_GROUNDTRUTH" (which are pretty accurate), but sometimes with that the state estimate fields are blank in the cfclient (fligh data still freeze after connecting) or, when visible, also freeze.
The command based flight control in cfclient is either usable (but not working) or blank. While moving the crazyflie manually, the position of the Crazyflie doesnt update in the Lighthouse Tab either.

I'll post the results from Log Client. Specially because of the "not setting for variable.." message at the end, which I dont know how to solve (might be the problem?)
Without "CFLAGS += -DLIGHTHOUSE_AS_GROUNDTRUTH":

Code: Select all

onsole:
SYS: ----------------------------
SYS: Crazyflie 2.1 is up and running!
CFGBLK: v1, verification [OK]
DECK_INFO: Warning! No driver found for deck.
DECK_CORE: 2 deck(s) found
DECK_CORE: Calling INIT on driver bcLighthouse4 for deck 1
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: 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

Code: Select all

Log Client:
INFO:cflib.crazyflie:Callback->Connection initialized[radio://0/80/2M/E7E7E7E701]
INFO:cflib.crazyflie:We are connected[radio://0/80/2M/E7E7E7E701], request connection setup
INFO:cflib.crazyflie:Callback->Connected to [radio://0/80/2M/E7E7E7E701]
INFO:cflib.crazyflie.platformservice:Protocol  version: 4
INFO:cflib.crtp.radiodriver:Dongle reported ACK status == None
INFO:cflib.crazyflie.toc:TOC for port [5] found in cache
INFO:cflib.crazyflie:Log TOC finished updating
INFO:cflib.crazyflie.mem:7 memories found
INFO:cflib.crazyflie:Memories finished updating
INFO:cflib.crazyflie.toc:TOC for port [2] found in cache
INFO:cflib.crazyflie:Param TOC finished updating
INFO:cflib.crazyflie:Callback->Connection setup finished [radio://0/80/2M/E7E7E7E701]
INFO:cfclient.utils.logconfigreader:Parsing [stabilizer.json]
INFO:cfclient.utils.logconfigreader:Parsing [Lighthouse.json]
INFO:cfclient.utils.logconfigreader:Parsing [lighhiusetst.json]
INFO:cfclient.ui.tabs.locopositioning_tab:Crazyflie connected to radio://0/80/2M/E7E7E7E701
INFO:cfclient.ui.tabs.locopositioning_tab:Requesting loco deck parameter
INFO:cfclient.ui.tabs.lighthouse_tab:Crazyflie connected to radio://0/80/2M/E7E7E7E701
INFO:cfclient.ui.tabs.lighthouse_tab:Requesting lighthouse deck parameter
INFO:cfclient.ui.tabs.FlightTab:[imu_sensors.AK8963]: 0
INFO:cflib.crazyflie.log:Have successfully started logging for id=8
INFO:cflib.crazyflie.log:Have successfully started logging for id=12
INFO:cfclient.ui.tabs.FlightTab:[imu_sensors.LPS25H]: 0
INFO:cflib.crazyflie.log:Have successfully started logging for id=13
INFO:cfclient.ui.tabs.FlightTab:[imu_sensors.BMP388]: 1
INFO:cfclient.ui.tabs.locopositioning_tab:No Loco deck installed
INFO:cfclient.ui.tabs.locopositioning_tab:No Loco deck installed
INFO:cfclient.ui.tabs.lighthouse_tab:Lighthouse deck installed, enabling the tab
INFO:cfclient.ui.tabs.lighthouse_tab:Lighthouse deck installed, enabling the tab
INFO:cflib.crazyflie.log:Have successfully started logging for id=14
INFO:cfclient.ui.tabs.FlightTab:Changed effect to 0
INFO:vispy:Not setting value for variable vec4 u_translate_6; uniform is not active.
INFO:vispy:Not setting value for variable vec4 u_translate_6; uniform is not active.
INFO:cflib.crtp.radiodriver:Dongle reported ACK status == None
INFO:cflib.crtp.radiodriver:Dongle reported ACK status == None
INFO:cflib.crazyflie.log:Have successfully started logging for id=11
INFO:cflib.crtp.radiodriver:Dongle reported ACK status == None
INFO:cflib.crazyflie.log:Have successfully deleted id=11
INFO:cflib.crazyflie.log:Have successfully started logging for id=10
WARNING:vispy:failed to create compose table
INFO:cflib.crtp.radiodriver:Dongle reported ACK status == None
With "CFLAGS += -DLIGHTHOUSE_AS_GROUNDTRUTH":

Code: Select all

Console:
SYS: ----------------------------
SYS: Crazyflie 2.1 is up and running!
SYS: Build 129:972c5f6edef2 (2021.03 +129) MODIFIED
SYS: I am 0x203937434848500E004A0025 and I have 1024KB of flash!
CFGBLK: v1, verification [OK]
DECK_INFO: Warning! No driver found for deck.
DECK_CORE: 2 deck(s) found
DECK_CORE: Calling INIT on driver bcLighthouse4 for deck 1
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: 19240 bytes
LHFL: Lighthouse bootloader version: 2
STAB: Ready to fly.
LHFL: Bitstream CRC32: 112BC794 [PASS]
LHFL: Firmware version 6 verified, booting deck!

Code: Select all

Log Client after restart cfclient:
INFO:cfclient.utils.input:Selected MUX: Normal
INFO:cfclient.ui.main:Role of Sony PLAYSTATION(R)3 Controller is Device
INFO:cfclient.utils.input.mux:Adding device Sony PLAYSTATION(R)3 Controller to MUX Normal
INFO:cflib.crtp.radiodriver:v99.55 dongle with serial N/A found
INFO:cflib.drivers.cfusb:Looking for devices....
INFO:cflib.crtp.prrtdriver:Initialized PRRT driver.
INFO:cflib.crazyflie:Callback->Connection initialized[radio://0/80/2M/E7E7E7E701]
INFO:cflib.crazyflie:We are connected[radio://0/80/2M/E7E7E7E701], request connection setup
INFO:cflib.crazyflie:Callback->Connected to [radio://0/80/2M/E7E7E7E701]
INFO:cflib.crazyflie.platformservice:Protocol  version: 4
INFO:cflib.crazyflie.toc:TOC for port [5] found in cache
INFO:cflib.crazyflie:Log TOC finished updating
INFO:cflib.crazyflie.mem:7 memories found
INFO:cflib.crazyflie:Memories finished updating
INFO:cflib.crazyflie.toc:TOC for port [2] found in cache
INFO:cflib.crazyflie:Param TOC finished updating
INFO:cflib.crazyflie:Callback->Connection setup finished [radio://0/80/2M/E7E7E7E701]
INFO:cfclient.utils.logconfigreader:Parsing [stabilizer.json]
INFO:cfclient.utils.logconfigreader:Parsing [Lighthouse.json]
INFO:cfclient.utils.logconfigreader:Parsing [lighhiusetst.json]
WARNING:vispy:QObject::connect: Cannot queue arguments of type 'QList<QPersistentModelIndex>'
(Make sure 'QList<QPersistentModelIndex>' is registered using qRegisterMetaType().)
WARNING:vispy:QObject::connect: Cannot queue arguments of type 'QList<QPersistentModelIndex>'
(Make sure 'QList<QPersistentModelIndex>' is registered using qRegisterMetaType().)
WARNING:vispy:QObject::connect: Cannot queue arguments of type 'QList<QPersistentModelIndex>'
(Make sure 'QList<QPersistentModelIndex>' is registered using qRegisterMetaType().)
WARNING:vispy:QObject::connect: Cannot queue arguments of type 'QList<QPersistentModelIndex>'
(Make sure 'QList<QPersistentModelIndex>' is registered using qRegisterMetaType().)
WARNING:vispy:QObject::connect: Cannot queue arguments of type 'QList<QPersistentModelIndex>'
(Make sure 'QList<QPersistentModelIndex>' is registered using qRegisterMetaType().)
WARNING:vispy:QObject::connect: Cannot queue arguments of type 'QList<QPersistentModelIndex>'
(Make sure 'QList<QPersistentModelIndex>' is registered using qRegisterMetaType().)
INFO:cfclient.ui.tabs.locopositioning_tab:Crazyflie connected to radio://0/80/2M/E7E7E7E701
INFO:cfclient.ui.tabs.locopositioning_tab:Requesting loco deck parameter
INFO:cfclient.ui.tabs.lighthouse_tab:Crazyflie connected to radio://0/80/2M/E7E7E7E701
INFO:cfclient.ui.tabs.lighthouse_tab:Requesting lighthouse deck parameter
WARNING:vispy:QObject::connect: Cannot queue arguments of type 'QList<QPersistentModelIndex>'
(Make sure 'QList<QPersistentModelIndex>' is registered using qRegisterMetaType().)
WARNING:vispy:QObject::connect: Cannot queue arguments of type 'QList<QPersistentModelIndex>'
(Make sure 'QList<QPersistentModelIndex>' is registered using qRegisterMetaType().)
WARNING:vispy:QObject::connect: Cannot queue arguments of type 'QList<QPersistentModelIndex>'
(Make sure 'QList<QPersistentModelIndex>' is registered using qRegisterMetaType().)
WARNING:vispy:QObject::connect: Cannot queue arguments of type 'QList<QPersistentModelIndex>'
(Make sure 'QList<QPersistentModelIndex>' is registered using qRegisterMetaType().)
INFO:cfclient.ui.tabs.FlightTab:[imu_sensors.AK8963]: 0
INFO:cflib.crazyflie.log:Have successfully started logging for id=1
INFO:cflib.crazyflie.log:Have successfully started logging for id=5
INFO:cflib.crazyflie.log:Have successfully started logging for id=6
INFO:cfclient.ui.tabs.FlightTab:[imu_sensors.LPS25H]: 0
INFO:cfclient.ui.tabs.FlightTab:[imu_sensors.BMP388]: 1
INFO:cfclient.ui.tabs.locopositioning_tab:No Loco deck installed
INFO:cfclient.ui.tabs.lighthouse_tab:Lighthouse deck installed, enabling the tab
INFO:cflib.crazyflie.log:Have successfully started logging for id=7
INFO:cfclient.ui.tabs.FlightTab:Changed effect to 0
INFO:cflib.crtp.radiodriver:Dongle reported ACK status == None
INFO:vispy:Not setting value for variable vec4 u_translate_6; uniform is not active.
INFO:vispy:Not setting value for variable vec4 u_translate_6; uniform is not active.
INFO:cflib.crtp.radiodriver:Dongle reported ACK status == None
INFO:cflib.crtp.radiodriver:Dongle reported ACK status == None
So far I was not able to take off by the command base flight control and have no idea what I can try next to solve the freezing problem(and after that the:

Code: Select all

INFO:vispy:Not setting value for variable vec4 u_translate_6; uniform is not active.
INFO:vispy:Not setting value for variable vec4 u_translate_6; uniform is not active.
problem).
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: Lighthouse V1, Flight Data and State Estimate freeze

Post by kristoffer »

Hi!

Some of the things you are seeing is probably OK, but I think you are looking at the wrong place. Let's take a few steps back and figure out what is happening.

First, the DISABLE_LIGHTHOUSE_DRIVER compile flag does not exist any more (assuming you are on the 2021.03 release or later). This flag used to be used to enable the lighthouse system while it still was experimental, but now it is fully integrated and this flag has been removed. This also means that there is no need to build a special firmware to use the lighthouse system, you can just use the stock version.

Similarly for the LIGHTHOUSE_FORCE_TYPE flag, this has also been removed. The system type is now set through the client and stored in persistent memory in the Crazyflie. Use the "Change system type" button in the client, https://www.bitcraze.io/documentation/r ... management

Secondly the reason you can only plot lighthouse.x/.y/.z when LIGHTHOUSE_AS_GROUNDTRUTH requires some explanation. The LIGHTHOUSE_AS_GROUNDTRUTH is intended to be used when one wants to use the lighthouse system to get the position of the Crazyflie without passing the position on to the estimator. The use case is when you are making changes to the estimator (using some other sensor for positioning) and want to use the lighthouse system as a reference to compare the results. This is a fairly unusual use case and unless this is what you are doing you should not set the LIGHTHOUSE_AS_GROUNDTRUTH.
The lighthouse system can operate in two different modes (see https://www.bitcraze.io/documentation/r ... g_methods/) and the lighthouse.x/.y/.z is only populated when using the crossing beam method. To get the estimated position (regardless of positioning method or system) you should use stateEstimate.x/.y/.z instead.
So far I was not able to take off by the command base flight control
This is because you essentially turned off the positioning support when enabling the LIGHTHOUSE_AS_GROUNDTRUTH flag. It should work fine without the flag (or the stock firmware).


Now to the freezing problem, this I'm not sure about but it sounds as the log data stops being received when it freezes. This indicates that there might be a problem with the radio link? Have you tried to connect via USB instead to see if you get the same problem?

Are you using the 2021.03 release for both client and firmware?

I don't think you should worry too much about the vispy log messages. It is only used for the 3D views in the lighthouse and loco tabs and should not be related to your problems.
dpl
Beginner
Posts: 7
Joined: Thu May 20, 2021 8:41 am

Re: Lighthouse V1, Flight Data and State Estimate freeze

Post by dpl »

Hi kristoffer,

I appreciate your detailed explanation! It helps a lot to understand the things, thank you very much.

I am using the Crazyrradio PA via USB and even tried different slots. Before switching to the VM, I was working with a Raspberry Pi and the same radio. With the Clientversion 2020.09 on Ubuntu 18.04 it works as supposed to be (real time updating of all flight data).

Now on the VM the version of the Cfclient is 2021.4.post13f25f72d and the firmware from recentl warm bootloading is now 2021.03 - firmware-cf2-2021.03.zip.
I can not interact with the Command Based Flight Control at the moment. But I was able to get some more infos about the freezing:

As soon as I connect the Crazyflie with the Cfclient, the values for the flight data and the state estimator get updates. It seems to be freezing around the time (before or while), the lighthousedeck is detected and installed.
(When I connect to the Crazyflie 2.1 and immediately go into the plotting tab and plot the state estimate values, it takes a little bit longer till it freezes)


Kind regards
dpl
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: Lighthouse V1, Flight Data and State Estimate freeze

Post by kristoffer »

This might be related to the python lib. We have been trying to switch to a new implementation of the link which turned out to not work that well. That change was reverted in b56d4fa and you could try to get the lates version of the lib to see if that makes any difference. You might have to uninstall the old lib first (not sure)

in a terminal, in the cflib directory do something like this:

Code: Select all

pip3 uninstall cflib
git pull
pip3 install -e .
dpl
Beginner
Posts: 7
Joined: Thu May 20, 2021 8:41 am

Re: Lighthouse V1, Flight Data and State Estimate freeze

Post by dpl »

Hello kristoffer,

so far updating the latest python lib didnt work. But the estimation works onboard fine and can be used to further work with it.
So its seems it is just some visual bug with the cfclient.
Thank you very much for your response and help.

Kind regards
dpl
Post Reply