As a final project for our Mechatronics course at the University of Illinois at Urbana -Champaign we were tasked with creating a robot that navigates through a 12'x16' course with 5 predetermined waypoints, 5 randomly generated obstacles, and 5 randomly generated golf balls while avoiding obstacles and collecting golf balls. There are some restirction on where obstacles and golf balls can be placed which can be found here.
For this project teams were ranked based on time with the ability to subtract time if certain objectives were met. For a time to be valid the robot also had to meet a minimum set of criteria.
Minimum Criteria
- All 5 waypoints must be reached in numbered order
- At least two golf balls must be collected
- At least two golf balls must be deposited in the correct chute
TIme Reduction
- Every additional golf ball past 2 successfully collected and deposited (-20 sec)
- Every golf ball whose color and x, y coordinate are correctly displayed in LabVIEW (-20 sec)
- No obstacles or walls hit while navigating course (-80 sec)
If all time reduction objectives are met a team could subtract 240 seconds from their robots course time.
Step #1 Obstacle AvoidanceWe will begin with the obstacle avoidance part of our project as it is the most important part of our project. For this project group could choose between using left and right wall following or the A* search algorithm. Our group chose to use the A* started code provided to us as we believed that A* would have less edge cases which would cause collision. To implement the A* algorithm we used data from the LIDAR to detect obstacles and update the A* map. One issue we ran into was the robot would often clip the edge of the wall on it's way to waypoint 1 to fix this a phantom obstacle was added to the A* map under the walls edge to avoid any collision.
Diagonal A*
Once we had the starter A* running we decided to modify it to check diagonal nodes as well as could only check vertical and horzontal nodes. This was to reduce the time it took to run through the course and make our robots pathing smoother.
Step #2 LabVIEWWe transmit the LIDAR data and robot position coordinates from the red board to the LabVIEW program through the LVCom app in RaspberryPi. Using the OptiCom and LIDAR data, we can detect and locate obstacles in the map. Along with that, when the camera detects a ball, it's location and color is mapped on the screen. The obstacles and walls in the front and on the right are plotted on the map in LabVIEW.
Step #3 Golf Ball CollectionTo collect golf balls the first task is to constantly detect the golf balls. The code for this is available in the Golf Ball detection python file. This code uses a basic camera with a usb port to detect colors based on threshold values provided by the user. Once the golf ball were properly detected we added code to center the robot on the ball and open the gripper using two seperate RC servos to control the two seperate parts of the gripper.
Final Demo
Comments