AURobotServers  4
Public Member Functions | Private Member Functions | Private Attributes | List of all members
CircleFit Class Reference

CircleFit class. More...

#include <circlefit.h>

Public Member Functions

void absorbLine (PolarLineFit *line_)
 Add line segment to circle. More...
 
 CircleFit ()
 Constructor. More...
 
void fitLines (RangeData *range_, PolarLineFit *linefit1_, PolarLineFit *linefit2_)
 Makes a circle of two PolarLineFit objects. More...
 
double getCoverage ()
 radians of the circle covered by scan points More...
 
double getCr ()
 Get center r. More...
 
double getCth ()
 Get center th. More...
 
double getCx ()
 Get center x. More...
 
double getCy ()
 Get center y. More...
 
int getFirst ()
 First data point in circle segment. More...
 
double getInverted ()
 True if inverted. More...
 
int getLast ()
 Last data point in circle segment. More...
 
double getMSQ ()
 Mean squared error. More...
 
double getRadius ()
 
double testDistToCenter (PolarLineFit *line_)
 Get the distance to the center for a PolarLineFit object. More...
 
double testMSQ (PolarLineFit *line_)
 MSQ for a line segment matched to an existing circle. More...
 
void toStringCart (char *target)
 Write center coordinates and radius to target as XML. More...
 
void toStringPolar (char *target)
 Write center dist, angle and radius to target as XML. More...
 

Private Member Functions

void addLine (PolarLineFit *line_)
 Add the line attributes to an existing circle. More...
 
double distToCenterSqr (double r_, double th_)
 Squared distance from polar point to circle center. More...
 
double distToCirc (double r, double th)
 Distance from polar point to circumference. More...
 
void matchLines (PolarLineFit *line1, PolarLineFit *line2)
 Match two PolarLine objects to a circle. More...
 

Private Attributes

double cr
 
double cth
 
double cx
 
double cy
 
int first
 
bool inverted
 
int last
 
double msq
 
int points
 
double radius
 
RangeDatarange
 
double sumdist
 
double sumsq
 

Detailed Description

CircleFit class.

The CircleFit class implements a method for fittig PolarLineFit objects to a circle.

Constructor & Destructor Documentation

CircleFit::CircleFit ( )

Constructor.

Member Function Documentation

void CircleFit::absorbLine ( PolarLineFit line_)

Add line segment to circle.

Add one PolarLineFit object (line segment) to an existing circle

Parameters
*line_
Pointer to PolarLineFit object.

References PolarLineFit::getFirst(), and PolarLineFit::getLast().

void CircleFit::addLine ( PolarLineFit line_)
private

Add the line attributes to an existing circle.

Parameters
*line_
Pointer to PolarLineFit object.

References PolarLineFit::getFirst(), and PolarLineFit::getLast().

double CircleFit::distToCenterSqr ( double  r_,
double  th_ 
)
private

Squared distance from polar point to circle center.

Parameters
r_,th_
Polar point defined by range r_ and angle th_.
Returns
Squared distance to center.

References a.

double CircleFit::distToCirc ( double  r_,
double  th_ 
)
private

Distance from polar point to circumference.

Parameters
r_,th_
Polar point defined by range r_ and angle th_.
Returns
Distance to circumference.
void CircleFit::fitLines ( RangeData range_,
PolarLineFit linefit1_,
PolarLineFit linefit2_ 
)

Makes a circle of two PolarLineFit objects.

Fit a circle to the two the lines given by the PolarLineFit objects.
the center for the circle is found in the perpendicular median vector intersection and the radius is adjusted by the average distance to the center

Parameters
*range_,*linefit1_,*linefit2_
range_: Pointer to RangeData object.
linefitX_: Pointer to PolarLineFit object.

References PolarLineFit::getFirst(), and PolarLineFit::getLast().

Referenced by AUExtractFeatures::doFindCircles().

double CircleFit::getCoverage ( )

radians of the circle covered by scan points

Radians of the circle covered by scan points.

Returns
Radians

References a.

Referenced by AUExtractFeatures::doFindCircles().

double CircleFit::getCr ( )

Get center r.

Returns
cr
double CircleFit::getCth ( )

Get center th.

Returns
cth
double CircleFit::getCx ( )

Get center x.

Returns
cx
double CircleFit::getCy ( )

Get center y.

Returns
cy
int CircleFit::getFirst ( )

First data point in circle segment.

Returns
First data point in circle from RangeData

Referenced by AUExtractFeatures::doFindCircles().

double CircleFit::getInverted ( )

True if inverted.

Referenced by AUExtractFeatures::doFindCircles().

int CircleFit::getLast ( )

Last data point in circle segment.

Returns
Last data point in circle from RangeData
double CircleFit::getMSQ ( )

Mean squared error.

Returns
MSQ

Referenced by AUExtractFeatures::doFindCircles().

double CircleFit::getRadius ( )
void CircleFit::matchLines ( PolarLineFit line1,
PolarLineFit line2 
)
private

Match two PolarLine objects to a circle.

Parameters
*line1,*line2
pointers to the two PolarLine objects that needs to be matched.

References PolarLineFit::getEndTh(), PolarLineFit::getR0(), PolarLineFit::getStartTh(), and PolarLineFit::getTh0().

double CircleFit::testDistToCenter ( PolarLineFit line_)

Get the distance to the center for a PolarLineFit object.

Parameters
*line_
Pointer to PolarLineFit object.
Returns
The distance from the line midpoint to the circle circumference.

References PolarLineFit::getEndTh(), PolarLineFit::getR0(), PolarLineFit::getStartTh(), and PolarLineFit::getTh0().

double CircleFit::testMSQ ( PolarLineFit line_)

MSQ for a line segment matched to an existing circle.

Parameters
*line_
Pointer to PolarLineFit object.
Returns
The MSQ between the PolarLineFit object and the circle circumference.

References PolarLineFit::getFirst(), and PolarLineFit::getLast().

void CircleFit::toStringCart ( char *  target)

Write center coordinates and radius to target as XML.

Parameters
*target
Pointer to string.
Overflow is NOT checked.
void CircleFit::toStringPolar ( char *  target)

Write center dist, angle and radius to target as XML.

Parameters
*target
Pointer to string.
Overflow is NOT checked.

Member Data Documentation

double CircleFit::cr
private
double CircleFit::cth
private
double CircleFit::cx
private
double CircleFit::cy
private
int CircleFit::first
private
bool CircleFit::inverted
private
int CircleFit::last
private
double CircleFit::msq
private
int CircleFit::points
private
double CircleFit::radius
private
RangeData* CircleFit::range
private
double CircleFit::sumdist
private
double CircleFit::sumsq
private

The documentation for this class was generated from the following files: