The base class for robots that move on a plane. More...

Inheritance diagram for RobotOnPlane:

Public Member Functions

 RobotOnPlane (ConfigurationParameters &params, QString prefix)
 Constructor.
 
virtual ~RobotOnPlane ()
 Destructor.
 
virtual bool isKinematic () const =0
 Returns true if the robot is in kinematic mode.
 
virtual real orientation (const Box2DWrapper *plane) const =0
 Returns the orientation of the robot.
 
virtual wVector position () const =0
 Returns the position of the robot.
 
virtual real robotHeight () const =0
 Returns the height of the robot.
 
virtual real robotRadius () const =0
 Returns the radius of the robot.
 
virtual void save (ConfigurationParameters &params, QString prefix)
 Saves the actual status of parameters into the ConfigurationParameters object passed.
 
virtual void setOrientation (const Box2DWrapper *plane, real angle)=0
 Sets the orientation of the robot.
 
void setPosition (const Box2DWrapper *plane, const wVector &pos)
 Sets the position of the robot in the plane.
 
virtual void setPosition (const Box2DWrapper *plane, real x, real y)=0
 Sets the position of the robot in the plane.
 
- Public Member Functions inherited from Robot
 Robot (ConfigurationParameters &params, QString prefix)
 Constructor.
 
virtual ~Robot ()
 Destructor.
 
- Public Member Functions inherited from ParameterSettableInConstructor
 ParameterSettableInConstructor (ConfigurationParameters &, QString)
 
void addObserver (RuntimeParameterObserver *obs)
 
getRuntimeParameter (QString paramName)
 
virtual ParameterSettableUIgetUIManager ()
 
 ParameterSettable ()
 
virtual void postConfigureInitialization ()
 
void removeObserver (RuntimeParameterObserver *obs)
 
void setRuntimeParameter (QString paramName, T newvalue)
 
QString typeName () const
 
- Public Member Functions inherited from ParameterSettable
void addObserver (RuntimeParameterObserver *obs)
 
getRuntimeParameter (QString paramName)
 
void removeObserver (RuntimeParameterObserver *obs)
 
void setRuntimeParameter (QString paramName, T newvalue)
 
QString typeName () const
 

Static Public Member Functions

static void describe (QString type)
 Add to Factory::typeDescriptions() the descriptions of all parameters and subgroups.
 

Static Protected Member Functions

static real angleBetweenXAxes (const wMatrix &mtr1, const wMatrix &mtr2)
 Returns the angle between the two x axis of the two given matrices projected on the XY plane of the first matrix.
 
static void orientationOnPlane (const Box2DWrapper *plane, real angle, wMatrix &mtr)
 Returns a transformation matrix with the given orientation on the plane.
 
static wVector positionOnPlane (const Box2DWrapper *plane, real x, real y)
 Returns the 3D position on the plane given a 2D position.
 

Additional Inherited Members

- Public Types inherited from ParameterSettableInConstructor
enum  Property
 
- Public Attributes inherited from ParameterSettableInConstructor
 AllowMultiple
 
 Default
 
 IsList
 
 IsMandatory
 
- Static Public Attributes inherited from ParameterSettableInConstructor
static const double Infinity
 
static const int MaxInteger
 
static const int MinInteger
 
- Protected Member Functions inherited from ParameterSettableInConstructor
void notifyChangesToParam (QString paramName)
 

Detailed Description

The base class for robots that move on a plane.

This has some utility methods common to all robots that move on a plane. There are also protected static helper methods which can be used when re-implementing in subclasses.

Definition at line 126 of file robots.h.

Constructor & Destructor Documentation

RobotOnPlane ( ConfigurationParameters params,
QString  prefix 
)

Constructor.

Parameters
paramsthe configuration parameters object with parameters to use
prefixthe prefix to use to access the object configuration parameters. This is guaranteed to end with the separator character when called by the factory, so you don't need to add one

Definition at line 438 of file robots.cpp.

~RobotOnPlane ( )
virtual

Destructor.

Definition at line 457 of file robots.cpp.

Member Function Documentation

real angleBetweenXAxes ( const wMatrix mtr1,
const wMatrix mtr2 
)
staticprotected

Returns the angle between the two x axis of the two given matrices projected on the XY plane of the first matrix.

This returns the angle in radiants between the projection of the two x axis of the two matrices on the xy plane of the first matrix. The result is only correct for sure if the two z axes are parallel

Parameters
mtr1the first matrix
mtr2the second matrix
Returns
the angle between the two x axes

Definition at line 492 of file robots.cpp.

References wVectorT< Shared >::scale(), wMatrix::x_ax, and wMatrix::z_ax.

Referenced by MarXbot::orientation(), Epuck::orientation(), and Khepera::orientation().

void describe ( QString  type)
static

Add to Factory::typeDescriptions() the descriptions of all parameters and subgroups.

Parameters
typeis the name of the type regarding the description. The type is used when a subclass reuse the description of its parent calling the parent describe method passing the type of the subclass. In this way, the result of the method describe of the parent will be the addition of the description of the parameters of the parent class into the type of the subclass

Definition at line 450 of file robots.cpp.

References ParameterSettableInConstructor::addTypeDescription(), and ParameterSettableInConstructor::describe().

Referenced by MarXbot::describe(), Epuck::describe(), and Khepera::describe().

virtual bool isKinematic ( ) const
pure virtual

Returns true if the robot is in kinematic mode.

Returns
true if the robot is in kinematic mode

Implemented in Khepera, Epuck, and MarXbot.

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

virtual real orientation ( const Box2DWrapper plane) const
pure virtual

Returns the orientation of the robot.

This returns the angle around the z axis of the "plane". An angle of 0 means that the X axis of the plane and of the robot are coincident (positive angles follow the right-hand rule). This function returns the angle in radiants

Parameters
planethe plane on which the robot is placed. You can use the plane returned by Arena::getPlane(), here.

Implemented in Khepera, Epuck, and MarXbot.

void orientationOnPlane ( const Box2DWrapper plane,
real  angle,
wMatrix mtr 
)
staticprotected

Returns a transformation matrix with the given orientation on the plane.

The position in the mtr matrix is not changed, but axes are changed so that z is coincident with the "plane" local z axis and the orientation is given by angle (see setOrientation() for more details).

Parameters
planethe plane on which the robot is placed. You can use the plane returned by Arena::getPlane(), here.
anglethe new orientation in radiants
mtrthe initial transformation of the robot that is changed by the function so that it has the new orientation

Definition at line 478 of file robots.cpp.

References PhyBox::matrix(), Box2DWrapper::phyObject(), wMatrix::rotateAround(), wMatrix::w_pos, and wMatrix::z_ax.

Referenced by MarXbot::setOrientation(), Epuck::setOrientation(), and Khepera::setOrientation().

virtual wVector position ( ) const
pure virtual

Returns the position of the robot.

Returns
the position of the robot

Implemented in Khepera, Epuck, and MarXbot.

wVector positionOnPlane ( const Box2DWrapper plane,
real  x,
real  y 
)
staticprotected

Returns the 3D position on the plane given a 2D position.

This is an helper function meant to be used when implementing the setPosition() virtual function. The returned position lies on the plane, translate it accordingly for robots

Definition at line 467 of file robots.cpp.

References Box2DWrapper::phyObject(), PhyObject2DWrapper::position(), and PhyBox::sideZ().

Referenced by MarXbot::setPosition(), Epuck::setPosition(), and Khepera::setPosition().

virtual real robotHeight ( ) const
pure virtual

Returns the height of the robot.

This is the height of the cylinder containing the robot. In some cases wheeled robots are modelled as cylinders to simplify calculations

Returns
the height of the robot

Implemented in Khepera, Epuck, and MarXbot.

Referenced by Arena::addRobots().

virtual real robotRadius ( ) const
pure virtual

Returns the radius of the robot.

This is the radius of the cylinder containing the robot. In some cases wheeled robots are modelled as cylinders to simplify calculations

Returns
the radius of the robot

Implemented in Khepera, Epuck, and MarXbot.

Referenced by Arena::addRobots().

void save ( ConfigurationParameters params,
QString  prefix 
)
virtual

Saves the actual status of parameters into the ConfigurationParameters object passed.

This is not implemented, calling this causes an abort

Parameters
paramsthe configuration parameters object on which save actual parameters
prefixthe prefix to use to access the object configuration parameters.

Implements ParameterSettableInConstructor.

Reimplemented in Khepera, Epuck, and MarXbot.

Definition at line 444 of file robots.cpp.

References Logger::error().

virtual void setOrientation ( const Box2DWrapper plane,
real  angle 
)
pure virtual

Sets the orientation of the robot.

This modifies the angle around the z axis of the "plane". An angle of 0 means that the X axis of the plane and of the robot are coincident (positive angles follow the right-hand rule). This function wants the angle in radiants

Parameters
planethe plane on which the robot is placed. You can use the plane returned by Arena::getPlane(), here.
anglethe new orientation in radiants

Implemented in Khepera, Epuck, and MarXbot.

void setPosition ( const Box2DWrapper plane,
const wVector &  pos 
)

Sets the position of the robot in the plane.

The Z coordinate is discarded. The robot is placed on the face of the "plane" parallel to the local XY plane and with positive z coordinate. This method simply calls setPosition(real x, real y)

Parameters
planethe plane on which the robot should be placed. You can use the plane returned by Arena::getPlane(), here.
posthe new position (the z coordinate is discarded)

Definition at line 462 of file robots.cpp.

virtual void setPosition ( const Box2DWrapper plane,
real  x,
real  y 
)
pure virtual

Sets the position of the robot in the plane.

The robot is placed on the face of the "plane" parallel to the local XY plane and with positive z coordinate.

Parameters
planethe plane on which the robot should be placed. You can use the plane returned by Arena::getPlane(), here.
xthe new x coordinate
ythe new y coordinate

Implemented in Khepera, Epuck, and MarXbot.


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