Cricketbot

Navigation

Navigation of the robot was coded by Jess and Helya. Details of how they implemented a navigation routine are detailed below.

COLOR CAMERA

The color camera was used to identify the color desired by the user. The user would send a color command (red, blue, green, purple) from Visual Basic to the DSP. Depending which color chosen, a threshold is assigned to eliminate all background colors, and only filter through the desired color. Ultimately, the code takes a colored image and turns it into a black and white image. White pixels representing the color desired, and black pixels representing the background. Once the camera detects a white object, a cross hair will appear at the centroid of the white object, depicting the center of the object. The x and y coordinates of the center are sent to the XY destination and Object avoidance function.

XY DESTINATION & OBJECT AVOIDANCE:

The objective of the XY Destination and Object Avoidance is to direct the robot car to a desired destination while at the same time avoid objects in its path. The robot starts out turning in place while searching for the color desired. If the color desired is not detected after turning 360°, the robot will move forward six tiles and search again for the color desired. If color desired is still not detected, the robot will only turn 180° and move 6 tiles forward again. During this algorithm the robot is able to maneuver around objects in its path. Once the color camera detects the color desired, the robot will start moving toward the color by using the color object’s center x and y coordinates values obtained from the vision code. Once the robot reaches the color object, it stops and speaks the x and y coordinates of the object’s location with the help of the crickets.