SE 423 Mechatronics

Final Report

Chris Park, John Nguyen, Daksh Saraf, Harsh Agrawal

 

Our task was to program a robot car to autonomously navigate through a robot course with unknown obstacles while traversing through set waypoints, and detecting and exterminating blue and pink weeds. The robot should identify the obstacles and plan a path around them to avoid touching any wooden obstacles and also identify the location of the weeds within a half-tile radius accuracy.

The robot was equipped with a LADAR sensor (used for obstacle detection), optical encoders in the motors and rate gyro (used to determine the dead reckoning position and orientation of the robot), reflective balls for the Optitrack to identify the location of the robot more accurately and a camera used to identify blue and pink weeds.

Path Planning

The first task was to traverse the course through 5 waypoints while avoiding obstacles. To navigate the robot from one waypoint to another we used the A-Star path planning algorithm. A-Star would give the most optimal path from a source position to the destination position while avoiding any obstacles between the two points. The car would re-A-Star (get a new path) whenever it detected a new obstacle or when it reached a waypoint to find a path to the next waypoint. We modified the A-Star algorithm provided to us to use Euclidean distance as the heuristic and to allow diagonal movements. However, due to this, when the car went diagonal around the corner of an obstacle it would brush off that corner. To solve this problem, we did not let the car go diagonal around a corner. So, if there was a diagonal cell to the top left, we only considered it in A-Star if there was no obstacle to the top and left. If the car went through every point in the A-Star path, the overall path from a waypoint to another would not be very smooth because the car would have to take frequent turns, slowing it down. We skipped any point in the A-Star path that had no obstacle around it, meaning it had all 8 neighbors. This made the path relatively smooth.

Obstacle Detection

Another task was to detect obstacles, so that A-Star could find paths around the obstacles. The LADAR gave distance readings in an angle range of 240 degrees from the right of the robot to the left. The LADAR distance readings were used to calculate the x-y coordinates of any possible obstacles in the course. If the LADAR distance was approximately within a meter, we would check if the x-y coordinate is close to the center of any of the 57 possible obstacle wall locations. If the LADAR gave 10 x-y readings at the center of a possible obstacle, we would mark that as an obstacle wall.

Weed Detection & Extermination

The next task was to look for weeds when the robot is traversing the course. When the image from the camera had enough pixels within the HSV range of the blue or pink weeds, the robot would turn towards the weed to align the weed to the center of the image. When the robot was aligned to the center of the image, it measured the distance to the weed using a cubic function and calculated it’s x-y coordinates using the robot’s location, orientation and the distance to the weed. If this was a new weed, the car would go to the weed using xy control. While it went towards the weed, we kept calculating the distance and average the xy-coordinates to get a more accurate location. When the car reached the weed, it would wait for a second and re-A-Star from its current location to the desired waypoint. Whenever the car saw a weed that was already exterminated, the x-y coordinate calculated this time was averaged with the one found earlier. This allowed us to get the location of the weeds very accurately.

LabView

Values from the arrays used for obstacle detection and weed detection were sent a few at a time. Each time data was being sent to labview, we would send 4 values from the obstacle array and 1 value from the weed array with the location and orientation of the robot. We would plot the obstacles and weeds on LabView using this data.

 

Link to video:

https://drive.google.com/drive/u/0/folders/1EFH3J9yFHg0640hGYyhZrAO8YqsMZrdE

 

The link to all the source code and the LABVIEW project files:

https://drive.google.com/open?id=11NsDM5gGtoOjSsY-xxgzYZ2uxC0kFsjE