lighthousev2 get_bs_geometry is not working well

Topics related to the Lighthouse positioning system, configuration and use
Post Reply
habemsu
Beginner
Posts: 4
Joined: Tue Feb 02, 2021 1:42 am

lighthousev2 get_bs_geometry is not working well

Post by habemsu »

Hi, I got the lighthouse deck and now testing it
My setting is cf2.1 with lighthouse deck and two BS v2

Now, I'm following the
'Setting up the lighthouse system
Home / Documentation / Repositories / crazyflie-firmware / master / Functional areas / The Lighthouse positioning system / Setting up the lighthouse system'

1. Added two lines in the bottom of Makefile in firmware foler
CFLAGS += -DDISABLE_LIGHTHOUSE_DRIVER=0
CFLAGS += -DLIGHTHOUSE_FORCE_TYPE=2

2. build and flash

3. changed the modes of two basestation 1 and 2 with picocom

4. get calibration data of two BSs and edit persist_bs_data.py and runned it

but at the step 5. get geometry data of BSs by running 'get_bs_geometry.py'
terminal shows me

Connecting to radio://0/2/2M
Connected to radio://0/2/2M
Reading sensor data...

and it stops

when I quit it then it looks like

Connecting to radio://0/2/2M
Connected to radio://0/2/2M
Reading sensor data...
^CTraceback (most recent call last):
File "tools/lighthouse/get_bs_geometry.py", line 154, in <module>
estimator.estimate(uri, args.write)
File "tools/lighthouse/get_bs_geometry.py", line 78, in estimate
self.collection_event.wait()
File "/usr/lib/python3.6/threading.py", line 551, in wait
signaled = self._cond.wait(timeout)
File "/usr/lib/python3.6/threading.py", line 295, in wait
waiter.acquire()
KeyboardInterrupt


Is there something I missed or do I need to connect vive hmd?
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: lighthousev2 get_bs_geometry is not working well

Post by kristoffer »

Hi!

Which version of the firmware and lib are you using?

If you are using the 2021.01 release the instructions on the web should be fine.

If you are using the lates and greatest of crazyflie-firmware/python lib/python client you should be able to do the full setup from within the client. There is no documentation yet but the quick version is:
1. Compile the firmware with the compile flags you describe (this will soon be gone as well) and flash the CF. The only modification you should do to the FW is the compile flags, no geo or calibration data should be added to the firmware.
2. Run the client and open the lighthouse tab
3. Put the Crazyflie on the floor where you want the origin
4. Wait for the calibration indicators in the client to turn green or orange
5. Click the "manage geometry" button and estimate the geometry. Save to the Crazyfle

At this point the geometry and calibration data will be saved in the CF. After start up the CF should be ready to us the lighthouse system wihthout any further changes.

There are a lot of changes now related to lighthouse (we are working on the first official release) and it is a bit tricky to help you since I don't know the state of your software.
habemsu
Beginner
Posts: 4
Joined: Tue Feb 02, 2021 1:42 am

Re: lighthousev2 get_bs_geometry is not working well

Post by habemsu »

The latest blog post was lh2 tutorial and I followed the steps
And It was not working
When I upload the new firmware with cfclient and connect then
only Calibration and Geometry tabs are blue or green, the Receiving tab is still red and the lighthouse deck get only one blue led

And fortunately I got one more lighthouse deck and It works well
The deck got green led and could see the green status on Receiving

In my opinion the past step I did for example 'persist_bs_data.py' may cause malfunction?
Or do I need to reset the deck with something like 'lh fpga builder'?
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: lighthousev2 get_bs_geometry is not working well

Post by kristoffer »

Hi!

It sounds like the firmware (FPGA binary) in the lighthouse deck has not been updated to the latest version. This binary is updated as a part of the normal flashing process and for this to work the deck must be mounted on the Crazyflie while flashing. After the STM and NRF firmware has been flashed, the system flashes the lighthouse deck if it is mounted. You can see it in the "Getting started with the Lighthouse positioning system" video here https://youtu.be/DCEHht72B08?t=75

Note 1: The binary of the lighthouse deck used to be part of the crazyflie firmware and when a lighthouse deck was detected, the Crazyflie flashed the binary onto the lighthouse deck. We changed this behaviour as the lighthouse deck binary is very large and used too much space in the crazyflie firmware, instead the lighthouse deck binary is flashed directly to the deck during the flashing process. This is why the deck must be mounted when flashing.

Note 2: if you have two decks you must flash them both using the above process.

There should not be any need to reset the deck or similar. Data you may have stored previously with 'persist_bs_data.py' is stored in the persistant memory of the Crazyflie and should be handled by the latest firmware. As a side note the client is essentially doing what the scripts used to do and the functionality is very similar.
habemsu
Beginner
Posts: 4
Joined: Tue Feb 02, 2021 1:42 am

Re: lighthousev2 get_bs_geometry is not working well

Post by habemsu »

I followed the step on the video, flashed process with deck must be mounted on the Crazyflie while flashing.
I used one CF2.1 and two lh decks, so the first lh decks didn't work well and second thing worked well
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: lighthousev2 get_bs_geometry is not working well

Post by arnaud »

Can you explain in more details what works and what does not? Are you seeing the symptom I described in this other post for one of the deck? viewtopic.php?p=21928#p21928
Post Reply