Page 1 of 1

Difference between zRange.c and zRange2.c

Posted: Tue Feb 16, 2021 1:51 am
by jingke
Hi,
I am working on detecting the uneven surface of Crazyflie. I read through an old post which is in viewtopic.php?p=15529#p15529.

I don't quite understand the difference between zRanger.c and zRanger2.c, where are they being used? And there are several constants that are different, what's the meaning of that? Those two files are in the fw/src/deck/drivers.

Thanks!

Re: Difference between zRange.c and zRange2.c

Posted: Tue Feb 16, 2021 8:47 am
by kimberly
Hi!

These are technically the deck drivers that handle the Flowdeck V1 and V2 or the z-ranger deck (you can check it on the store right here). The V1 is the older product that uses the VL53L0x time-of-flight sensor and the V2 uses the newer vl53l1x, which has a larger range than the previous one.

So if you are using a flowdeck V2 or ranger V2, you only need to worry about zranger2.c

Re: Difference between zRange.c and zRange2.c

Posted: Tue Feb 16, 2021 11:33 pm
by jingke
Thanks for your help!

I will try to change the variable from zRanger2.c. But I found that I am using the flow deck, there is an extra camera on the flow deck. What is that used for or which function is using the camera?

Re: Difference between zRange.c and zRange2.c

Posted: Wed Feb 17, 2021 7:26 am
by kristoffer
The camera is an optical flow sensor. It essentially works like the sensor on an optical mouse and detects motion in x and y. The motion output form the flow sensor in combination with the distance to the ground (measured by the distance sensor on the deck) it is possible to determine how the Crazyflie is moving in relation to the ground. This functionality provides relative positioning and can be used for simple autonomous flight.