Get raw measurement from the flow deck V2

Discussions and questions about the Crazyflie Nano Quadcopter
emoyers
Beginner
Posts: 12
Joined: Sat Feb 08, 2020 5:26 pm

Get raw measurement from the flow deck V2

Post by emoyers » Sat Feb 08, 2020 5:32 pm

Hello I'm trying to get the raw measurement from the flow deck v2 but I was not able to do it. Does anyone can point what is the way to do in using crazyflie-lib-python repository? Currently, I'm using the example mutiranger_psuh.py in the same repo, in that I can get the measurements from the multiranger deck but not from the flow deck. Any help will be appreciated.



tobias
Bitcraze
Posts: 1969
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Get raw measurement from the flow deck V2

Post by tobias » Mon Feb 10, 2020 10:24 am

The raw flow measurements you can get from the motion logging variables located here. motion.deltaX and moton.deltaY is the raw flow outputs.

emoyers
Beginner
Posts: 12
Joined: Sat Feb 08, 2020 5:26 pm

Re: Get raw measurement from the flow deck V2

Post by emoyers » Tue Feb 18, 2020 2:05 am

how can I access this raw measurement if I'm using the crazyflie-lib-python?

kristoffer
Bitcraze
Posts: 209
Joined: Tue Jun 30, 2015 7:47 am

Re: Get raw measurement from the flow deck V2

Post by kristoffer » Tue Feb 18, 2020 7:40 am

There are two examples in the python lib repository (examples/basiclogSync.py and examples/basiclog.py) that is a good starting point.

emoyers
Beginner
Posts: 12
Joined: Sat Feb 08, 2020 5:26 pm

Re: Get raw measurement from the flow deck V2

Post by emoyers » Mon Feb 24, 2020 2:22 am

hello @kristoffer, I don't see in any of those files raw measurement from the flow deck, can you expand more on why you recommend me those files for reading the flow deck measuremets?

kimberly
Bitcraze
Posts: 255
Joined: Fri Jul 06, 2018 11:13 am

Re: Get raw measurement from the flow deck V2

Post by kimberly » Mon Feb 24, 2020 7:50 am

Hi!

So you need to also look at Tobias' answer as well. The logging names for the values you are looking for are motion.deltaX and motion.deltaY, which you will need to retrieve by the scripts that Kristoffer is referring too. Right now, those scripts show different logging variables as an example, so you will need to replace those with the ones you want to read out.

This is the way how to read out logging variables from the crazyflie python lib if you do not want to use the cfclient to do this. Just give it a try and let us know if you have managed to do this.

emoyers
Beginner
Posts: 12
Joined: Sat Feb 08, 2020 5:26 pm

Re: Get raw measurement from the flow deck V2

Post by emoyers » Wed Mar 11, 2020 2:49 am

Thanks for the reply @kimberly, @kristoffer and @tobias :) . I know understood. Another question, with which variable or variable I can get the actual distance to the ground or at least to the closest object down the CF instead of just the delta? or do I need to use the deltas to calculate it myself?

tobias
Bitcraze
Posts: 1969
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Get raw measurement from the flow deck V2

Post by tobias » Wed Mar 11, 2020 11:53 am

The distance from the laser ranger sensor, VL53L01, can be retrieved from the range.zrange logging variable.

emoyers
Beginner
Posts: 12
Joined: Sat Feb 08, 2020 5:26 pm

Re: Get raw measurement from the flow deck V2

Post by emoyers » Thu Mar 12, 2020 1:14 am

Ok. to read the value, do I need to use " cflib.crazyflie.log import LogConfig" or can I use "cflib.utils.multiranger import Multiranger" ?

tobias
Bitcraze
Posts: 1969
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Get raw measurement from the flow deck V2

Post by tobias » Thu Mar 12, 2020 9:25 am

You could use the Multiranger class but it would be a bit inefficient as it will also start logging 5 other none present sensors that would just give 0. Perhaps use the Multiranger class as inspiration to setup you own log config or check the basiclog.py, basiclogSync.py examples.

Post Reply