The subclass of PhyObject2DWrapper wrapping a wheeled robot. More...

Inheritance diagram for WheeledRobot2DWrapper:

Public Member Functions

virtual bool computeDistanceAndOrientationFromRobot (const WheeledRobot2DWrapper &robot, double &distance, double &angle) const
 Computes the distance and orientation of this object respect to the given robot.
 
virtual void computeLinearViewFieldOccupiedRange (const wMatrix &cameraMtr, double &minAngle, double &maxAngle, double &distance) const
 Computes the portion of a linear the view field occupied by this object.
 
double getHeight () const
 Returns the height of the robot.
 
double getRadius () const
 Returns the radius of the robot.
 
virtual PhyObjectphyObject ()
 Returns a pointer to the wrapped PhyObject.
 
virtual const PhyObjectphyObject () const
 Returns a pointer to the wrapper PhyObject (const version)
 
const wMatrixpreviousMatrix () const
 Returns the transformation matrix of the previous time-step.
 
RobotOnPlanerobotOnPlane ()
 Returns a pointer to the wrapped object as a RobotOnPlane.
 
const RobotOnPlanerobotOnPlane () const
 Returns a pointer to the wrapped object as a RobotOnPlane (const version)
 
virtual void setPosition (real x, real y)
 Sets the position of the object in the plane.
 
void storePreviousMatrix ()
 Stores the current matrix in the previousMatrix.
 
virtual Type type () const
 Returns the type of this wrapped object.
 
virtual WObjectwObject ()
 Returns a pointer to the wrapped object.
 
virtual const WObjectwObject () const
 Returns a pointer to the wrapped object (const version)
 
- Public Member Functions inherited from PhyObject2DWrapper
QColor color () const
 Returns the color to use when rendering this.
 
bool getStatic () const
 Returns true if the object is static.
 
wVector position () const
 Returns the position of the object.
 
void setColor (QColor color)
 Sets the color to use when rendering this.
 
void setPosition (wVector pos)
 Sets the position of the object in the plane.
 
virtual void setStatic (bool s)
 Sets whether the object is static or not.
 
void setTexture (QString textureName)
 Set the texture to use when rendering this.
 
void setUseColorTextureOfOwner (bool b)
 Sets whether this will be rendered with the color and texture of our owner (if we have one)
 
QString texture () const
 Returns the name of the texture.
 
bool useColorTextureOfOwner () const
 Returns whether this will be rendered with the color and texture of the owner (if we have one)
 

Protected Member Functions

 WheeledRobot2DWrapper (Arena *arena, RobotOnPlane *robot, double height, double radius)
 Constructor.
 
 ~WheeledRobot2DWrapper ()
 Destructor.
 
- Protected Member Functions inherited from PhyObject2DWrapper
 PhyObject2DWrapper (Arena *arena)
 Constructor.
 
virtual ~PhyObject2DWrapper ()
 Destructor.
 

Friends

class Arena
 The Arena class is friend to be able to instantiate and delete this class.
 

Additional Inherited Members

- Public Types inherited from PhyObject2DWrapper
enum  Type {
  Plane = 0, Wall, Box, RectangularTargetArea,
  Cylinder, SmallCylinder, BigCylinder, CircularTargetArea,
  WheeledRobot, NumberOfDifferentTypes
}
 The possible type of wrapped objects. More...
 
- Protected Attributes inherited from PhyObject2DWrapper
Arena *const m_arena
 The pointer to the arena in which this object lives.
 

Detailed Description

The subclass of PhyObject2DWrapper wrapping a wheeled robot.

Definition at line 583 of file wheeledexperimenthelper.h.

Constructor & Destructor Documentation

WheeledRobot2DWrapper ( Arena arena,
RobotOnPlane robot,
double  height,
double  radius 
)
protected

Constructor.

Parameters
arenathe arena in which this object lives
robotthe robot to wrap
heightthe height of the robot
radiusthe radius of the robot

Definition at line 563 of file wheeledexperimenthelper.cpp.

~WheeledRobot2DWrapper ( )
protected

Destructor.

Definition at line 572 of file wheeledexperimenthelper.cpp.

Member Function Documentation

bool computeDistanceAndOrientationFromRobot ( const WheeledRobot2DWrapper robot,
double &  distance,
double &  angle 
) const
virtual

Computes the distance and orientation of this object respect to the given robot.

This function computes the distance of this object from the given robot. The distance is computed between the nearest points of the two objects. The robot is always modelled as a vertical cylindrical object. The function returns false if it makes no sense to compute the distance (e.g. if robot is the same as this)

Parameters
robotthe robot from which the distance should be computed
distancethe computed distance
anglethe computed orientation
Returns
false if the distance couldn't be computed

Implements PhyObject2DWrapper.

Definition at line 630 of file wheeledexperimenthelper.cpp.

References Arena::getPlane(), WheeledRobot2DWrapper::getRadius(), PhyObject2DWrapper::m_arena, PhyObject2DWrapper::position(), and WheeledRobot2DWrapper::wObject().

void computeLinearViewFieldOccupiedRange ( const wMatrix cameraMtr,
double &  minAngle,
double &  maxAngle,
double &  distance 
) const
virtual

Computes the portion of a linear the view field occupied by this object.

This function returns the angular range occupied by this object on a linear camera described by the given matrix. The Z axis of the matrix is the upvector, the camera lies on the XY plane and points towars the X axis (i.e. angles start from the X axis). If the object is not visible by the camera, this function returns a negative distance. The min angle can be greater than the max angle if the object is behind the camera. Here we make the assumption that the camera is outside the object (otherwise the algorithm gives wrong results). The matrix representing the camera is translated so that it is on the same plane as the object base before doing computations

Parameters
cameraMtrthe matrix describing the camera (see function description)
minAnglethis is set to the minimum angle of the view field occupied by the object
maxAnglethis is set to the maximum angle of the view field occupied by the object
distancethis is set to the distance of the object from the camera. It is negative if the object is not visible by the camera

Implements PhyObject2DWrapper.

Definition at line 621 of file wheeledexperimenthelper.cpp.

References WObject::matrix(), wMatrix::w_pos, WheeledRobot2DWrapper::wObject(), and wVectorT< Shared >::z.

double getHeight ( ) const
inline

Returns the height of the robot.

Returns
the height of the robot

Definition at line 698 of file wheeledexperimenthelper.h.

double getRadius ( ) const
inline
PhyObject * phyObject ( )
virtual

Returns a pointer to the wrapped PhyObject.

This always returns NULL, as robots are not subclasses of PhyObject

Returns
always NULL

Implements PhyObject2DWrapper.

Definition at line 596 of file wheeledexperimenthelper.cpp.

const PhyObject * phyObject ( ) const
virtual

Returns a pointer to the wrapper PhyObject (const version)

This always returns NULL, as robots are not subclasses of PhyObject

Returns
always NULL

Implements PhyObject2DWrapper.

Definition at line 601 of file wheeledexperimenthelper.cpp.

const wMatrix& previousMatrix ( ) const
inline

Returns the transformation matrix of the previous time-step.

Returns
the transformation matrix of the previous time-step

Definition at line 728 of file wheeledexperimenthelper.h.

Referenced by Arena::handleKinematicRobotCollisions().

RobotOnPlane * robotOnPlane ( )

Returns a pointer to the wrapped object as a RobotOnPlane.

You should avoid changing the wrapped directly, use the methods of this class, instead

Returns
a pointer to the wrapped object

Definition at line 576 of file wheeledexperimenthelper.cpp.

Referenced by Arena::handleKinematicRobotCollisions(), and Arena::prepareToHandleKinematicRobotCollisions().

const RobotOnPlane * robotOnPlane ( ) const

Returns a pointer to the wrapped object as a RobotOnPlane (const version)

Returns
a const pointer to the wrapped object

Definition at line 581 of file wheeledexperimenthelper.cpp.

void setPosition ( real  x,
real  y 
)
virtual

Sets the position of the object in the plane.

Parameters
xthe new x coordinate
ythe new y coordinate

Implements PhyObject2DWrapper.

Definition at line 611 of file wheeledexperimenthelper.cpp.

References WObject::matrix(), WObject::setPosition(), wMatrix::w_pos, WheeledRobot2DWrapper::wObject(), and wVectorT< Shared >::x.

void storePreviousMatrix ( )
inline

Stores the current matrix in the previousMatrix.

Call this to update the value of m_previousMatrix

Definition at line 718 of file wheeledexperimenthelper.h.

References WObject::matrix().

Referenced by Arena::prepareToHandleKinematicRobotCollisions().

WheeledRobot2DWrapper::Type type ( ) const
virtual

Returns the type of this wrapped object.

Returns
the type of this wrapped object

Implements PhyObject2DWrapper.

Definition at line 606 of file wheeledexperimenthelper.cpp.

WObject * wObject ( )
virtual

Returns a pointer to the wrapped object.

You should avoid changing the wrapped directly, use the methods of this class, instead

Returns
a pointer to the wrapped object

Reimplemented from PhyObject2DWrapper.

Definition at line 586 of file wheeledexperimenthelper.cpp.

Referenced by Box2DWrapper::computeDistanceAndOrientationFromRobot(), Cylinder2DWrapper::computeDistanceAndOrientationFromRobot(), WheeledRobot2DWrapper::computeDistanceAndOrientationFromRobot(), WheeledRobot2DWrapper::computeLinearViewFieldOccupiedRange(), Arena::handleKinematicRobotCollisions(), and WheeledRobot2DWrapper::setPosition().

const WObject * wObject ( ) const
virtual

Returns a pointer to the wrapped object (const version)

Returns
a const pointer to the wrapped object

Reimplemented from PhyObject2DWrapper.

Definition at line 591 of file wheeledexperimenthelper.cpp.

Friends And Related Function Documentation

friend class Arena
friend

The Arena class is friend to be able to instantiate and delete this class.

Definition at line 777 of file wheeledexperimenthelper.h.


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