Public Member Functions | |
VectorField (OptionManager &mgr, const std::string &descrName="VectorField", const std::string &tagName="VectorField", const int width=300, const int height=300) | |
Default constructor; see ModelComponent.H. | |
VectorField (Image< geom::vec2f > afield) | |
constructor from field | |
~VectorField () | |
Destructor. | |
Image< geom::vec2f > | getField () |
getField() -- returns the current vector field. | |
virtual Image< PixRGB< byte > > | updateField (std::vector< Point2D< float > > sensorData, Point2D< int > robotPos, float robotOrient, Point2D< int > goal) |
Image< PixRGB< byte > > | plotField (int spacing) |
plotField() -- plot the current vector Field. | |
Image< PixRGB< byte > > | plotGridField (int spacing) |
plotGridField() -- plot the current vector Field. | |
geom::vec2f | getVectorAt (Point2D< int > location) |
getVectorAt() -- get the vector at current robot location | |
void | setVectorAt (Point2D< int > location, geom::vec2f val) |
setVectorAt() -- get the vector at current robot location | |
void | scaleFieldBy (float factor) |
scaleFieldby -- scale vector field by factor | |
void | scaleGoalFieldBy (float factor) |
scaleGoalFieldby -- scale Goal vector field by factor | |
void | makeUnitLength () |
make unit length -- set all vectors in vector field to fixed length | |
void | normalizeTo (float maxFactor) |
normalizeTo -- normalize to a max factor | |
void | rotateField (float ang) |
rotateField -- rotate the vector field by some angle | |
void | rotateGoalField (float ang) |
rotateGoalField -- rotate the vector field by some angle | |
Protected Attributes | |
Image< geom::vec2f > | itsField |
Image< geom::vec2f > | itsGoalField |
std::vector< Point2D< float > > | itsSensorData |
Point2D< int > | itsRobotPos |
float | itsRobotOrientation |
Point2D< float > | itsGoal |
Dims | itsDims |
Definition at line 51 of file VectorField.H.
VectorField::VectorField | ( | OptionManager & | mgr, | |
const std::string & | descrName = "VectorField" , |
|||
const std::string & | tagName = "VectorField" , |
|||
const int | width = 300 , |
|||
const int | height = 300 | |||
) |
Default constructor; see ModelComponent.H.
Definition at line 47 of file VectorField.C.
References Image< T >::clear(), and NO_INIT.
VectorField::VectorField | ( | Image< geom::vec2f > | afield | ) | [inline] |
constructor from field
Definition at line 61 of file VectorField.H.
References Image< T >::getDims().
VectorField::~VectorField | ( | ) |
Destructor.
Definition at line 65 of file VectorField.C.
Image< geom::vec2f > VectorField::getField | ( | ) |
getField() -- returns the current vector field.
Definition at line 69 of file VectorField.C.
geom::vec2f VectorField::getVectorAt | ( | Point2D< int > | location | ) |
getVectorAt() -- get the vector at current robot location
Definition at line 181 of file VectorField.C.
References Image< T >::getVal(), and Point2D< T >::i.
void VectorField::makeUnitLength | ( | ) |
make unit length -- set all vectors in vector field to fixed length
Definition at line 223 of file VectorField.C.
References Image< T >::beginw(), and Image< T >::end().
void VectorField::normalizeTo | ( | float | maxFactor | ) |
normalizeTo -- normalize to a max factor
Definition at line 236 of file VectorField.C.
References Image< T >::beginw(), and Image< T >::end().
plotField() -- plot the current vector Field.
Definition at line 76 of file VectorField.C.
References Image< T >::beginw(), drawDisk(), Image< T >::endw(), Dims::h(), Point2D< T >::i, Dims::w(), and ZEROS.
plotGridField() -- plot the current vector Field.
Definition at line 125 of file VectorField.C.
References Image< T >::beginw(), drawCircle(), drawDisk(), Image< T >::endw(), Dims::h(), Point2D< T >::i, Dims::w(), and ZEROS.
void VectorField::rotateField | ( | float | ang | ) |
rotateField -- rotate the vector field by some angle
Definition at line 250 of file VectorField.C.
References Image< T >::beginw(), Image< T >::end(), Point2D< T >::i, and rotate().
void VectorField::rotateGoalField | ( | float | ang | ) |
rotateGoalField -- rotate the vector field by some angle
Definition at line 270 of file VectorField.C.
References Image< T >::beginw(), and Image< T >::end().
Referenced by VectorHistField::updateField().
void VectorField::scaleFieldBy | ( | float | factor | ) |
scaleFieldby -- scale vector field by factor
scaleby -- scale vector field by factor
Definition at line 197 of file VectorField.C.
References Image< T >::beginw(), and Image< T >::end().
Referenced by VectorHistField::updateField().
void VectorField::scaleGoalFieldBy | ( | float | factor | ) |
scaleGoalFieldby -- scale Goal vector field by factor
scaleby -- scale vector field by factor
Definition at line 212 of file VectorField.C.
References Image< T >::beginw(), and Image< T >::end().
Referenced by VectorHistField::updateField().
void VectorField::setVectorAt | ( | Point2D< int > | location, | |
geom::vec2f | val | |||
) |
setVectorAt() -- get the vector at current robot location
Definition at line 188 of file VectorField.C.
References Point2D< T >::i, and Image< T >::setVal().
virtual Image<PixRGB<byte> > VectorField::updateField | ( | std::vector< Point2D< float > > | sensorData, | |
Point2D< int > | robotPos, | |||
float | robotOrient, | |||
Point2D< int > | goal | |||
) | [inline, virtual] |
updateField() -- update the current field based on some sensor data of type Point2D<int> a; where a.i = distance a.j=angle of obstacle since this can be pretty implementation specific we keep this virtual so that different algorithms can implement their own implementation of this method.
Definition at line 78 of file VectorField.H.
References ZEROS.