Drone Swarming with HTC Vive

Topics related to the Lighthouse positioning system, configuration and use
skyfall
Beginner
Posts: 14
Joined: Thu Aug 06, 2020 8:04 am

Re: Drone Swarming with HTC Vive

Post by skyfall »

I would say that the crazyflie is relatively new though. I only got it out of the box when I started this project. As for the firmware, must I download both the firmware-cf2-2020.06.zip and firmware-tag-2020.60.zip? This is because I only downloaded the firmware-cf2-2020.06.zip from GitHub.If both zip files are required, how do I load 2 files into the crazyflie?

Additionally, what is the difference between flashing the firmware from the cf2 client, and using the 'make cload' code within the terminal? From the start of my project, I have updated the project files by clicking on the "Update all Projects" located on the desktop in the Virtual Machine. Wouldn't that mean that the firmware is already updated to the latest version already?
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: Drone Swarming with HTC Vive

Post by kristoffer »

For the Crazyflie you should use the firmware-cf2-2020.06.zip file (the tag file is for Tags such as the Roadrunner).
When flashing a zip file through the client, the firmware for both the NRF and STM CPUs are updated. When you flash using cload, only the STM firmware is updated.
If you flashed the zip a while ago it is probably fine, the NRF firmware is not updated very often.
Note: since you are using the lighthouse, you must use firmware compiled with lighthouse support, which the stock firmware does not have.

Have you compiled your own firmware with lighthouse support enabled (using CFLAGS += -DDISABLE_LIGHTHOUSE_DRIVER=0)?
skyfall
Beginner
Posts: 14
Joined: Thu Aug 06, 2020 8:04 am

Re: Drone Swarming with HTC Vive

Post by skyfall »

Yes, I followed according to the instructions from the Lighthouse Positioning system documentation. When I run the read_geometry-mem.py at the same position where I collaborated the base stations, it gives me a different coordinates from the get_bs_geometry.py value.
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Drone Swarming with HTC Vive

Post by kimberly »

Ah good you found that script! Good thing to check it indeed.

How much is the geometry off ? It is okay if it is a little different, since you are not able to put it exactly on the same place. Could you copy past both geometries here in the forum post (both from mem and from the script).?
skyfall
Beginner
Posts: 14
Joined: Thu Aug 06, 2020 8:04 am

Re: Drone Swarming with HTC Vive

Post by skyfall »

This is the data I get from get_bs_geometry.py

Code: Select all

{.origin = {-2.773810, -2.199236, 1.834268, }, .mat = {{0.728328, -0.482620, 0.486432, }, {0.383960, 0.875410, 0.293653, }, {-0.567550, -0.027105, 0.822892, }, }},
{.origin = {2.383540, 0.506718, 1.828065, }, .mat = {{-0.786229, 0.534507, -0.310074, }, {-0.475747, -0.843818, -0.248264, }, {-0.394345, -0.047676, 0.917725, }, }},
This is the data when I get the data from read_geometry.py after updating the firmware with the get_bs_geometry.py's data being entered in lighthouse_position_est.c.

Code: Select all

Requesting data
origin: [-1.9584829807281494, 0.5422989726066589, 3.152726888656616]
rotation matrix:  [[0.7972149848937988, -0.004273999948054552, 0.6036810278892517], [0.0, 0.9999750256538391, 0.007079999893903732], [-0.6036959886550903, -0.005644999910145998, 0.7971950173377991]]
origin: [1.0623979568481445, -2.563488006591797, 3.1123669147491455]
rotation matrix:  [[0.018067000433802605, -0.9993360042572021, 0.03164700046181679], [0.7612509727478027, 0.034269001334905624, 0.6475520133972168], [-0.6482059955596924, 0.012392000295221806, 0.7613639831542969]]
The most significant difference is the Z-Axis.
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Drone Swarming with HTC Vive

Post by kimberly »

The second print out from the _mem.py script are actually the default values, so something is still not going right.

Did you do a good make clean && make && make cload ?

If you look in the console tab of your cfclient (view/tabs/console), does the printout say 'Build .... MODIFIED' or 'SYS: Build ... CLEAN'. If you changed to geometry values in lighthouse_postion_est.c and did't git commit your changes (only locally saving it on your machine), it should say MODIFIED.
skyfall
Beginner
Posts: 14
Joined: Thu Aug 06, 2020 8:04 am

Re: Drone Swarming with HTC Vive

Post by skyfall »

Yes it seems like I did not run Make Clean and Make all before Make Cload. Made a careless mistake right there. Manage to get the correct reading from the read_geometry.py and execute the example script successfully. Thanks a lot, Kimberly and Kristoffer! Will explore the example codes and modify the codes there to make my own swarm.
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: Drone Swarming with HTC Vive

Post by kristoffer »

Great, I'm happy it works!
Post Reply