The subclass of PhyObject2DWrapper wrapping a wheeled robot. More...
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. More... | |
virtual void | computeLinearViewFieldOccupiedRange (const wMatrix &cameraMtr, QVector< AngularRangeAndColor > &rangesAndColors, double &distance, double maxDistance) const |
Computes the portion of a linear the view field occupied by this object. More... | |
double | getHeight () const |
Returns the height of the robot. More... | |
double | getRadius () const |
Returns the radius of the robot. More... | |
virtual PhyObject * | phyObject () |
Returns a pointer to the wrapped PhyObject. More... | |
virtual const PhyObject * | phyObject () const |
Returns a pointer to the wrapper PhyObject (const version) More... | |
RobotOnPlane * | robotOnPlane () |
Returns a pointer to the wrapped object as a RobotOnPlane. More... | |
const RobotOnPlane * | robotOnPlane () const |
Returns a pointer to the wrapped object as a RobotOnPlane (const version) More... | |
virtual void | setPosition (real x, real y) |
Sets the position of the object in the plane. More... | |
virtual Type | type () const |
Returns the type of this wrapped object. More... | |
virtual WObject * | wObject () |
Returns a pointer to the wrapped object. More... | |
virtual const WObject * | wObject () const |
Returns a pointer to the wrapped object (const version) More... | |
Public Member Functions inherited from PhyObject2DWrapper | |
QColor | color () const |
Returns the color to use when rendering this. More... | |
bool | getKinematic () const |
Returns true if the object has kinematic behaviour. More... | |
bool | getStatic () const |
Returns true if the object is static. More... | |
wVector | position () const |
Returns the position of the object. More... | |
const wMatrix & | previousMatrix () const |
Returns the transformation matrix of the previous time-step. More... | |
void | setColor (QColor color) |
Sets the color to use when rendering this. More... | |
virtual void | setKinematic (bool b, bool c=false) |
Sets whether the object is kinematic or not. More... | |
void | setPosition (wVector pos) |
Sets the position of the object in the plane. More... | |
virtual void | setStatic (bool s) |
Sets whether the object is static or not. More... | |
void | setTexture (QString textureName) |
Set the texture to use when rendering this. More... | |
void | setUseColorTextureOfOwner (bool b) |
Sets whether this will be rendered with the color and texture of our owner (if we have one) More... | |
void | storePreviousMatrix () |
Stores the current matrix in the previousMatrix. More... | |
QString | texture () const |
Returns the name of the texture. More... | |
bool | useColorTextureOfOwner () const |
Returns whether this will be rendered with the color and texture of the owner (if we have one) More... | |
Protected Member Functions | |
WheeledRobot2DWrapper (Arena *arena, RobotOnPlane *robot, double height, double radius) | |
Constructor. More... | |
~WheeledRobot2DWrapper () | |
Destructor. More... | |
Protected Member Functions inherited from PhyObject2DWrapper | |
PhyObject2DWrapper (Arena *arena) | |
Constructor. More... | |
virtual | ~PhyObject2DWrapper () |
Destructor. More... | |
Friends | |
class | Arena |
The Arena class is friend to be able to instantiate and delete this class. More... | |
Additional Inherited Members | |
Public Types inherited from PhyObject2DWrapper | |
enum | Type { Plane = 0, Wall, Box, RectangularTargetArea, Cylinder, SmallCylinder, BigCylinder, CircularTargetArea, LightBulb, 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. More... | |
Detailed Description
The subclass of PhyObject2DWrapper wrapping a wheeled robot.
Definition at line 896 of file wheeledexperimenthelper.h.
Constructor & Destructor Documentation
|
protected |
Constructor.
- Parameters
-
arena the arena in which this object lives robot the robot to wrap height the height of the robot radius the radius of the robot
Definition at line 871 of file wheeledexperimenthelper.cpp.
|
protected |
Destructor.
Definition at line 879 of file wheeledexperimenthelper.cpp.
Member Function Documentation
|
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
-
robot the robot from which the distance should be computed distance the computed distance angle the computed orientation
- Returns
- false if the distance couldn't be computed
Implements PhyObject2DWrapper.
Definition at line 953 of file wheeledexperimenthelper.cpp.
References Arena::getPlane(), WheeledRobot2DWrapper::getRadius(), PhyObject2DWrapper::m_arena, PhyObject2DWrapper::position(), and WheeledRobot2DWrapper::wObject().
|
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
-
cameraMtr the matrix describing the camera (see function description) rangesAndColors the list of occupied ranges and their color distance this is set to the distance of the object from the camera. It is negative if the object is not visible by the camera maxDistance this is the maximum distance the camera can see. If the object is farther than this distance the function can safely return a negative distance (i.e. the object is not seen) and stop any other computation
Implements PhyObject2DWrapper.
Definition at line 928 of file wheeledexperimenthelper.cpp.
References WObject::color(), WObject::matrix(), wMatrix::rotateAround(), PhyMarXbot::segmentsColor(), PhyEpuck::segmentsColor(), and WheeledRobot2DWrapper::wObject().
|
inline |
Returns the height of the robot.
- Returns
- the height of the robot
Definition at line 1013 of file wheeledexperimenthelper.h.
|
inline |
Returns the radius of the robot.
- Returns
- the radius of the robot
Definition at line 1023 of file wheeledexperimenthelper.h.
Referenced by Box2DWrapper::computeDistanceAndOrientationFromRobot(), Cylinder2DWrapper::computeDistanceAndOrientationFromRobot(), Sphere2DWrapper::computeDistanceAndOrientationFromRobot(), and WheeledRobot2DWrapper::computeDistanceAndOrientationFromRobot().
|
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 903 of file wheeledexperimenthelper.cpp.
|
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 908 of file wheeledexperimenthelper.cpp.
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 883 of file wheeledexperimenthelper.cpp.
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 888 of file wheeledexperimenthelper.cpp.
Sets the position of the object in the plane.
- Parameters
-
x the new x coordinate y the new y coordinate
Implements PhyObject2DWrapper.
Definition at line 918 of file wheeledexperimenthelper.cpp.
References WObject::matrix(), WObject::setPosition(), and WheeledRobot2DWrapper::wObject().
|
virtual |
Returns the type of this wrapped object.
- Returns
- the type of this wrapped object
Implements PhyObject2DWrapper.
Definition at line 913 of file wheeledexperimenthelper.cpp.
|
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 893 of file wheeledexperimenthelper.cpp.
Referenced by Box2DWrapper::computeDistanceAndOrientationFromRobot(), Cylinder2DWrapper::computeDistanceAndOrientationFromRobot(), Sphere2DWrapper::computeDistanceAndOrientationFromRobot(), WheeledRobot2DWrapper::computeDistanceAndOrientationFromRobot(), WheeledRobot2DWrapper::computeLinearViewFieldOccupiedRange(), and WheeledRobot2DWrapper::setPosition().
|
virtual |
Returns a pointer to the wrapped object (const version)
- Returns
- a const pointer to the wrapped object
Reimplemented from PhyObject2DWrapper.
Definition at line 898 of file wheeledexperimenthelper.cpp.
Friends And Related Function Documentation
|
friend |
The Arena class is friend to be able to instantiate and delete this class.
Definition at line 1064 of file wheeledexperimenthelper.h.
The documentation for this class was generated from the following files:
- experiments/include/wheeledexperimenthelper.h
- experiments/src/wheeledexperimenthelper.cpp