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 »

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: 2013
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Get raw measurement from the flow deck V2

Post by tobias »

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 »

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

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

Re: Get raw measurement from the flow deck V2

Post by kristoffer »

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 »

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: 470
Joined: Fri Jul 06, 2018 11:13 am

Re: Get raw measurement from the flow deck V2

Post by kimberly »

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 »

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: 2013
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Get raw measurement from the flow deck V2

Post by tobias »

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 »

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: 2013
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Get raw measurement from the flow deck V2

Post by tobias »

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