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?
I would really appreciate it if you could provide me with the code as it would help me immensely in my presentation.
2D Mapping using Crazyflie Stem Range Bundle
-
- Beginner
- Posts: 3
- Joined: Thu Jan 30, 2020 9:40 pm
-
- Bitcraze
- Posts: 630
- Joined: Tue Jun 30, 2015 7:47 am
Re: 2D Mapping using Crazyflie Stem Range Bundle
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
, it will force z=0.
If you also want to move the Crazyflie position to the XY-plane, add
after https://github.com/bitcraze/crazyflie-l ... ud.py#L351
This would give you a 2D mapping, still visualized in 3D though.
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
If you also want to move the Crazyflie position to the XY-plane, add
Code: Select all
o[2] = 0.0
This would give you a 2D mapping, still visualized in 3D though.
-
- Beginner
- Posts: 3
- Joined: Thu Jan 30, 2020 9:40 pm
Re: 2D Mapping using Crazyflie Stem Range Bundle
Thank you. Should I also lower the sensor threshhold for more stability?
What does the sensor_threshold do?
What does the sensor_threshold do?
-
- Bitcraze
- Posts: 630
- Joined: Tue Jun 30, 2015 7:47 am
Re: 2D Mapping using Crazyflie Stem Range Bundle
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?
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?
-
- Beginner
- Posts: 3
- Joined: Thu Jan 30, 2020 9:40 pm
Re: 2D Mapping using Crazyflie Stem Range Bundle
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
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
Check out this forum thread: viewtopic.php?f=2&t=3556&p=16955&hilit=indi#p16955. They are talking about the same issue