AURobotServers
4
|
#include <uobstaclepool.h>
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 UObstacle * | makeNewObst () |
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 () |
UObstacle * | getNewObst () |
UObstacle * | getObstacle (int idx) |
UObstacle * | getObstacle (unsigned long oSerial, bool mayCreate, int *obstacleIndex) |
int | getObstsCnt () |
UPoseTime | getPoseFirst () |
UPoseTime | getPoseLast () |
UPoseTime * | getPPoseFirst () |
UPoseTime * | getPPoseLast () |
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 |
UObstacle * | obsts [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 |
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.
UObstacleGroupLaser::UObstacleGroupLaser | ( | ) |
Constructor
References mergeObstacles, obstacleCogMergeLimit, and obstacleMergeMargin.
Referenced by UObstaclePool::advanceNewGroup().
UObstacleGroupLaser::~UObstacleGroupLaser | ( | ) |
Destructor
bool UObstacleGroupLaser::addObst | ( | ULaserScan * | scan, |
UPoseTime | odoPose, | ||
int | idx1, | ||
int | idx2, | ||
bool | outdoorObsts, | ||
bool | horizontalScan | ||
) |
Add this obstacle to group
scan | is the laserscan points |
odoPose | is odoPose at scantime |
idx1 | is first measurement in obstacle |
idx2 | is last measuremnt in obstacle |
outdoorObst | changes correlations criteria |
horizontalScan | if false, assumed tilted and then obstacles are stretched to correlate with rough grass in last scan. |
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.
newpoly | The polygon coordinates is assumed to be in odometry coordinates. |
outdoorObst | If '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. |
horizontalScan | if false, then the extra correlation position is removed after use (for outdoor obstacles only) |
polyHits | is 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().
|
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().
|
inlinevirtual |
This is where new obstacles are created, used by obstacle group, when new obstacles are needed (old obstacles are reused if possible)
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.
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. |
mergeCogEmbeddedObstacles | is this COG (Center Of Gravity) embedded merge method enabled. Relevant only if mergeNearObstacles is false. |
singleLimit | single point obstacles may be merged if they are this close to other obstacles. |
mergeSingleObstacles | should special single point obstacle merge rules be used. |
References mergeCogEmbedded, mergeObstacles, mergeSingles, obstacleCogMergeLimit, obstacleMergeMargin, and obstacleSingleMargin.
Referenced by UResObstacle::getObstacleGroupSettings().
|
inline |
Set previous postion. Previous position is the pose for the set of updates before the latest set of updates.
Referenced by UObstaclePool::getObstGrp().
|
protected |
Allow merge of COG embedded obstacles
Referenced by addObstPoly(), and setMergeDistance().
|
protected |
Merge near obstacles
Referenced by addObstPoly(), setMergeDistance(), and UObstacleGroupLaser().
|
protected |
Should singles be merged on its own criteria
Referenced by addObstPoly(), and setMergeDistance().
|
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().
|
protected |
Merge distance - when obstacles are within this distance from other obstacles
Referenced by addObstPoly(), setMergeDistance(), and UObstacleGroupLaser().
|
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().
|
protected |
Previous pose, to be used for merging obstacles in rough grass
Referenced by addObstPoly().