AURobotServers
4
|
#include <uobj3dpool.h>
Public Member Functions | |
void | addObstacle (UPolygon *newPoly, UPoseTime odoPose, bool isHuman, bool isGndBased) |
UObj3dGroup * | advanceNewGroup () |
void | clear () |
void | clearGrp (int idx) |
UObj3dGroup * | getGroup (int fromNewest) |
int | getGroupsCnt () |
virtual void | getObstacleGroupSettings (UObj3dGroup *og) |
UObj3dGroup * | getObstGrp (UPoseTime pt) |
virtual void | obstDataUpdated (UTime poseTime) |
void | print (const char *prestr) |
void | setLogFile (FILE *logFile) |
void | setNewGrpDist (double value) |
void | setNewGrpTime (double value) |
UObj3dPool () | |
virtual | ~UObj3dPool () |
Static Public Attributes | |
static const int | MAX_OBSTACLE_GROUPS = 100 |
Protected Attributes | |
UObj3dGroup * | groups [MAX_OBSTACLE_GROUPS] |
int | groupsCnt |
FILE * | logo |
int | newest |
double | newGroupTime |
double | newGrpDist |
unsigned long | nextSerial |
Historic updated obstacles, divided into groups
UObj3dPool::UObj3dPool | ( | ) |
Constructor
|
virtual |
Destructor
void UObj3dPool::addObstacle | ( | UPolygon * | newPoly, |
UPoseTime | odoPose, | ||
bool | isHuman, | ||
bool | isGndBased | ||
) |
Add this polygon as an obstacle. The obstacle can be either a human or a ground based or both. If not ground based, then the obstacle is detected from higher than ground stereo detecttions.
newPoly | is the new polygon, with positions in robot coordinates. |
odoPose | is the robot pose at sensor time |
isHuman | is detected from above ground and is "human" sized |
isGndBased | obstacle is detected as edge of ground plane. |
References UObj3dGroup::addObstPoly(), UPolygon::getPoints(), UPolygon::getPointsCnt(), UPose::getPoseToMap(), and UPoseTime::t.
UObj3dGroup * UObj3dPool::advanceNewGroup | ( | ) |
Advance to next obstacle group, and return pointer to new cleared group.
References UObstacleGroup::clear(), UObstacleGroup::setSerial(), and UObj3dGroup::UObj3dGroup().
void UObj3dPool::clear | ( | void | ) |
Clear all obstacles from obstacle pool, that is remove all obstacles from all groups, but maintain the groups with pose and other informations.
References UObstacleGroup::getPoseLast(), and UObstacleGroup::removeAllObsts().
Referenced by UFuncObj3d::handleCommand().
void UObj3dPool::clearGrp | ( | int | idx | ) |
Clear all obstacles from obstacle group. The 'idx' is the group to clear, idx = 0 clears the newest group and idx 1..N clears corresponding older groups.
References UObstacleGroup::getPoseLast().
Referenced by UFuncObj3d::handleCommand().
UObj3dGroup * UObj3dPool::getGroup | ( | int | fromNewest | ) |
Get number of groups in history
Referenced by UFuncObj3d::sendObjects().
|
inline |
Get number of groups in history
Referenced by UFuncObj3d::sendObjects().
|
virtual |
Load parameter values from current settings pool to this obstacle group
Reimplemented in UResObj3d.
UObj3dGroup * UObj3dPool::getObstGrp | ( | UPoseTime | pt | ) |
Get the obstacle group relevant for this time and robot position. Return pointer to the group.
References UObstacleGroup::getPoseFirst(), UObstacleGroup::logAll(), UObstacleGroup::removeInvalid(), UObstacleGroup::setPoseFirst(), UObj3dGroup::setPosePrev(), UPoseTime::t, UPose::x, and UPose::y.
Referenced by UFuncObj3d::handleCommand().
|
virtual |
Obstacle data is updated - tell resource
Reimplemented in UResObj3d.
void UObj3dPool::print | ( | const char * | prestr | ) |
Print status to console
void UObj3dPool::setLogFile | ( | FILE * | logFile | ) |
Set obstacle logfile
|
inline |
Set distance traveled by robot before new obstacle group are to be formed (meter).
|
inline |
Set time passed before new obstacle group are to be formed (in seconds).
|
protected |
Obstacle groups, each holding a coordinate-wise coherent set of obstacles - distance less than e.g 25 m from start to end pose.
|
protected |
Actual used number of obstacle groups
|
protected |
Obstacle logfile
|
static |
Max number of groups
|
protected |
The most recent obstacle group. When out of groups, then reuse.
|
protected |
Time passed before new obstacle group are to be formed (in seconds).
|
protected |
Distance traveled by robot before new obstacle group are to be formed (meter).
|
protected |
Next serial number to use for obstacle group