Page 1 of 1

Lighthouse deck with only one Basestation?

Posted: Thu Sep 17, 2020 12:23 pm
by borat22
Hi,

i can not figure out how to setup the crazyflie 2.0 with the light house deck & one basestation V1.
According to the website one basestation is enough for the lighthouse deck to work.
I want to get the position of the crazyflie, so that the crazyflie can interact with the vr system.
I followed the wiki setup guide and did this:

1. I ran get_bs_position.py to get this:
Opening OpenVR
OpenVR Opened
Origin: {} [0, 0, 0]
-------------------------------
{.origin = {1.484661, -0.578013, 2.189887, }, .mat = {{-0.820973, -0.388698, -0.418232, }, {0.298286, -0.916569, 0.266321, }, {-0.486857, 0.093889, 0.868421, }, }},

2. Then i make an edit in lighthouse_position_est.c:
baseStationGeometry_t lighthouseBaseStationsGeometry[PULSE_PROCESSOR_N_BASE_STATIONS] = {
{.origin = {1.484661, -0.578013, 2.189887, }, .mat = {{-0.820973, -0.388698, -0.418232, }, {0.298286, -0.916569, 0.266321, }, {-0.486857, 0.093889, 0.868421, }, }},
};
is that the correct declaration with one basestation ??

3. Then i created config.mk with:
CFLAGS += -DDISABLE_LIGHTHOUSE_DRIVER=0

4. After building and flashing the firmware on the crazyflie, i end up with this console log from the cfclient:

SYS: ----------------------------
SYS: Crazyflie 2.0 is up and running!
SYS: Build 0:12cf59a535a8 (2020.09) MODIFIED
SYS: I am 0x3335303035364711003A002E 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
MPU9250 I2C connection [OK].
AK8963 I2C connection [OK].
LPS25H I2C connection [OK].
ESTIMATOR: Using Kalman (2) estimator
CONTROLLER: Using PID (1) controller
MTR-DRV: Using brushed motor driver
EEPROM: I2C connection [OK].
AK8963: Self test [OK].
STAB: Wait for sensor calibration...
SYS: FreLHFL: Lighthouse bootloader version: 2
e heap: 11912 bytes
STAB: Ready to fly.
LHFL: Firmware version 5 verified, booting deck!
LH: Locking to V1 system
Got calibration from F82489D4
phase0: -0.014328
phase1: 0.015136

Sometimes i get this message:
ESTKALMAN: State out of bounds, resett


I logged values lighthouse.x,y,z & kalman.stateX,stateY,stateZ, these values jumping around making no sense.
How do i get the x,y,z position with the help of one basestation and the lighthouse deck ?

Thanks for the reply in advance.

Re: Lighthouse deck with only one Basestation?

Posted: Thu Sep 17, 2020 3:02 pm
by kristoffer
It looks pretty good to me.
Your geometry data is reasonable, the deck detects that it is LH1 and you get calibration data, so there are a lot of things working.
I don't know what the problem might be, but a good start is to check out the angles that are detected by the system by logging lighthouse.angle0x and lighthouse.angle0y. Move the CF around a bit and make see if they behave nicely.

You could also try to run tools/lighthouse/get_bs_geometry.py to see if you get similar results to get_bs_position.py
ESTKALMAN: State out of bounds, reset
means that the position estimator can not make sens of the data. My guess is that it does not get any useful (or conflicting) data from the lighthouse.

Can it be that your base station is not configured as master (not sure if that works at all though)? In that case the wrong geometry data would be used. You could try to add the same geometry data twice to make sure you get the right data regardless of bs config.