AURobotServers  4
Public Member Functions | Protected Attributes | List of all members
UObstacleGroupLaser Class Reference

#include <uobstaclepool.h>

Inheritance diagram for UObstacleGroupLaser:
Inheritance graph

Public Member Functions

bool addObst (ULaserScan *scan, UPoseTime odoPose, int idx1, int idx2, bool outdoorObsts, bool horizontalScan)
 
bool addObstPoly (UPolygon *newpoly, UPoseTime pt, bool outdoorObsts, bool horizontalScan, int polyHits=1)
 
UPoseTime getPosePrev ()
 
virtual UObstaclemakeNewObst ()
 
void setMergeDistance (double mergeDist, bool mergeNearObstacles, double cogLimit, bool mergeCogEmbeddedObstacles, double singleLimit, bool mergeSingleObstacles)
 
void setPosePrev (UPoseTime pt)
 
 UObstacleGroupLaser ()
 
 ~UObstacleGroupLaser ()
 
- Public Member Functions inherited from UObstacleGroup
void clear ()
 
virtual const char * getDataType ()
 
int getMaxObstsCnt ()
 
UObstaclegetNewObst ()
 
UObstaclegetObstacle (int idx)
 
UObstaclegetObstacle (unsigned long oSerial, bool mayCreate, int *obstacleIndex)
 
int getObstsCnt ()
 
UPoseTime getPoseFirst ()
 
UPoseTime getPoseLast ()
 
UPoseTimegetPPoseFirst ()
 
UPoseTimegetPPoseLast ()
 
unsigned long getSerial ()
 
void logAll (unsigned int serial, FILE *logo)
 
void print (const char *prestr)
 
void print (const char *prestr, char *buff, const int buffCnt, bool detail)
 
void removeAllObsts ()
 
void removeInvalid (UTime before, int hitLimit)
 
void removeObst (int idx)
 
void setPoseFirst (UPoseTime pose)
 
void setPoseLast (UPoseTime pose)
 
void setSerial (unsigned long value)
 
 UObstacleGroup ()
 
 ~UObstacleGroup ()
 
- Public Member Functions inherited from ULock
bool lock ()
 
void lockInit ()
 
void post ()
 
bool tryLock ()
 
bool tryWait ()
 
 ULock ()
 
void unlock ()
 
bool wait ()
 
 ~ULock ()
 
- Public Member Functions inherited from UDataBase
bool isA (const char *typeString)
 
virtual bool isAlsoA (const char *typeString)
 
virtual void snprint (const char *preString, char *buff, const int buffCnt)
 
 UDataBase ()
 
virtual ~UDataBase ()
 

Protected Attributes

bool mergeCogEmbedded
 
bool mergeObstacles
 
bool mergeSingles
 
double obstacleCogMergeLimit
 
double obstacleMergeMargin
 
double obstacleSingleMargin
 
UPoseTime posePrev
 
- Protected Attributes inherited from UObstacleGroup
unsigned long nextObstSerial
 
UObstacleobsts [MAX_OBSTACLES]
 
int obstsCnt
 
UPoseTime poseFirst
 
UPoseTime poseLast
 
unsigned long serial
 

Additional Inherited Members

- Static Public Attributes inherited from UObstacleGroup
static const int MAX_OBSTACLES = 500
 

Detailed Description

Obstacle group, that — within reason — can be assumed to have same reference coordinate system, based on odometry. That is, systematic errors in pose within group, can not be corrected for.

Constructor & Destructor Documentation

UObstacleGroupLaser::UObstacleGroupLaser ( )
UObstacleGroupLaser::~UObstacleGroupLaser ( )

Destructor

Member Function Documentation

bool UObstacleGroupLaser::addObst ( ULaserScan scan,
UPoseTime  odoPose,
int  idx1,
int  idx2,
bool  outdoorObsts,
bool  horizontalScan 
)

Add this obstacle to group

Parameters
scanis the laserscan points
odoPoseis odoPose at scantime
idx1is first measurement in obstacle
idx2is last measuremnt in obstacle
outdoorObstchanges correlations criteria
horizontalScanif false, assumed tilted and then obstacles are stretched to correlate with rough grass in last scan.
Returns
true if added

References UPolygon::add(), addObstPoly(), UPolygon::extractConvexTo(), UPolygon::getPoints(), UPolygon::getPointsCnt(), ULaserScan::getPos(), getPosePrev(), UPose::getPoseToMap(), UPosRot::getRtoMMatrix(), ULaserScan::getSensorPose(), UPolygon::removeNearVertex(), UPosRot::setPhi(), UPosRot::setZ(), and UPosition::x.

Referenced by UObstaclePool::addObst().

bool UObstacleGroupLaser::addObstPoly ( UPolygon newpoly,
UPoseTime  pt,
bool  outdoorObsts,
bool  horizontalScan,
int  polyHits = 1 
)

Add this obstacle polygon.

Parameters
newpolyThe polygon coordinates is assumed to be in odometry coordinates.
outdoorObstIf 'outdoorObsts', then an extra position is assumed added for correlation (if not horizontal scan). This position is removed before any merge or create is implemented.
horizontalScanif false, then the extra correlation position is removed after use (for outdoor obstacles only)
polyHitsis number of hits (scans) this obstacle has received true if obstacle is merged or added successfuly

References UPolygon::add(), UObstacle::clear(), UPolygon::clear(), UPolygon::extractConvexTo(), UPolygon::getDistance(), UObstacle::getHits(), UObstacleGroup::getNewObst(), UPolygon::getPoint(), UPolygon::getPointsCnt(), UObstacle::getPoseFirst(), UObstacle::initPoseFirst(), UPolygon::isOverlappingXYconvex(), UObstacle::isValid(), ULock::lock(), UObstacleGroup::MAX_OBSTACLES, maxi(), UObstacle::mergeableOnCogLimits(), mergeCogEmbedded, mergeObstacles, mergeSingles, obstacleCogMergeLimit, obstacleMergeMargin, obstacleSingleMargin, UObstacleGroup::obsts, UObstacleGroup::obstsCnt, UPolygon::pop(), UObstacleGroup::poseLast, posePrev, UPolygon::removeNearVertex(), UObstacleGroup::removeObst(), UObstacleGroup::serial, UObstacle::setHits(), UObstacle::setPoseFirst(), UObstacle::setPoseLast(), UObstacle::setValid(), UPoseTime::t, ULock::unlock(), UPosition::x, and UPosition::y.

Referenced by addObst(), UObstaclePool::addObst(), and UFunctionPassable::handleObstGet().

UPoseTime UObstacleGroupLaser::getPosePrev ( )
inline

Get previous postion. Previous position is the pose for the set of updates before the latest set of updates.

Referenced by addObst(), and UObstaclePool::pointsToPolygon().

virtual UObstacle* UObstacleGroupLaser::makeNewObst ( )
inlinevirtual

This is where new obstacles are created, used by obstacle group, when new obstacles are needed (old obstacles are reused if possible)

Returns
pointer to the newly created obstacle

Reimplemented from UObstacleGroup.

void UObstacleGroupLaser::setMergeDistance ( double  mergeDist,
bool  mergeNearObstacles,
double  cogLimit,
bool  mergeCogEmbeddedObstacles,
double  singleLimit,
bool  mergeSingleObstacles 
)

Set merge parameters for this obstacle group.

Parameters
mergeDist- merge if this near other obstacles (and mergeNearObstacles is true)
mergeNearObstacles- allow merge based on distance.
cogLimit- if mergeCogEmbeddedObstacles is true, then the COG embedded obstacles may extend this far outside other obstacle and still be merged.
mergeCogEmbeddedObstaclesis this COG (Center Of Gravity) embedded merge method enabled. Relevant only if mergeNearObstacles is false.
singleLimitsingle point obstacles may be merged if they are this close to other obstacles.
mergeSingleObstaclesshould special single point obstacle merge rules be used.

References mergeCogEmbedded, mergeObstacles, mergeSingles, obstacleCogMergeLimit, obstacleMergeMargin, and obstacleSingleMargin.

Referenced by UResObstacle::getObstacleGroupSettings().

void UObstacleGroupLaser::setPosePrev ( UPoseTime  pt)
inline

Set previous postion. Previous position is the pose for the set of updates before the latest set of updates.

Referenced by UObstaclePool::getObstGrp().

Member Data Documentation

bool UObstacleGroupLaser::mergeCogEmbedded
protected

Allow merge of COG embedded obstacles

Referenced by addObstPoly(), and setMergeDistance().

bool UObstacleGroupLaser::mergeObstacles
protected

Merge near obstacles

Referenced by addObstPoly(), setMergeDistance(), and UObstacleGroupLaser().

bool UObstacleGroupLaser::mergeSingles
protected

Should singles be merged on its own criteria

Referenced by addObstPoly(), and setMergeDistance().

double UObstacleGroupLaser::obstacleCogMergeLimit
protected

Merge distance when COG of one obstacle is inside another, then merge if the embedded is no more than this limit outside the other.

Referenced by addObstPoly(), setMergeDistance(), and UObstacleGroupLaser().

double UObstacleGroupLaser::obstacleMergeMargin
protected

Merge distance - when obstacles are within this distance from other obstacles

Referenced by addObstPoly(), setMergeDistance(), and UObstacleGroupLaser().

double UObstacleGroupLaser::obstacleSingleMargin
protected

Margin to merge single points with other obstacles. usefull if merge in general is not used, to limit number of obstacles.

Referenced by addObstPoly(), and setMergeDistance().

UPoseTime UObstacleGroupLaser::posePrev
protected

Previous pose, to be used for merging obstacles in rough grass

Referenced by addObstPoly().


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