Turning The GoPiGo Into An Obstacle Detection Robot Using Ultrasonic Waves - Part 6

Tuesday, July 26, 2016

Detection systems such as LIDAR (Light Detection And Ranging) and RADAR (Radio Detection And Ranging), use laser and radio to map and detect targets and objects. Instead of using the light of a laser or radio frequencies, we are going to use the ultrasonic sensor mounted on the GoPiGo to turn the GoPiGo robot car into an obstacle detection robot.

We are essentially creating an Ultrasonic Detection And Ranging (USDAR) that will use the distance reading from the ultrasonic sensor to create a LIDAR 2D mapping that uses the same principle as RADAR.

I have already attached the ultrasonic sensor (Part 4) to the servo motor (Part 3) and mounted it to the GoPiGo robot car, so it's just a matter of setting up and running the Python code which you can find on DexterIndustries GitHub. The basic obstacle detection tells the GoPiGo robot to move forwards while collecting readings from the ultrasonic sensor and when the GoPiGo robot is close to an obstacle to stop.

The advanced obstacle detection code tells the GoPiGo robot to move forwards while reading the distance of angles and the XY coordinates, then stop and print the values in a grid map.
To execute above code, we use Terminal and type in cd Desktop/GoPiGo/Software/Python/Examples/Ultrasonic_Servo/
After running the command above, the GoPiGo Robot starts moving and scanning:

The 2D LIDAR map below is the result of the GoPiGo robot collecting the data from the video above.

Similar Gadget Explained Reviews


Connect With Gadget Explained