Group 3: Vision Assisted Robot Navigation

 

Team Members: Andrew Honegger, Nathan Hoople, and George Langstaff

 

 

Purpose:

The compasses on the robots used in the lab are not accurate enough to use for open-loop navigation and are sensitive to metal near the robot.  This project proposes the use of vision to determine orientation, and absolute position for use in open-loop navigation.

 

Download the Code:

See the Videos:       Centering on Black and Finding Waypoints , Finishing Course and Returning to Origin

 

Design Overview:

The robot has been fitted with an upward-facing camera to look at the lights on the ceiling in the laboratory.  The robot first initializes its position by finding and driving to the center of the black marker on the ceiling, which is positioned over the origin of the course.  A course, defined by a set of waypoints, is transferred to the robot over the microhopper from the Visual Basic interface.  The orientation of the robot is determined by calculating the angle of the lights on the ceiling.  Navigation is accomplished using this orientation and the encoder readings of the wheels.  The robot traverses the course, and then returns to the origin to recalibrate its position and wait for another course.  The path of the robot is recorded by the Visual Basic interface.  Details of these design features are outlined below.

 

Orientation and Position Calculation:

 

As mentioned before, the orientation is calculated based on the angle of the lights.  Specifically, the field of view is thresholded to pick out the bright lights and segmented to differentiate each light.  The angle of the largest light is then determined by calculating the largest moment about the centroid.  Sean Brennan provided this portion of the code to the team.  However, this code outputs an orientation value between -90º and 90º (i.e. it cannot give a heading direction between 0º and 360º).  To accomplish this feature, we developed code to use the compass (which needs to be correct to +/-90º) to convert the light angle to an accurate heading. 

 

Using the heading value, we use the encoder values to continually update the robots position using the following equations:

 

                 xpos=(vavg*.001*sin(thetadeg/180*PI)) + xpos

                 ypos=(vavg*.001*cos(thetadeg/180*PI)) + ypos

 

where xpos and ypos are the x and y positions of the robot, respectively, vavg is the forward velocity of the robot (determined by averaging the encoder speeds), and thetadeg is the heading of the robot.

 

In order for the position measurements to be accurate, the absolute position needs to be initialized to an absolute coordinate.  This is done using the camera to locate a large black base suspended from the ceiling.  The robot detects the large black object, calculates its centroid, and drives until the centroid of the base lies in the center of the camera image.  Once the robot is lined up with the base point, it zeroes the position readings.  Then once the robot travels to its defined waypoints, it calculates all coordinates based on this origin.

 

VB Interface:

 

The picture above is a screen shot of the robot’s VB interface.  The waypoints are drawn on the course by typing coordinate values for each waypoint and then pressing the yellow “set waypoints” button.  The course is sent to the robot over the microhopper by pressing the green “send course to robot” button.  The robot will remain at the origin of the course until waypoints are received.  After a course is sent, the robot travels from waypoint to waypoint.  During travel, the heading, position, and velocity are all shown on the screen.  The previous positions of the recorded with black dots, and the current position of the robot are depicted using a larger red dot.  The “reset tracking” button erases all of the black tracking dots.

 

Future Ideas:

 

*   The camera could be used to read the location of the black base point and determine its position in the room based on where it sees the centroid of the base.  This may improve the accuracy of the position measurement by helping reduce the error of wheel slippage.

*   Code could be added so that if the robot encounters an obstacle, it needs to figure out how to get around the obstacle in order to achieve the next waypoint.

*   If a second camera could be added, one could look up for a dedicated navigation camera, while another looks forward to perform other tasks, such as was used in the find-can competition of Lab 9.

 

 

 Comments:

-This class was one of the first engineering classes I have really enjoyed, and have found one of the areas of engineering that really interest me and that I hope to get into in much more depth in the future.

-I do think that the class could probably start off at a little faster pace.  I didn't have much experience with the subject matter coming in, and found that the pace of the class could have be quickened up somewhat.