AURobotServers
4
|
#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 |
RangeData * | range |
double | sumdist |
double | sumsq |
CircleFit class.
The CircleFit class implements a method for fittig PolarLineFit objects to a circle.
CircleFit::CircleFit | ( | ) |
Constructor.
void CircleFit::absorbLine | ( | PolarLineFit * | line_ | ) |
Add line segment to circle.
Add one PolarLineFit object (line segment) to an existing circle
*line_ | Pointer to PolarLineFit object. |
References PolarLineFit::getFirst(), and PolarLineFit::getLast().
|
private |
Add the line attributes to an existing circle.
*line_ | Pointer to PolarLineFit object. |
References PolarLineFit::getFirst(), and PolarLineFit::getLast().
|
private |
Squared distance from polar point to circle center.
r_,th_ | Polar point defined by range r_ and angle th_. |
References a.
|
private |
Distance from polar point to circumference.
r_,th_ | Polar point defined by range r_ and angle th_. |
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
*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.
References a.
Referenced by AUExtractFeatures::doFindCircles().
double CircleFit::getCr | ( | ) |
Get center r.
double CircleFit::getCth | ( | ) |
Get center th.
double CircleFit::getCx | ( | ) |
Get center x.
double CircleFit::getCy | ( | ) |
Get center y.
int CircleFit::getFirst | ( | ) |
First data point in circle segment.
Referenced by AUExtractFeatures::doFindCircles().
double CircleFit::getInverted | ( | ) |
True if inverted.
Referenced by AUExtractFeatures::doFindCircles().
int CircleFit::getLast | ( | ) |
Last data point in circle segment.
double CircleFit::getMSQ | ( | ) |
double CircleFit::getRadius | ( | ) |
Referenced by AUExtractFeatures::doFindCircles().
|
private |
Match two PolarLine objects to a circle.
*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.
*line_ | Pointer to PolarLineFit object. |
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.
*line_ | Pointer to PolarLineFit object. |
References PolarLineFit::getFirst(), and PolarLineFit::getLast().
void CircleFit::toStringCart | ( | char * | target | ) |
Write center coordinates and radius to target as XML.
*target | Pointer to string. Overflow is NOT checked. |
void CircleFit::toStringPolar | ( | char * | target | ) |
Write center dist, angle and radius to target as XML.
*target | Pointer to string. Overflow is NOT checked. |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |