Page 1 of 1

2D Mapping using Crazyflie Stem Range Bundle

Posted: Thu Jan 30, 2020 9:50 pm
by JMaktabi15
I am currently using the CrazyFlie stem ranging bundle for a final year engineering project. The title of our project is Machine learning assisted SLAM.

Could you please share with me the code used for the 2-Dimensional mapping used in the demo video for the stem ranging plus. I have accessed your library but couldn't find it. I found a 3D Mapping code.

The code I used is: https://github.com/bitcraze/crazyflie-l ... ntcloud.py
The video in question is the following: https://youtu.be/pIBM6RPggcs

I have made several runs using the 3d code using a similar set up as yours. However, the output mapping was no where near the result you got. The output is messy and unclear. I am running the drone in a high ceiling warehouse but I am still getting z-axis interference. How can I get rid of the unnecessary noise and get a clearer mapping?
WhatsApp Image 2020-01-30 at 3.15.00 PM.jpeg
I would really appreciate it if you could provide me with the code as it would help me immensely in my presentation.

Re: 2D Mapping using Crazyflie Stem Range Bundle

Posted: Fri Jan 31, 2020 9:04 am
by kristoffer
Hi!

I'm fairly sure the code we used in the demo was the one you pointed out (https://github.com/bitcraze/crazyflie-l ... ntcloud.py) and that it actually is a 3D mapping viewed from the top.

If you want to remove the top sensor, you could remove these lines from the code https://github.com/bitcraze/crazyflie-l ... #L320-L322

If you want to put all points in the XY-plane, change this line https://github.com/bitcraze/crazyflie-l ... ud.py#L311 to

Code: Select all

        tmp3 = np.add(tmp2, origin)
        tmp3[2] = 0.0
        return tmp3
, it will force z=0.

If you also want to move the Crazyflie position to the XY-plane, add

Code: Select all

        o[2] = 0.0
after https://github.com/bitcraze/crazyflie-l ... ud.py#L351

This would give you a 2D mapping, still visualized in 3D though.

Re: 2D Mapping using Crazyflie Stem Range Bundle

Posted: Fri Jan 31, 2020 1:51 pm
by JMaktabi15
Thank you. Should I also lower the sensor threshhold for more stability?

What does the sensor_threshold do?

Re: 2D Mapping using Crazyflie Stem Range Bundle

Posted: Fri Jan 31, 2020 2:09 pm
by kristoffer
SENSOR_TH = 2000
Sensor readings larger than SENSOR_TH (2 meters in this case) will be discarded. I think it is intended to cut out readings that are in "open space". Feel free to play with it and see what happens.

What kind of stability problems do you see?

Re: 2D Mapping using Crazyflie Stem Range Bundle

Posted: Fri Jan 31, 2020 3:07 pm
by JMaktabi15
When the drone goes into relatively tight or closed spaces it starts to drift and shake heavily.

Re: 2D Mapping using Crazyflie Stem Range Bundle

Posted: Mon Feb 03, 2020 11:15 am
by kimberly
That is to be expected. The controller is not fast enough to deal with the windgusts created by the motors itself.

Check out this forum thread: viewtopic.php?f=2&t=3556&p=16955&hilit=indi#p16955. They are talking about the same issue