Questions about 'multiranger_pointcloud.py'

Discussions about all things Bitcraze
Post Reply
Eunju Jeong
Beginner
Posts: 4
Joined: Thu Mar 03, 2022 5:26 am

Questions about 'multiranger_pointcloud.py'

Post by Eunju Jeong »

Hi,
I have two questions in 'mulitranger_pointcloud.py'

Question 1)
What does 'SENSOR_TH' in line 85 mean? and why did you set it to 2000?

Question 2)
Are the values stored in 'range.front', 'range.back', 'range.up', 'range.zrange', 'range.left' and 'range.right'
in line 183-195 the distance between crazyflie and the wall? and what's the unit? (for example, 449mm)

When I print 'data', I get
{'range.front' : 449, 'range.back' : 484, 'range.up' : 29947, 'range.left' : 153, 'range.right' : 322, 'range.zrange' : 201, 'stabilizer.roll' : -9.568, 'stabilizer.pitch' : -10.394, 'stabilizer.yaw' : -19.235}
like this.

Thank you:)
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: Questions about 'multiranger_pointcloud.py'

Post by kristoffer »

Code: Select all

# Set the sensor threshold (in mm)
SENSOR_TH = 2000
Samples with a distance larger than SENSOR_TH are discarded, the main reason being to remove out of range measurements.
This code was probably written for a prototype using an older sensor and there might be room for improvements for this script. For instance, the maximum range is longer for the current sensor, and you can probably increase the 2000 mm if you want to. I also think that "out of range" measurements can produce weird values, see https://github.com/bitcraze/crazyflie-f ... issues/874

Yes the range.xxx log variable contains the distance measured by the sensors, in mm (see https://www.bitcraze.io/documentation/r ... ogs/#range)

You can find documentation of all log variables here https://www.bitcraze.io/documentation/r ... /api/logs/
Post Reply