get_bs_geometry.py cannot import 'LighthouseBsGeometry'

Topics related to the Lighthouse positioning system, configuration and use
Post Reply
cgpenguin
Member
Posts: 35
Joined: Wed Aug 05, 2020 3:49 pm

get_bs_geometry.py cannot import 'LighthouseBsGeometry'

Post by cgpenguin »

Hey, I've been trying to follow along https://www.bitcraze.io/documentation/r ... _overview/ to get the Crazyflie drone setup with Lighthouse deck.

I have set up the 2 base stations (positioned them, connected via the link wire, set one to b, other to c and turned them on. I wonder if there's anything else that could be required to be done here.

Afterwards I've flashed the drone with the firmware with lighthouse drivers enabled.

Now I tried running the get_bs_geometry.py script, but I get this error:

Code: Select all

Traceback (most recent call last):
    File "tools/lighthouse/get_bs_geometry.py", line 53 in <module>
        from cflib.crazyflie.mem import LighthouseBsGeometry
ImportError: cannot import name 'LighthouseBsGeometry'
I am currently not sure where the cflib import is coming from so I am struggling to find the source of the issue. Hoping someone can help out.
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: get_bs_geometry.py cannot import 'LighthouseBsGeometry'

Post by kimberly »

It seems like you are using a old version of the python library cflib.

Could you let us know what you see when you get the version? you can do it like this:

Code: Select all

pip3 freeze | grep cflib
cgpenguin
Member
Posts: 35
Joined: Wed Aug 05, 2020 3:49 pm

Re: get_bs_geometry.py cannot import 'LighthouseBsGeometry'

Post by cgpenguin »

kimberly wrote: Thu Aug 06, 2020 8:16 am It seems like you are using a old version of the python library cflib.

Could you let us know what you see when you get the version? you can do it like this:

Code: Select all

pip3 freeze | grep cflib
It returns 0.1.7

Wanted to note that I am running the VM and have updated the software as recently as yesterday.
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: get_bs_geometry.py cannot import 'LighthouseBsGeometry'

Post by kimberly »

Thanks!

You are using an old version of the cflib. The current version is 0.1.11 and this script is pretty new so. You can either install the new version through the pip official release:

Code: Select all

pip3 install --upgrade cflib
or you can install it from source, so in the folder of crazyflie-lib-python run:

Code: Select all

pip3 install -e .
cgpenguin
Member
Posts: 35
Joined: Wed Aug 05, 2020 3:49 pm

Re: get_bs_geometry.py cannot import 'LighthouseBsGeometry'

Post by cgpenguin »

Thank you, that appears to have been the issue.

I had to run this tho:

Code: Select all

pip3 install --upgrade cflib
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: get_bs_geometry.py cannot import 'LighthouseBsGeometry'

Post by kimberly »

Yes you are right that was a typo, it needs to be pip3. I updated my comment above. Thanks!
Post Reply