Python code used to run an autonomous robot built using Arduino, Raspberry Pi, servos, motors, ultrasonic sensors, LIDAR sensors, XBee, and blockchain technology. For the autonomous demo, the robot initially turns the LIDAR to the left, right, and center to determine the longest direction through multiple readings, removes outliers, and returns a median value. It then moves the motors towards the direction of the farthest distance. The robot takes readings while in motion for collision checking using the ultrasonic sensors. If it encounters an obstacle, it stops and calibrates again to determine the next longest direction and then moves towards that direction.
For MVP test demos between the cars, look in the
This repository contains several modules:
- LIDAR_test - LIDAR sensor test module
- motor_test - Motor test module
- servo_test - Servo test module
- ultrasonic_test - Ultrasonic sensor test module
- xbee_test - XBee test module
- demos/ - Test demos for autonomous cars (MVP demo)
For the autonomous demo, run with program with:
main.py- Main driver.
LIDARcontrol.py- Module to read LIDAR sensor data on Raspberry Pi from Arduino through the serial port.
motorControl.py- Module for motor control.
servoControl.py- Module for servo control.
ultrasonicControl.py- Module for reading ultrasonic sensor data on the Raspberry Pi.
xbeeControl.py- Module for wireless communication on the Raspberry Pi.
auxiliary.py- Auxiliary functions such as releasing GPIO pins and data logging.
- Raspberry Pi 3 Model B
- Arduino Uno R3 (Atmega328)
- Iron Man-4 Indoor Tracked Chassis with motors
- MC33886 Raspberry Pi Motor Driver Board for Raspberry Pi
- Xbee S2C series (XB24CZ7WIT-004)
- SparkFun XBee Explorer Dongle
- HC-SR04 Ultrasonic Range Finder
- Lynxmotion Aluminum Multi-Purpose Sensor Bracket (for ultrasonic)
- LIDAR-Lite v3
- Lynxmotion Micro Pan and Tilt Kit with Servos (for LIDAR)
- Adafruit 16-Channel 12-bit PWM/Servo Driver - I2C interface - PCA9685
- Venom Fly 30C 4S 5000mAh 14.8V LiPo Battery
- SMAKN Dc/dc Converter 12v Step Down to 5v/3a Power Supply Module
- USB Battery Pack for Raspberry Pi (10000mAh)
- USB to USBMicro (for battery pack to Pi3)
- LIDAR-Lite v3
- HC-SR04 Ultrasonic Sensor