WALL FOLLOW ALGORITHM
Our team decided to not use A* algorithm for path planning but use wall following. The wall following code is built off of the code from lab 7 and the robot will focus on obstacle avoidance when traversing through the map. In our program, we implemented a left and right wall follow depending on the LADAR readings. The decision to follow the left and right wall depended on whether the wall is closer to the right or the left. There is also a random component so the robot does not get stuck in a loop.
CASE STRUCTURE
The decisions that the robot makes is governed by the case structure. The waypoints for the map is predetermined and the individual cases control the specific actions of the robot. For example, case 1 puts the robot on the way to each waypoint and reads the LADAR and (x,y) data to determine what case to set. Each case can decide to switch to a different case before going back to path following. This allows for more smoothness in the robot as it traverses through different maps.
BALL DETECTION
From the previous labs, we learned to use the camera and to detect orange and purple balls. Using this, we implemented the same code to ours and tweaked some values to better the color detection for the robot. Since the color detection is sometimes inaccurate, there is a 300ms delay to detect the color 3 times to filter out any misreading of the camera. Once the ball is detected by the camera, the case structure is triggered and the robot proceeds to pick up the ball. Once the ball is picked up, the location of the pickup is sent to LABVIEW where it gets displayed where the balls location was on the course.