I have written an example project Scan360 on github to spin the GoPiGo 360 degrees,
taking Distance Sensor readings as fast as possible,
then printing out the 360 degree view as the GoPiGo3 saw the world.
This example does not use the servo.
(If you have the distance sensor mounted on a servo, center the servo before running the example.)
SPIN 360 AND SCAN at speed=100
Map: 90 deg
----------------------------------------------------------------------------- 48 cm
| |
| |
| |
| |
| o |
| |
| o o |
| o |
| o o o o |
| o o |
| o o |
| |
| o |
| o |
| o |
| o |
| o |
| o + o 0 180 deg
| |
| o o |
| |
| o |
| o o |
| |
| o |
| o o o |
| o o o o |
| o o o |
| |
| |
| |
| |
| |
| |
| |
--------------------------------------0-------------------------------------- 48 cm
Each '-' is 1.3 cm Each '|' is 2.7 cm
Closest Object: 23.5 cm Farthest Valid Object: 48.1 cm
Farthest Reading: 300.0 cm
It uses the view360() function in the project’s printmaps.py module to display the world.
(I’m going to post a separate topic on the printmaps.py module because it has lots more goodies.)