AURobotServers
4
|
PolarLineFit fits a polar line to a section of points, in a RangeData object. More...
#include <polarlinefit.h>
Public Member Functions | |
bool | asCart (double *x, double *y, double *th, double *lng, double *res) |
converts the estimated line segment to cartesian coordinates More... | |
double | distToLine (double r_, double th_) |
Calculates the distance from a polar point to the line. More... | |
void | fitRange (RangeData *range_, int first_, int last_) |
Fit range to a polar line. More... | |
void | fitRangeOld (RangeData *range_, int first_, int last_) |
Fit range to a polar line. More... | |
double | getEndTh () |
Get end angle. More... | |
int | getFirst () |
int | getLast () |
double | getLength () |
Get length of line segment. More... | |
double | getMaxDist () |
double | getMSQ () |
double | getR0 () |
Get minimum range. More... | |
double | getSlope () |
Get slope of line segment. More... | |
double | getStartTh () |
Get start angle. More... | |
double | getTh0 () |
Get angle for minimum range. More... | |
PolarLineFit () | |
Constructor. More... | |
void | toStringCart (char *target) |
Writes line parameters as cartesian coordinates to string in XML format. More... | |
void | toStringPolar (char *target) |
Writes line parameters as polar coordinates to string in XML format. More... | |
Private Member Functions | |
double | calcMSQ () |
calculates the MSQ for all points to the line More... | |
double | projectToLine (double r, double th) |
returns theta More... | |
void | setLength () |
Set length of line segment and the slope of the line. More... | |
Private Attributes | |
double | end_th |
End angle. More... | |
int | first |
int | last |
double | length |
Length of line segment. More... | |
double | maxdist |
double | msq |
double | r0 |
Minimum distance to line. More... | |
RangeData * | range |
double | slope |
Slope of the line from (x1, y1) to (x2, y2) More... | |
double | start_th |
Start angle. More... | |
double | th0 |
Angle of minimum distance. More... | |
PolarLineFit fits a polar line to a section of points, in a RangeData object.
PolarLineFit::PolarLineFit | ( | ) |
Constructor.
bool PolarLineFit::asCart | ( | double * | x, |
double * | y, | ||
double * | th, | ||
double * | lng, | ||
double * | res | ||
) |
converts the estimated line segment to cartesian coordinates
[out] | x,y | start position of line |
[out] | th,lng | orientation and length |
[out] | res | square error for measurement to line estimate |
Referenced by UResAuEf::findFeatures().
|
private |
calculates the MSQ for all points to the line
double PolarLineFit::distToLine | ( | double | r_, |
double | th_ | ||
) |
Calculates the distance from a polar point to the line.
r_,th_ | The range and angle of the polar point |
References dist.
Referenced by AUExtractFeatures::findSplit().
void PolarLineFit::fitRange | ( | RangeData * | range_, |
int | first_, | ||
int | last_ | ||
) |
Fit range to a polar line.
*range_,first_,last_ | Pointer to the data set and the first and last point in between which the line should be fittet |
References RangeData::point_x.
Referenced by AUExtractFeatures::doMerge().
void PolarLineFit::fitRangeOld | ( | RangeData * | range_, |
int | first_, | ||
int | last_ | ||
) |
Fit range to a polar line.
*range_,first_,last_ | Pointer to the data set and the first and last point in between which the line should be fittet |
References RangeData::point_r.
double PolarLineFit::getEndTh | ( | ) |
Get end angle.
Referenced by CircleFit::matchLines(), and CircleFit::testDistToCenter().
int PolarLineFit::getFirst | ( | ) |
Referenced by CircleFit::absorbLine(), CircleFit::addLine(), AUExtractFeatures::doMerge(), AUExtractFeatures::doSplits(), AUExtractFeatures::findSplit(), CircleFit::fitLines(), and CircleFit::testMSQ().
int PolarLineFit::getLast | ( | ) |
Referenced by CircleFit::absorbLine(), CircleFit::addLine(), AUExtractFeatures::doSplits(), AUExtractFeatures::findSplit(), CircleFit::fitLines(), and CircleFit::testMSQ().
double PolarLineFit::getLength | ( | ) |
Get length of line segment.
Referenced by AUExtractFeatures::findLongestLine().
double PolarLineFit::getMaxDist | ( | ) |
double PolarLineFit::getMSQ | ( | ) |
Referenced by AUExtractFeatures::doMerge(), and AUExtractFeatures::doSplits().
double PolarLineFit::getR0 | ( | ) |
Get minimum range.
Referenced by UResAuEf::findFeatures(), CircleFit::matchLines(), and CircleFit::testDistToCenter().
double PolarLineFit::getSlope | ( | ) |
Get slope of line segment.
double PolarLineFit::getStartTh | ( | ) |
Get start angle.
Referenced by CircleFit::matchLines(), and CircleFit::testDistToCenter().
double PolarLineFit::getTh0 | ( | ) |
Get angle for minimum range.
Referenced by UResAuEf::findFeatures(), CircleFit::matchLines(), and CircleFit::testDistToCenter().
|
private |
returns theta
projectToLine projects the point (r, th) to line
r,th | The range and angle of the polar point. |
|
private |
Set length of line segment and the slope of the line.
References a.
void PolarLineFit::toStringCart | ( | char * | target | ) |
Writes line parameters as cartesian coordinates to string in XML format.
*target | writes parameters to target |
void PolarLineFit::toStringPolar | ( | char * | target | ) |
Writes line parameters as polar coordinates to string in XML format.
*target | writes parameters to target |
|
private |
End angle.
|
private |
|
private |
|
private |
Length of line segment.
|
private |
|
private |
|
private |
Minimum distance to line.
|
private |
|
private |
Slope of the line from (x1, y1) to (x2, y2)
|
private |
Start angle.
|
private |
Angle of minimum distance.