Difference between zRange.c and zRange2.c

Discussions about all things Bitcraze
Post Reply
jingke
Beginner
Posts: 4
Joined: Fri Feb 05, 2021 4:42 am

Difference between zRange.c and zRange2.c

Post 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!
kimberly
Bitcraze
Posts: 1050
Joined: Fri Jul 06, 2018 11:13 am

Re: Difference between zRange.c and zRange2.c

Post 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
jingke
Beginner
Posts: 4
Joined: Fri Feb 05, 2021 4:42 am

Re: Difference between zRange.c and zRange2.c

Post 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?
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: Difference between zRange.c and zRange2.c

Post 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.
Post Reply