MGC Collision Detection

= General Description =

This component takes in standard collision detection information and attempts to find both the road, as well as any major obstacles. We must use a line regression algorithm for flat surface (road) detection, please see the 2008 MGC code for references. Some variables associated with line regression may have to be defined in the configuration file. This component works in metric units as well as polar coordinates.

Updated: Laser-vision fusion is being dropped for MGC2010, so this component will only deal with collision detection, assuming the laser scans are now parallel with the ground.

Algorithm
'''Line selection algorithm. Input: Series of x, y points'''
 * 1) Remove all non-colliding points
 * 2) Find the left and right points
 * 3) Find the midpoint between left and right points
 * 4) Regression with left and middle points
 * 5) Regression with middle and left points
 * 6) Select the best series of lines that is both perpendicular to the vehicle and the largest width

'''Regression algorithm. Input: Pt0 and Pt1 (A line of two points)'''
 * 1) Test if the line fits (Based on number of points that meet a minimum distance)
 * 2) This can be done as explained here
 * 3) If the line fits
 * 4) Return this line
 * 5) If the line does not fit
 * 6) Break line in the middle
 * 7) Regression with left and middle points
 * 8) Regression with middle and left points

Owners

 * Marshall

= Performance Requirements =

10Hz since the laser updates 10 times a second.

= Input =


 * From LaserInterface
 * Laser range finder's delta (angle in radians) between each ray-cast
 * Data type name: LaserRangeDelta
 * Actual Type: double
 * Laser range finder's ray count
 * Data type name: LaserRangeCount
 * Actual type: int
 * Laser range collision data; Series of distance from the center
 * Data type name: LaserRangeData
 * Actual Type: array of integers, size is sizeof(int) * LaserRangeCount


 * From config file
 * Distance in which any closer would result in collision
 * Name: CollisionDistance
 * Data type: float

= Output =


 * Points of collision
 * Data type name: CollisionPoints
 * Actual Type: array of two double pairs, which represent (theta and distance)
 * Note: The number of CollisionPoints can be found by getting the message byte size and dividing by ( sizeof(double) * 2 )
 * Line regression / road detection; The best fitting collision line of the road
 * Data Type: RoadLine
 * Actual Type: Two pairs of "theta and distance" which are both doubles

= Developer Discussion =


 * This code exists in a much older form in the 2008 MGC code base JBridon 22:05, 3 October 2009 (UTC)
 * LaserController.cpp source code
 * I'm having a hard time finding the orignal article for line regression / finding a line. I know the above algorithm works, but it's very heuristic.. can someone keep google searching? JBridon 02:36, 25 March 2010 (UTC)