AURobotServers
4
|
#include <uobstacle.h>
Public Member Functions | |
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) |
virtual UObstacle * | makeNewObst () |
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 () |
Static Public Attributes | |
static const int | MAX_OBSTACLES = 500 |
Protected Attributes | |
unsigned long | nextObstSerial |
UObstacle * | obsts [MAX_OBSTACLES] |
int | obstsCnt |
UPoseTime | poseFirst |
UPoseTime | poseLast |
unsigned long | serial |
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.
UObstacleGroup::UObstacleGroup | ( | ) |
Constructor
References UObstacle::clear(), and UObstacle::serial.
UObstacleGroup::~UObstacleGroup | ( | ) |
Destructor
void UObstacleGroup::clear | ( | void | ) |
Clear obstacle group, but maintain the memory allocation of existing obstacle polygons.
Referenced by UObj3dPool::advanceNewGroup(), UObstaclePool::advanceNewGroup(), UObstacleHist::getGroup(), UResMapObst::getNearObstacles(), UClientFuncObstGrp::handleObst(), UResLaserIfObst::handleObstGrp(), and UResObstacle::updateMappedObstacles().
|
inlinevirtual |
Get (end) type of this structure
Reimplemented from UDataBase.
|
inline |
Get maximum obstacle count
UObstacle * UObstacleGroup::getNewObst | ( | ) |
Get a pointer to a new obstacle added to the list. The obstacle is created if none is available. If no more space, then NULL is returned.
References UObstacle::clear(), and UObstacle::setSerial().
Referenced by UObstacleGroupLaser::addObstPoly(), UObj3dGroup::addObstPoly(), UResMapObst::getNearObstacles(), and USmlTag::getObstacleGroup().
|
inline |
Get obstacle pointer with this index. NB! no range chack in index.
References UObstacle::serial.
Referenced by UReactivePath::avoidObst(), UReactivePath::getNearObstacle(), USmlTag::getObstacleGroup(), UAvoidPath2::groupObstacles(), UResLaserIfObst::listGroup(), UFunctionPassable::makePoly(), UNavPaint::paintObstGrp(), UClientFuncLaserGui::paintObstGrp(), UNavView::paintObstGrp(), UFuncObj3d::sendObjects(), UFunctionPassable::sendObstacles(), and UReactivePath::testForObstacleNearExit().
UObstacle * UObstacleGroup::getObstacle | ( | unsigned long | oSerial, |
bool | mayCreate, | ||
int * | obstacleIndex | ||
) |
Get obstacle with this serial number. If the serial number is not found and 'mayCreate' then a new obstacle is added. Returns a pointer to the found obstacle, and the obstacle index number in 'obstacleIndex' (if 'obstacleIndex' is not NULL). Returns NULL if no more space.
References UObstacle::setSerial().
|
inline |
Get actual count of obstacles
Referenced by UReactivePath::avoidObst(), UResAvoid::findPathToHere(), UReactivePath::getNearObstacle(), UResMapObst::getNearObstacles(), USmlTag::getObstacleGroup(), UAvoidPath2::groupObstacles(), UResLaserIfObst::listGroup(), UResLaserIfObst::listGroups(), UFunctionPassable::makePoly(), UResLaserIfObst::methodCall(), UNavPaint::paintObstGrp(), UClientFuncLaserGui::paintObstGrp(), UNavView::paintObstGrp(), UFuncObj3d::sendObjects(), UFunctionPassable::sendObstacles(), UReactivePath::testForObstacleNearExit(), and UResObstacle::updateMappedObstacles().
|
inline |
Get first pose in this group
Referenced by UObj3dPool::getObstGrp(), UObstaclePool::getObstGrp(), UFuncObj3d::sendObjects(), and UFunctionPassable::sendObstacles().
|
inline |
Get last pose in this group
Referenced by UObj3dPool::clear(), UObstaclePool::clear(), UObj3dPool::clearGrp(), UObstaclePool::clearGrp(), UResAvoid::findPathToHere(), UResLaserIfObst::listGroups(), UClientFuncLaserGui::onEvent(), UFuncObj3d::sendObjects(), and UFunctionPassable::sendObstacles().
|
inline |
Get ref to first pose in this group
Referenced by USmlTag::getObstacleGroup().
|
inline |
Get ref to last pose in this group
Referenced by USmlTag::getObstacleGroup(), UFunctionPassable::makePoly(), UFuncObj3d::sendObjects(), and UFunctionPassable::sendObstacles().
|
inline |
Get serial number for group
References UObstacle::serial.
Referenced by UResAvoid::findPathToHere(), UObstacleHist::getGroup(), UAvoidPath2::groupObstacles(), UResLaserIfObst::listGroup(), UResLaserIfObst::listGroups(), UFuncObj3d::sendObjects(), and UFunctionPassable::sendObstacles().
void UObstacleGroup::logAll | ( | unsigned int | serial, |
FILE * | logo | ||
) |
Log all obstacle in group to - matlab oriented - file
References UObstacle::logObst().
Referenced by UObj3dPool::getObstGrp(), UObstaclePool::getObstGrp(), and UResLaserIfObst::handleObstGrp().
|
inlinevirtual |
This is where new obstacles are created, the function is virtual, so it may be changed to a more special obstacle type
Reimplemented in UObstacleGroupLaser, and UObj3dGroup.
References UObstacle::UObstacle().
void UObstacleGroup::print | ( | const char * | prestr | ) |
Print status
References UObstacle::print().
Referenced by UResObstacle::snprint(), and UResObj3d::snprint().
void UObstacleGroup::print | ( | const char * | prestr, |
char * | buff, | ||
const int | buffCnt, | ||
bool | detail | ||
) |
Print obstacle group to string. If detail is true, then print details for each obstacle too. Returns result in buff, a char buffer of length buffCnt.
References UObstacle::isValid().
void UObstacleGroup::removeAllObsts | ( | ) |
Remove all obstacles in one go, without clearing the start and end poses.
References ULock::lock(), and ULock::unlock().
Referenced by UObj3dPool::clear(), and UObstaclePool::clear().
void UObstacleGroup::removeInvalid | ( | UTime | before, |
int | hitLimit | ||
) |
Remove invalid obstacles. Do a timeout of obstacles valid only once. , i.e earlier than this time.
References UObstacle::getHits(), UObstacle::getPPoseLast(), and UPoseTime::t.
Referenced by ULaserScan::findNearObstacles(), UObj3dPool::getObstGrp(), and UObstaclePool::getObstGrp().
void UObstacleGroup::removeObst | ( | int | idx | ) |
Remove this obstacle from list of active obstacles. Swaps with last obstacle in list and then reducec count of obstacles.
Referenced by UObstacleGroupLaser::addObstPoly(), UObj3dGroup::addObstPoly(), and USmlTag::getObstacleGroup().
|
inline |
Get first pose in this group
Referenced by UObj3dPool::getObstGrp(), and UObstaclePool::getObstGrp().
|
inline |
Get first pose in this group
|
inline |
Set serial number for group
References UObstacle::print(), and UObstacle::serial.
Referenced by UObj3dPool::advanceNewGroup(), UObstaclePool::advanceNewGroup(), and UObstacleHist::getGroup().
|
static |
Number of possible obstacles in a group
Referenced by UObstacleGroupLaser::addObstPoly(), UObj3dGroup::addObstPoly(), and USmlTag::getObstacleGroup().
|
protected |
|
protected |
List of obstacles (on heap)
Referenced by UObstacleGroupLaser::addObstPoly(), and UObj3dGroup::addObstPoly().
|
protected |
Number of used obstacles
Referenced by UObstacleGroupLaser::addObstPoly(), and UObj3dGroup::addObstPoly().
|
protected |
First poseTime that contributed to this obstacle
|
protected |
Latest poseTime that contributed to this obstacle
Referenced by UObstacleGroupLaser::addObstPoly(), and UObj3dGroup::addObstPoly().
|
protected |
Group serial number - the serial number is used when updating to ensure the correct group is updated.
Referenced by UObstacleGroupLaser::addObstPoly().