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

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...
 
RangeDatarange
 
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...
 

Detailed Description

PolarLineFit fits a polar line to a section of points, in a RangeData object.

Constructor & Destructor Documentation

PolarLineFit::PolarLineFit ( )

Constructor.

Member Function Documentation

bool PolarLineFit::asCart ( double *  x,
double *  y,
double *  th,
double *  lng,
double *  res 
)

converts the estimated line segment to cartesian coordinates

Parameters
[out]x,ystart position of line
[out]th,lngorientation and length
[out]ressquare error for measurement to line estimate

Referenced by UResAuEf::findFeatures().

double PolarLineFit::calcMSQ ( )
private

calculates the MSQ for all points to the line

Returns
MSQ
double PolarLineFit::distToLine ( double  r_,
double  th_ 
)

Calculates the distance from a polar point to the line.

Parameters
r_,th_
The range and angle of the polar point
Returns
Distance to the line

References dist.

Referenced by AUExtractFeatures::findSplit().

void PolarLineFit::fitRange ( RangeData range_,
int  first_,
int  last_ 
)

Fit range to a polar line.

Parameters
*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.

Parameters
*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.

Returns
End angle

Referenced by CircleFit::matchLines(), and CircleFit::testDistToCenter().

int PolarLineFit::getFirst ( )
int PolarLineFit::getLast ( )
double PolarLineFit::getLength ( )

Get length of line segment.

Returns
Length of line segment

Referenced by AUExtractFeatures::findLongestLine().

double PolarLineFit::getMaxDist ( )
Returns
Maximum distance
double PolarLineFit::getMSQ ( )
double PolarLineFit::getR0 ( )

Get minimum range.

Returns
Minimum range

Referenced by UResAuEf::findFeatures(), CircleFit::matchLines(), and CircleFit::testDistToCenter().

double PolarLineFit::getSlope ( )

Get slope of line segment.

Returns
slope of line segment
double PolarLineFit::getStartTh ( )

Get start angle.

Returns
Start angle

Referenced by CircleFit::matchLines(), and CircleFit::testDistToCenter().

double PolarLineFit::getTh0 ( )

Get angle for minimum range.

Returns
Minimum range angle

Referenced by UResAuEf::findFeatures(), CircleFit::matchLines(), and CircleFit::testDistToCenter().

double PolarLineFit::projectToLine ( double  r,
double  th 
)
private

returns theta

projectToLine projects the point (r, th) to line

Parameters
r,thThe range and angle of the polar point.
Returns
Angle of projection
void PolarLineFit::setLength ( )
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.

Parameters
*target
writes parameters to target
void PolarLineFit::toStringPolar ( char *  target)

Writes line parameters as polar coordinates to string in XML format.

Parameters
*target
writes parameters to target

Member Data Documentation

double PolarLineFit::end_th
private

End angle.

int PolarLineFit::first
private
int PolarLineFit::last
private
double PolarLineFit::length
private

Length of line segment.

double PolarLineFit::maxdist
private
double PolarLineFit::msq
private
double PolarLineFit::r0
private

Minimum distance to line.

RangeData* PolarLineFit::range
private
double PolarLineFit::slope
private

Slope of the line from (x1, y1) to (x2, y2)

double PolarLineFit::start_th
private

Start angle.

double PolarLineFit::th0
private

Angle of minimum distance.


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