The class modelling an arena. More...

Inheritance diagram for Arena:

Public Member Functions

 Arena (ConfigurationParameters &params, QString prefix)
 Constructor.
 
virtual ~Arena ()
 Destructor.
 
void addRobots (QStringList robots)
 Adds robots to the list of 2D objects.
 
Cylinder2DWrappercreateBigCylinder (QColor color, real height=-1.0)
 Creates a big cylinder.
 
Cylinder2DWrappercreateCircularTargetArea (real radius, QColor color)
 Creates a circular target area.
 
Box2DWrappercreateRectangularTargetArea (real width, real depth, QColor color)
 Creates a rectangular target area.
 
Cylinder2DWrappercreateSmallCylinder (QColor color, real height=-1.0)
 Creates a small cylinder.
 
Box2DWrappercreateWall (QColor color, wVector start, wVector end, real thickness, real height=-1.0)
 Creates a wall.
 
real getHeight () const
 Returns the height of the main plane.
 
const QVector
< PhyObject2DWrapper * > & 
getObjects () const
 Returns the list of 2D objects.
 
Box2DWrappergetPlane ()
 Returns the plane of the arena.
 
real getWidth () const
 Returns the width of the main plane.
 
real getZ () const
 Returns the z of the plane.
 
virtual void save (ConfigurationParameters &params, QString prefix)
 Saves the actual status of parameters into the ConfigurationParameters object passed.
 
- 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
 
- Public Member Functions inherited from ConcurrentResourcesUser
void addUsableResource (QString resource)
 
void addUsableResources (QStringList resources)
 
void declareResource (QString name, T *resource, QString lockBuddy="")
 
void deleteResource (QString name)
 
T * getResource (QString name, bool *resourceExists=NULL)
 
bool hasResource (QString name) const
 
void removeAllUsableResources ()
 
void removeUsableResource (QString resource)
 
void removeUsableResources (QStringList resources)
 
virtual void shareResourcesWith (ResourcesUser *buddy)
 
void usableResources (QStringList resources)
 
bool usedResourcesExist (QStringList *nonExistingResources=NULL) const
 

Static Public Member Functions

static void describe (QString type)
 Adds to Factory::typeDescriptions() the descriptions of all parameters and subgroups.
 
- Static Public Member Functions inherited from ParameterSettableInConstructor
static void describe (QString type)
 
static QString fullParameterDescriptionPath (QString type, QString param)
 
static QString fullSubgroupDescriptionPath (QString type, QString sub)
 
- Static Public Member Functions inherited from ParameterSettable
static void describe (QString type)
 
static QString fullParameterDescriptionPath (QString type, QString param)
 
static QString fullSubgroupDescriptionPath (QString type, QString sub)
 

Additional Inherited Members

- Public Types inherited from ParameterSettableInConstructor
enum  Property
 
- Public Types inherited from ConcurrentResourcesUser
typedef
Resource::ResourceChangeType 
ResourceChangeType
 
- 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 ConcurrentResourcesUser
T * getResource ()
 
ResourcesUseroperator= (const ResourcesUser &other)
 
 ResourcesUser ()
 
 ResourcesUser (const ResourcesUser &other)
 
- Static Protected Member Functions inherited from ParameterSettableInConstructor
static Descriptor addTypeDescription (QString type, QString shortHelp, QString longHelp=QString(""))
 
- Protected Attributes inherited from ConcurrentResourcesUser
ResourceCollectionHolder m_resources
 

Detailed Description

The class modelling an arena.

This class contains functions to create and manipulate an arena, which is used mostly in simulations with wheeled robots. The arena always has a plane at the given height, you can add more planes at different heights and you can connected different planes with ramps. Planes are perpendicular to the Z axis. The dimension of the main plane and its Z position can only be set via configuration parameters and are fixed.

Definition at line 45 of file arena.h.

Constructor & Destructor Documentation

Arena ( 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 79 of file arena.cpp.

References ConcurrentResourcesUser::usableResources().

~Arena ( )
virtual

Destructor.

Definition at line 91 of file arena.cpp.

Member Function Documentation

void addRobots ( QStringList  robots)

Adds robots to the list of 2D objects.

This function adds the given robots to the list of 2D objects so that they can be perceived by the sensors of other robots (like, e.g. the linear camera)

Parameters
robotsthe name of the resources with robots

Definition at line 116 of file arena.cpp.

Referenced by EvoRobotExperiment::recreateArena().

Cylinder2DWrapper * createBigCylinder ( QColor  color,
real  height = -1.0 
)

Creates a big cylinder.

The cylinder has a fixed radius. You can specify its color and height

Parameters
colorthe color of the cylinder
heightthe height of the wall. If negative the default height for objects is used
Returns
the new object

Definition at line 157 of file arena.cpp.

Cylinder2DWrapper * createCircularTargetArea ( real  radius,
QColor  color 
)

Creates a circular target area.

The target area is placed on the ground and is detectable by ground sensors

Parameters
radiusthe radius of the area
colorthe color of the area
Returns
the new object

Definition at line 162 of file arena.cpp.

References PhyCylinder::matrix(), Cylinder2DWrapper::phyObject(), PhyCylinder::setMaterial(), PhyCylinder::setMatrix(), and wMatrix::w_pos.

Box2DWrapper * createRectangularTargetArea ( real  width,
real  depth,
QColor  color 
)

Creates a rectangular target area.

The target area is placed on the ground and is detectable by ground sensors

Parameters
widththe width of the area
depththe depth of the area
colorthe color of the area
Returns
the new object

Definition at line 177 of file arena.cpp.

References PhyBox::matrix(), Box2DWrapper::phyObject(), PhyBox::setMaterial(), PhyBox::setMatrix(), and wMatrix::w_pos.

Cylinder2DWrapper * createSmallCylinder ( QColor  color,
real  height = -1.0 
)

Creates a small cylinder.

The cylinder has a fixed radius. You can specify its color and height

Parameters
colorthe color of the cylinder
heightthe height of the wall. If negative the default height for objects is used
Returns
the new object

Definition at line 152 of file arena.cpp.

Box2DWrapper * createWall ( QColor  color,
wVector  start,
wVector  end,
real  thickness,
real  height = -1.0 
)

Creates a wall.

The wall is created using a starting point and an ending point. The z component of the vectors for the starting point and the ending point are discarded. If you imagine the wall as a rectangle, the starting point and the ending point are in the middle of two opposite sides. The wall also have a thickness and an height

Parameters
colorthe color of the wall
startthe starting point of the wall. The Z coordinate of the vector is discarded
endthe ending point of the wall. The Z component is discarded
thicknessthe thickness of the wall
heightthe height of the wall. If negative the default height for objects is used
Returns
the new object

Definition at line 129 of file arena.cpp.

References PhyBox::matrix(), Box2DWrapper::phyObject(), wMatrix::roll(), PhyBox::setMatrix(), PhyObject2DWrapper::setTexture(), wMatrix::w_pos, and wVectorT< Shared >::z.

void describe ( QString  type)
static

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

Parameters
typethe name of the type regarding the description. The type is used when a subclass reuses 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 105 of file arena.cpp.

References ParameterSettableInConstructor::addTypeDescription(), ParameterSettable::RealDescriptor::def(), ParameterSettable::Descriptor::describeReal(), ParameterSettable::RealDescriptor::help(), ParameterSettableInConstructor::Infinity, and ParameterSettable::RealDescriptor::limits().

real getHeight ( ) const
inline

Returns the height of the main plane.

Returns
the height of the main plane

Definition at line 126 of file arena.h.

const QVector<PhyObject2DWrapper*>& getObjects ( ) const
inline

Returns the list of 2D objects.

Returns
the list of 2D objects

Definition at line 96 of file arena.h.

Referenced by LinearCamera::update().

Box2DWrapper * getPlane ( )

Returns the plane of the arena.

Returns
the plane of the arena

Definition at line 124 of file arena.cpp.

real getWidth ( ) const
inline

Returns the width of the main plane.

Returns
the width of the main plane

Definition at line 116 of file arena.h.

real getZ ( ) const
inline

Returns the z of the plane.

Returns
the z of the plane

Definition at line 106 of file arena.h.

void save ( ConfigurationParameters params,
QString  prefix 
)
virtual

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

This is not implemented yet

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

Implements ParameterSettableInConstructor.

Definition at line 99 of file arena.cpp.

References Logger::error().


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