Lighthouse calibration data inconsistency[2021.03]

Topics related to the Lighthouse positioning system, configuration and use
Post Reply
PB_
Beginner
Posts: 7
Joined: Tue Nov 17, 2020 10:35 am

Lighthouse calibration data inconsistency[2021.03]

Post by PB_ »

Hello,
With the new firmware update [2021.03], it enables us to get the lighthouse calibration data without connecting the lighthouse HTC and running get_lh2_calib_data.py by using the cfclient lighthouse positioning tab and pressing "save system config" to a file. Interestingly, the results for these two methods are a bit different. I have tested on two different lighthouses and here is the result:

# Lighthouse ID 0
Calibration data taken by running get_lh2_calib_data.py
calib = LighthouseBsCalibration()
calib.sweeps[0].tilt = -0.051256
calib.sweeps[0].phase = 0.000000
calib.sweeps[0].curve = 0.219455
calib.sweeps[0].gibphase = 0.297089
calib.sweeps[0].gibmag = 0.002789
calib.sweeps[0].ogeephase = 1.057162
calib.sweeps[0].ogeemag = -0.294214
calib.sweeps[1].tilt = 0.047382
calib.sweeps[1].phase = -0.007888
calib.sweeps[1].curve = 0.201096
calib.sweeps[1].gibphase = 2.393739
calib.sweeps[1].gibmag = 0.001525
calib.sweeps[1].ogeephase = 1.663794
calib.sweeps[1].ogeemag = -0.299672
calib.uid = 0xCA34274D
calib.valid = True

Calibration data taken from the drone through cfclient
calibs:
0:
sweeps:
- curve: 0.219482421875
gibmag: 0.002788543701171875
gibphase: 0.297119140625
ogeemag: -0.294189453125
ogeephase: 1.0263671875
phase: 0.0
tilt: -0.05126953125
- curve: 0.2010498046875
gibmag: 0.0015249252319335938
gibphase: 2.39453125
ogeemag: -0.299560546875
ogeephase: 1.5390625
phase: -0.0078887939453125
tilt: 0.047393798828125
uid: 3392415565

# Lighthouse ID 1
Calibration data taken by running get_lh2_calib_data.py
calib = LighthouseBsCalibration()
calib.sweeps[0].tilt = -0.053395
calib.sweeps[0].phase = 0.000000
calib.sweeps[0].curve = -0.061774
calib.sweeps[0].gibphase = 0.877603
calib.sweeps[0].gibmag = 0.006164
calib.sweeps[0].ogeephase = 1.318368
calib.sweeps[0].ogeemag = -0.478133
calib.sweeps[1].tilt = 0.040229
calib.sweeps[1].phase = -0.004564
calib.sweeps[1].curve = 0.319465
calib.sweeps[1].gibphase = 1.936239
calib.sweeps[1].gibmag = 0.004988
calib.sweeps[1].ogeephase = 1.594082
calib.sweeps[1].ogeemag = -0.524871
calib.uid = 0x78CC8836
calib.valid = True


Calibration data taken from the drone through cfclient
calibs:
1:
sweeps:
- curve: -0.061767578125
gibmag: 0.00616455078125
gibphase: 0.87744140625
ogeemag: -0.47802734375
ogeephase: 1.318359375
phase: 0.0
tilt: -0.05340576171875
- curve: 0.319580078125
gibmag: 0.0049896240234375
gibphase: 1.9365234375
ogeemag: -0.52490234375
ogeephase: 1.6015625
phase: -0.004566192626953125
tilt: 0.04022216796875
uid: 2026670134

Notice that the UID for both lighthouses are the same when converted from hex to decimal. However, the decimal point of each components is not the same especially after the 4th decimal points. Any idea on why the values of the reading is different? Could it be because of the floating point precision of the cfclient python?
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: Lighthouse calibration data inconsistency[2021.03]

Post by kristoffer »

Yes it is caused by the floating point precession
The base station uses 6 decimals, so a dump (via USB) on one bs return this

Code: Select all

lhtx> param list fcal
fcal.0.tilt -0.043805
fcal.0.phase 0.000000
fcal.0.curve 0.209360
fcal.0.gibphase 2.255891
fcal.0.gibmag 0.002426
fcal.0.ogeephase 1.676551
fcal.0.ogeemag -0.404206
fcal.1.tilt 0.044965
fcal.1.phase -0.011970
fcal.1.curve 0.161876
fcal.1.gibphase 0.418642
fcal.1.gibmag -0.004702
fcal.1.ogeephase 2.246912
fcal.1.ogeemag -0.264879
similarly the data that is transmitted in the light sweeps are 16 bit floats.

The client uses standard python floats
Post Reply