Homepage Demos Overview Downloads Tutorials Reference
Credits

MapBuilder Class Reference

#include <MapBuilder.h>

Inheritance diagram for MapBuilder:

Inheritance graph
[legend]
List of all members.

Detailed Description

Definition at line 24 of file MapBuilder.h.

Public Member Functions

 MapBuilder ()
 Constructor.
virtual ~MapBuilder ()
 Destructor.
virtual void DoStart ()
virtual void DoStop ()
virtual void processEvent (const EventBase &)
virtual std::string getDescription () const
void printShS (ShapeSpace &) const
unsigned int executeRequest (const MapBuilderRequest &req)
void processImage (const Sketch< uchar > &, const NEWMAT::Matrix &camToBase, const NEWMAT::Matrix &baseToCam)
const Shape< AgentData > & getAgent () const
 @ utility functions which may be used by MapBuilderRequests' exit condition and others
void setAgent (const Point &location, const AngTwoPi heading)
void moveAgent (coordinate_t const local_dx, coordinate_t const local_dy, AngTwoPi dtheta)
vector< ShapeRootgetShapes (const ShapeSpace &ShS, int minConf=2) const
const vector< Point > & getGazePts () const
vector< Shape< LineData > > getCamLines (const Sketch< uchar > &, const set< int > &objectColors, const set< int > &occluderColors) const
 @ Shape extraction functions
vector< Shape< PolygonData > > getCamPolygons (const Sketch< uchar > &, const set< int > &objectColors, const set< int > &occluderColors) const
vector< Shape< EllipseData > > getCamEllipses (const Sketch< uchar > &, const set< int > &objectColors, const set< int > &occluderColors) const
vector< Shape< SphereData > > getCamSpheres (const Sketch< uchar > &, const set< int > &objectColors, const set< int > &occluderColors) const
vector< Shape< LineData > > getCamWalls (const Sketch< uchar > &, unsigned int) const
vector< Shape< BlobData > > getCamBlobs (const Sketch< uchar > &sketch, const set< int > &objectColors) const
void importLocalToWorld ()
void importWorldToLocal (const ShapeRoot &shape)

Static Public Member Functions

static bool isPointVisible (const Point &pt, const NEWMAT::Matrix &baseToCam, float maxDistanceSq)
static bool isLineVisible (const LineData &ln, const NEWMAT::Matrix &baseToCam)
static bool isShapeVisible (const ShapeRoot &ground_shape, const NEWMAT::Matrix &baseToCam, float maxDistanceSq)
static bool returnTrue ()
static bool returnFalse ()
static Shape< BlobDataformBoundingBox (coordinate_t left, coordinate_t right, coordinate_t front, coordinate_t rear)
static void matchSrcToDst (ShapeSpace &src, ShapeSpace &dst, set< int > polygonEdgeColors=set< int >(), bool mergeSrc=true, bool mergeDst=true)

Public Attributes

const int xres
const int yres
 width and height of camera frame
NEWMAT::ColumnVector ground_plane
 ground plane to which shapes are projected

Protected Member Functions

void requestComplete ()
 posts completion event and deletes current request, executes next request if there is one
void executeRequest ()
 triggers action to execute the front one in requests queue
bool requestExitTest ()
 calls exitTest of current request if there is one and returns the result
void scan (ScanRequest &req)
 functions to make requests to lookout
void storeImageAt (const Point &pt)
void storeImage ()
void defineGazePts (vector< Point > &, const ShapeRoot &area, bool doScan)
 define gazePts either virtually or by scan
void defineGazePts (vector< Point > &gazePts, const vector< Point > &corners, float meshSize)
void getCameraShapes (const Sketch< uchar > &camFrame)
void getCamBlobs ()
void extendLocal (const NEWMAT::Matrix &baseToCam)
void extendWorld (const NEWMAT::Matrix &baseToCam)
void removeNoise (ShapeSpace &, const NEWMAT::Matrix &baseToCam)
 decrement confidence of shapes which should have been seen according to the baseToCam matrix
void removeGazePts (vector< Point > &, const NEWMAT::Matrix &baseToCam)
 erase gaze points which should have been seen according to the baseToCam matrix
bool determineNextGazePoint ()
 Returns true if it has set up a valid next gaze point in nextGazePoint.
bool determineNextGazePoint (const vector< ShapeRoot > &)
 Returns true if there is a shape which needs be looked at again and is reachable; sets it up as nextGazePoint.
bool determineNextGazePoint (vector< Point > &gazePts)
void moveToNextGazePoint (const bool manualOverride=false)
 Starts robot moving to the next gaze point.
bool isBadGazePoint (const Point &) const
void projectToGround (const NEWMAT::Matrix &camToBase)
void filterGroundShapes (const NEWMAT::Matrix &baseToCam)
void calculateGroundPlane (const MapBuilderRequest::GroundPlaneAssumption_t &gpa)

Protected Attributes

SketchSpacecamSkS
ShapeSpacecamShS
ShapeSpacegroundShS
DualCoding::MapBuilder::maps local
DualCoding::MapBuilder::maps world
DualCoding::MapBuilder::mapscur
Shape< AgentData > & theAgent
NEWMAT::Matrix localToWorldMatrix
 trasformation matrices between local and world frames.
NEWMAT::Matrix worldToLocalTranslateMatrix
NEWMAT::Matrix worldToLocalRotateMatrix
vector< PointbadGazePoints
 gaze points for which HeadPointerMC.lookAtPoint() returned false
bool agentAtOrigin
 whether or not agent is at origin and orientation is zero or two pi.
queue< MapBuilderRequest * > requests
MapBuilderRequestcurReq
unsigned int idCounter
unsigned int maxDistSq
 sqrt of current request's max distance parameter
unsigned int pointAtID
unsigned int scanID
 ID's for lookout requests.
Point nextGazePoint

Private Member Functions

 MapBuilder (const MapBuilder &)
 never call this
MapBuilderoperator= (const MapBuilder &)
 never call this

Classes

struct  maps


Constructor & Destructor Documentation

MapBuilder (  ) 

Constructor.

Definition at line 34 of file MapBuilder.cc.

virtual ~MapBuilder (  )  [inline, virtual]

Destructor.

Definition at line 68 of file MapBuilder.h.

MapBuilder ( const MapBuilder  )  [private]

never call this


Member Function Documentation

void calculateGroundPlane ( const MapBuilderRequest::GroundPlaneAssumption_t gpa  )  [protected]

Definition at line 541 of file MapBuilder.cc.

Referenced by MapBuilder::executeRequest(), and MapBuilder::processImage().

void defineGazePts ( vector< Point > &  gazePts,
const vector< Point > &  corners,
float  meshSize 
) [protected]

Definition at line 751 of file MapBuilder.cc.

void defineGazePts ( vector< Point > &  ,
const ShapeRoot area,
bool  doScan 
) [protected]

define gazePts either virtually or by scan

Definition at line 697 of file MapBuilder.cc.

Referenced by MapBuilder::executeRequest().

bool determineNextGazePoint ( vector< Point > &  gazePts  )  [protected]

Definition at line 258 of file MapBuilder.cc.

bool determineNextGazePoint ( const vector< ShapeRoot > &   )  [protected]

Returns true if there is a shape which needs be looked at again and is reachable; sets it up as nextGazePoint.

Definition at line 212 of file MapBuilder.cc.

bool determineNextGazePoint (  )  [protected]

Returns true if it has set up a valid next gaze point in nextGazePoint.

Definition at line 200 of file MapBuilder.cc.

Referenced by MapBuilder::executeRequest(), and MapBuilder::processEvent().

void DoStart (  )  [virtual]

Definition at line 50 of file MapBuilder.cc.

Referenced by VRmixin::startCrew().

void DoStop (  )  [virtual]

Definition at line 62 of file MapBuilder.cc.

Referenced by VRmixin::stopCrew().

unsigned int executeRequest ( const MapBuilderRequest req  ) 

Definition at line 82 of file MapBuilder.cc.

void executeRequest (  )  [protected]

triggers action to execute the front one in requests queue

Definition at line 114 of file MapBuilder.cc.

Referenced by MapBuilder::executeRequest(), and MapBuilder::requestComplete().

void extendLocal ( const NEWMAT::Matrix &  baseToCam  )  [protected]

Definition at line 320 of file MapBuilder.cc.

Referenced by MapBuilder::processEvent().

void extendWorld ( const NEWMAT::Matrix &  baseToCam  )  [protected]

Definition at line 328 of file MapBuilder.cc.

Referenced by MapBuilder::processEvent().

void filterGroundShapes ( const NEWMAT::Matrix &  baseToCam  )  [protected]

Definition at line 475 of file MapBuilder.cc.

Referenced by MapBuilder::processImage().

static Shape<BlobData> formBoundingBox ( coordinate_t  left,
coordinate_t  right,
coordinate_t  front,
coordinate_t  rear 
) [inline, static]

Definition at line 131 of file MapBuilder.h.

const Shape<AgentData>& getAgent (  )  const [inline]

@ utility functions which may be used by MapBuilderRequests' exit condition and others

Definition at line 85 of file MapBuilder.h.

void getCamBlobs (  )  [protected]

Definition at line 995 of file MapBuilder.cc.

vector<Shape<BlobData> > getCamBlobs ( const Sketch< uchar > &  sketch,
const set< int > &  objectColors 
) const [inline]

Definition at line 126 of file MapBuilder.h.

vector< Shape< EllipseData > > getCamEllipses ( const Sketch< uchar > &  ,
const set< int > &  objectColors,
const set< int > &  occluderColors 
) const

Definition at line 893 of file MapBuilder.cc.

Referenced by MapBuilder::getCameraShapes().

void getCameraShapes ( const Sketch< uchar > &  camFrame  )  [protected]

Definition at line 858 of file MapBuilder.cc.

Referenced by MapBuilder::processImage().

vector< Shape< LineData > > getCamLines ( const Sketch< uchar > &  ,
const set< int > &  objectColors,
const set< int > &  occluderColors 
) const

@ Shape extraction functions

Definition at line 868 of file MapBuilder.cc.

Referenced by MapBuilder::getCameraShapes().

vector< Shape< PolygonData > > getCamPolygons ( const Sketch< uchar > &  ,
const set< int > &  objectColors,
const set< int > &  occluderColors 
) const

Definition at line 910 of file MapBuilder.cc.

Referenced by MapBuilder::getCameraShapes().

vector< Shape< SphereData > > getCamSpheres ( const Sketch< uchar > &  ,
const set< int > &  objectColors,
const set< int > &  occluderColors 
) const

Definition at line 936 of file MapBuilder.cc.

Referenced by MapBuilder::getCameraShapes().

vector< Shape< LineData > > getCamWalls ( const Sketch< uchar > &  ,
unsigned  int 
) const

Definition at line 953 of file MapBuilder.cc.

Referenced by MapBuilder::getCameraShapes().

virtual std::string getDescription (  )  const [inline, virtual]

Definition at line 72 of file MapBuilder.h.

const vector<Point>& getGazePts (  )  const [inline]

Definition at line 105 of file MapBuilder.h.

vector<ShapeRoot> getShapes ( const ShapeSpace ShS,
int  minConf = 2 
) const [inline]

Definition at line 93 of file MapBuilder.h.

void importLocalToWorld (  ) 

Definition at line 398 of file MapBuilder.cc.

void importWorldToLocal ( const ShapeRoot shape  ) 

Definition at line 409 of file MapBuilder.cc.

bool isBadGazePoint ( const Point  )  const [protected]

Definition at line 292 of file MapBuilder.cc.

Referenced by MapBuilder::determineNextGazePoint().

bool isLineVisible ( const LineData ln,
const NEWMAT::Matrix &  baseToCam 
) [static]

Definition at line 423 of file MapBuilder.cc.

Referenced by MapBuilder::isShapeVisible(), and MapBuilder::removeNoise().

bool isPointVisible ( const Point pt,
const NEWMAT::Matrix &  baseToCam,
float  maxDistanceSq 
) [static]

Definition at line 415 of file MapBuilder.cc.

Referenced by MapBuilder::isShapeVisible(), and MapBuilder::removeGazePts().

bool isShapeVisible ( const ShapeRoot ground_shape,
const NEWMAT::Matrix &  baseToCam,
float  maxDistanceSq 
) [static]

Definition at line 455 of file MapBuilder.cc.

Referenced by MapBuilder::removeNoise().

void matchSrcToDst ( ShapeSpace src,
ShapeSpace dst,
set< int >  polygonEdgeColors = set< int >(),
bool  mergeSrc = true,
bool  mergeDst = true 
) [static]

void moveAgent ( coordinate_t const   local_dx,
coordinate_t const   local_dy,
AngTwoPi  dtheta 
)

Definition at line 386 of file MapBuilder.cc.

void moveToNextGazePoint ( const bool  manualOverride = false  )  [protected]

Starts robot moving to the next gaze point.

Definition at line 277 of file MapBuilder.cc.

Referenced by MapBuilder::executeRequest(), and MapBuilder::processEvent().

MapBuilder& operator= ( const MapBuilder  )  [private]

never call this

void printShS ( ShapeSpace  )  const

Definition at line 829 of file MapBuilder.cc.

void processEvent ( const EventBase &   )  [virtual]

Definition at line 145 of file MapBuilder.cc.

void processImage ( const Sketch< uchar > &  ,
const NEWMAT::Matrix &  camToBase,
const NEWMAT::Matrix &  baseToCam 
)

Definition at line 190 of file MapBuilder.cc.

Referenced by MapBuilder::processEvent().

void projectToGround ( const NEWMAT::Matrix &  camToBase  )  [protected]

Definition at line 559 of file MapBuilder.cc.

Referenced by MapBuilder::processImage().

void removeGazePts ( vector< Point > &  ,
const NEWMAT::Matrix &  baseToCam 
) [protected]

erase gaze points which should have been seen according to the baseToCam matrix

Definition at line 810 of file MapBuilder.cc.

Referenced by MapBuilder::extendLocal(), and MapBuilder::extendWorld().

void removeNoise ( ShapeSpace ,
const NEWMAT::Matrix &  baseToCam 
) [protected]

decrement confidence of shapes which should have been seen according to the baseToCam matrix

Definition at line 654 of file MapBuilder.cc.

Referenced by MapBuilder::extendLocal(), and MapBuilder::extendWorld().

void requestComplete (  )  [protected]

posts completion event and deletes current request, executes next request if there is one

Definition at line 350 of file MapBuilder.cc.

Referenced by MapBuilder::defineGazePts(), MapBuilder::executeRequest(), and MapBuilder::processEvent().

bool requestExitTest (  )  [protected]

calls exitTest of current request if there is one and returns the result

Definition at line 341 of file MapBuilder.cc.

Referenced by MapBuilder::processEvent().

static bool returnFalse (  )  [inline, static]

Definition at line 107 of file MapBuilder.h.

static bool returnTrue (  )  [inline, static]

Definition at line 106 of file MapBuilder.h.

void scan ( ScanRequest req  )  [protected]

functions to make requests to lookout

Definition at line 309 of file MapBuilder.cc.

Referenced by MapBuilder::defineGazePts().

void setAgent ( const Point location,
const AngTwoPi  heading 
)

Definition at line 362 of file MapBuilder.cc.

Referenced by MapBuilder::DoStop(), and MapBuilder::moveAgent().

void storeImage (  )  [protected]

Definition at line 304 of file MapBuilder.cc.

Referenced by MapBuilder::executeRequest().

void storeImageAt ( const Point pt  )  [protected]

Definition at line 299 of file MapBuilder.cc.

Referenced by MapBuilder::executeRequest(), and MapBuilder::moveToNextGazePoint().


Member Data Documentation

bool agentAtOrigin [protected]

whether or not agent is at origin and orientation is zero or two pi.

Definition at line 49 of file MapBuilder.h.

Referenced by MapBuilder::determineNextGazePoint(), MapBuilder::extendWorld(), MapBuilder::importLocalToWorld(), and MapBuilder::setAgent().

vector<Point> badGazePoints [protected]

gaze points for which HeadPointerMC.lookAtPoint() returned false

Definition at line 48 of file MapBuilder.h.

Referenced by MapBuilder::determineNextGazePoint(), MapBuilder::DoStop(), and MapBuilder::filterGroundShapes().

ShapeSpace& camShS [protected]

SketchSpace& camSkS [protected]

Definition at line 26 of file MapBuilder.h.

Referenced by MapBuilder::DoStop().

NEWMAT::ColumnVector ground_plane

ground plane to which shapes are projected

Definition at line 41 of file MapBuilder.h.

Referenced by MapBuilder::calculateGroundPlane(), and MapBuilder::projectToGround().

unsigned int idCounter [protected]

Definition at line 53 of file MapBuilder.h.

Referenced by MapBuilder::executeRequest().

NEWMAT::Matrix localToWorldMatrix [protected]

trasformation matrices between local and world frames.

Definition at line 46 of file MapBuilder.h.

Referenced by MapBuilder::determineNextGazePoint(), MapBuilder::extendWorld(), MapBuilder::importLocalToWorld(), and MapBuilder::setAgent().

unsigned int maxDistSq [protected]

sqrt of current request's max distance parameter

Definition at line 55 of file MapBuilder.h.

Referenced by MapBuilder::executeRequest(), MapBuilder::filterGroundShapes(), MapBuilder::isBadGazePoint(), MapBuilder::removeGazePts(), and MapBuilder::removeNoise().

unsigned int pointAtID [protected]

unsigned int scanID [protected]

ID's for lookout requests.

Definition at line 56 of file MapBuilder.h.

Referenced by MapBuilder::processEvent(), and MapBuilder::scan().

Shape<AgentData>& theAgent [protected]

agent in the world frame

Definition at line 44 of file MapBuilder.h.

Referenced by MapBuilder::getAgent(), MapBuilder::moveAgent(), and MapBuilder::setAgent().

const int xres

Definition at line 40 of file MapBuilder.h.

Referenced by MapBuilder::getCamWalls().

const int yres

width and height of camera frame

Definition at line 40 of file MapBuilder.h.

Referenced by MapBuilder::getCamWalls().


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

DualCoding 3.0beta
Generated Wed Oct 4 00:02:27 2006 by Doxygen 1.4.7