Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

AgentData Class Reference

Representation of the robot on the world map. More...

#include <AgentData.h>

Inheritance diagram for AgentData:

Detailed Description

Representation of the robot on the world map.

Definition at line 20 of file AgentData.h.

List of all members.

Classes

struct  ColorIdTarget

Public Types

enum  RobotSide { FRONT, BACK, LEFT, RIGHT }
 

Extraction.

More...

Public Member Functions

 AgentData (ShapeSpace &_space, const Point &c, AngTwoPi orient=0.f)
 Constructor.
 AgentData (const AgentData &otherData)
 Copy constructor.
 DATASTUFF_H (AgentData)
Point getCentroid () const
 Centroid. (Virtual in BaseData.).
int getHostAddr () const
 Returns the agent's IP address.
void setHostAddr (int addr)
 Sets the agent's IP address.
BoundingBox2D getBoundingBox () const
 Returns the bounding box of the agent.
virtual bool isMatchFor (const ShapeRoot &other) const
 Match agents based on their parameters. (Virtual in BaseData.).
virtual void printParams () const
 Print information about this shape. (Virtual in BaseData.).
virtual bool updateParams (const ShapeRoot &other, bool force=false)
 Update shape parameters after matching to another shape.
virtual void projectToGround (const fmat::Transform &camToBase, const PlaneEquation &groundplane)
 Project to ground plane using given matrix.
virtual void applyTransform (const fmat::Transform &Tmat, const ReferenceFrameType_t newref=unspecified)
 Transformations. (Virtual in BaseData.).
virtual unsigned short getDimension () const
AngTwoPi getOrientation () const
fmat::Column< 3 > getBoundingBoxOffset () const
fmat::Column< 3 > getBoundingBoxHalfDims () const
void setOrientation (AngTwoPi _orientation)
 Don't call this; use MapBuilder::setAgent().
void setCentroidPt (const Point &otherPt)
 Don't call this; use MapBuilder::setAgent().
virtual Sketch< bool > * render () const
 Render into a sketch space and return reference.
AgentDataoperator= (const AgentData &)
 don't call

Static Public Member Functions

static ShapeType_t getStaticType ()
static int getColorIdMatch (yuv pixelColor)
static int getIdFromCenter (const Sketch< yuv > &cam_frame, const Point &a, const Point &b, const Point &c)
static int getIdFromCorner (const Sketch< yuv > &cam_frame, const Point &vert_a, const Point &vert_b, const Point &loner)
static bool compareCircleSize (const Shape< EllipseData > &a, const Shape< EllipseData > &b)
static bool compareCircleDist (const Point &a, const Point &b)
static bool circlesVerticallyAligned (const Shape< EllipseData > &a, const Shape< EllipseData > &b)
static bool circlesHorizontallyAligned (const Shape< EllipseData > &a, const Shape< EllipseData > &b)
static void findCirclesManual (const Sketch< uchar > &camFrame, std::vector< int > &neighbor_density, std::vector< Shape< EllipseData > > &agentIdCircles)
static void findAgentsBelt (const Sketch< yuv > &camFrameYUV, const std::vector< int > &neighbor_density, const std::vector< Shape< EllipseData > > &agentIdCircles)
static void filterAgentOverlap ()
static void extractAgents (const Sketch< uchar > &camFrame, const Sketch< yuv > &camFrameYUV, const std::set< color_index > &objcolors)

Static Public Attributes

static const int NUM_COLOR_IDS = 4
static ColorIdTarget color_ids [NUM_COLOR_IDS]
static const char * agent_names [NUM_COLOR_IDS]

Private Attributes

Point center_pt
AngTwoPi orientation
int hostAddr

Member Enumeration Documentation

enum RobotSide

Extraction.

Enumerator:
FRONT 
BACK 
LEFT 
RIGHT 

Definition at line 83 of file AgentData.h.


Constructor & Destructor Documentation

AgentData ( ShapeSpace _space,
const Point c,
AngTwoPi  orient = 0.f 
)

Constructor.

Definition at line 31 of file AgentData.cc.

AgentData ( const AgentData otherData  ) 

Copy constructor.

Definition at line 35 of file AgentData.cc.


Member Function Documentation

void applyTransform ( const fmat::Transform Tmat,
const ReferenceFrameType_t  newref = unspecified 
) [virtual]

Transformations. (Virtual in BaseData.).

Implements BaseData.

Definition at line 84 of file AgentData.cc.

bool circlesHorizontallyAligned ( const Shape< EllipseData > &  a,
const Shape< EllipseData > &  b 
) [static]

Definition at line 204 of file AgentData.cc.

Referenced by AgentData::findAgentsBelt().

bool circlesVerticallyAligned ( const Shape< EllipseData > &  a,
const Shape< EllipseData > &  b 
) [static]

Definition at line 191 of file AgentData.cc.

Referenced by AgentData::findAgentsBelt().

static bool compareCircleDist ( const Point a,
const Point b 
) [static]

Definition at line 113 of file AgentData.h.

Referenced by AgentData::findAgentsBelt().

static bool compareCircleSize ( const Shape< EllipseData > &  a,
const Shape< EllipseData > &  b 
) [static]

Definition at line 108 of file AgentData.h.

Referenced by AgentData::findAgentsBelt().

DATASTUFF_H ( AgentData   ) 
void extractAgents ( const Sketch< uchar > &  camFrame,
const Sketch< yuv > &  camFrameYUV,
const std::set< color_index > &  objcolors 
) [static]

Definition at line 503 of file AgentData.cc.

static void filterAgentOverlap (  )  [static]
void findAgentsBelt ( const Sketch< yuv > &  camFrameYUV,
const std::vector< int > &  neighbor_density,
const std::vector< Shape< EllipseData > > &  agentIdCircles 
) [static]

Definition at line 324 of file AgentData.cc.

Referenced by AgentData::extractAgents().

void findCirclesManual ( const Sketch< uchar > &  camFrame,
std::vector< int > &  neighbor_density,
std::vector< Shape< EllipseData > > &  agentIdCircles 
) [static]

Definition at line 217 of file AgentData.cc.

Referenced by AgentData::extractAgents().

BoundingBox2D getBoundingBox (  )  const [virtual]

Returns the bounding box of the agent.

Reimplemented from BaseData.

Definition at line 42 of file AgentData.cc.

fmat::Column<3> getBoundingBoxHalfDims (  )  const

Definition at line 71 of file AgentData.h.

fmat::Column<3> getBoundingBoxOffset (  )  const

Definition at line 70 of file AgentData.h.

Point getCentroid (  )  const [virtual]

Centroid. (Virtual in BaseData.).

Implements BaseData.

Definition at line 42 of file AgentData.h.

Referenced by AgentData::findAgentsBelt(), AgentData::printParams(), AgentData::render(), and AgentData::updateParams().

int getColorIdMatch ( yuv  pixelColor  )  [static]

Definition at line 148 of file AgentData.cc.

Referenced by AgentData::getIdFromCenter(), and AgentData::getIdFromCorner().

virtual unsigned short getDimension (  )  const [virtual]

Implements BaseData.

Definition at line 67 of file AgentData.h.

int getHostAddr (  )  const

Returns the agent's IP address.

Definition at line 45 of file AgentData.h.

int getIdFromCenter ( const Sketch< yuv > &  cam_frame,
const Point a,
const Point b,
const Point c 
) [static]

Definition at line 174 of file AgentData.cc.

int getIdFromCorner ( const Sketch< yuv > &  cam_frame,
const Point vert_a,
const Point vert_b,
const Point loner 
) [static]

Definition at line 181 of file AgentData.cc.

Referenced by AgentData::findAgentsBelt().

AngTwoPi getOrientation (  )  const

Definition at line 69 of file AgentData.h.

Referenced by AgentData::updateParams().

static ShapeType_t getStaticType (  )  [static]

Definition at line 33 of file AgentData.h.

bool isMatchFor ( const ShapeRoot other  )  const [virtual]

Match agents based on their parameters. (Virtual in BaseData.).

Implements BaseData.

Definition at line 54 of file AgentData.cc.

Referenced by AgentData::updateParams().

AgentData& operator= ( const AgentData  ) 

don't call

void printParams (  )  const [virtual]

Print information about this shape. (Virtual in BaseData.).

Implements BaseData.

Definition at line 65 of file AgentData.cc.

void projectToGround ( const fmat::Transform camToBase,
const PlaneEquation groundplane 
) [virtual]

Project to ground plane using given matrix.

Implements BaseData.

Definition at line 98 of file AgentData.cc.

Sketch< bool > * render (  )  const [virtual]

Render into a sketch space and return reference.

Render into a sketch space and return reference. (Private.).

Implements BaseData.

Definition at line 118 of file AgentData.cc.

void setCentroidPt ( const Point otherPt  ) 

Don't call this; use MapBuilder::setAgent().

Definition at line 74 of file AgentData.h.

void setHostAddr ( int  addr  ) 

Sets the agent's IP address.

Definition at line 48 of file AgentData.h.

void setOrientation ( AngTwoPi  _orientation  ) 

Don't call this; use MapBuilder::setAgent().

Functions to set properties.

Definition at line 93 of file AgentData.cc.

bool updateParams ( const ShapeRoot other,
bool  forceUpdate = false 
) [virtual]

Update shape parameters after matching to another shape.

Implements BaseData.

Definition at line 103 of file AgentData.cc.


Member Data Documentation

const char * agent_names [static]
Initial value:
 {
    "octopus", 
    "turtle", 
    "cycle", 
    "kodu", 
  }

Definition at line 102 of file AgentData.h.

Referenced by AgentData::findAgentsBelt().

Initial value:
 {
    { 0, -1, -1, 115, 1.086f, 135, -0.638f}, 
    { 1, -1, -1, 110, 0, 130, -0.186}, 
    { 2, -1, -1, 90, 0, 152, -0.121f},  
    { 3, 0, 16, 128, 0, 128, 0},  
  }

Definition at line 101 of file AgentData.h.

Referenced by AgentData::getColorIdMatch().

int hostAddr [private]

Definition at line 24 of file AgentData.h.

Referenced by AgentData::getHostAddr(), and AgentData::setHostAddr().

const int NUM_COLOR_IDS = 4 [static]

Definition at line 100 of file AgentData.h.

Referenced by AgentData::getColorIdMatch().


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

DualCoding 5.1CVS
Generated Mon May 9 04:56:30 2016 by Doxygen 1.6.3