The class modelling an arena. More...

Public Member Functions | |
Arena (ConfigurationParameters ¶ms, QString prefix) | |
Constructor. | |
virtual | ~Arena () |
Destructor. | |
void | addRobots (QStringList robots) |
Adds robots to the list of 2D objects. | |
Cylinder2DWrapper * | createBigCylinder (QColor color, real height=-1.0) |
Creates a big cylinder. | |
Cylinder2DWrapper * | createCircularTargetArea (real radius, QColor color) |
Creates a circular target area. | |
Box2DWrapper * | createRectangularTargetArea (real width, real depth, QColor color) |
Creates a rectangular target area. | |
Cylinder2DWrapper * | createSmallCylinder (QColor color, real height=-1.0) |
Creates a small cylinder. | |
Box2DWrapper * | createWall (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. | |
Box2DWrapper * | getPlane () |
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 ¶ms, QString prefix) |
Saves the actual status of parameters into the ConfigurationParameters object passed. | |
![]() | |
ParameterSettableInConstructor (ConfigurationParameters &, QString) | |
void | addObserver (RuntimeParameterObserver *obs) |
T | getRuntimeParameter (QString paramName) |
virtual ParameterSettableUI * | getUIManager () |
ParameterSettable () | |
virtual void | postConfigureInitialization () |
void | removeObserver (RuntimeParameterObserver *obs) |
void | setRuntimeParameter (QString paramName, T newvalue) |
QString | typeName () const |
![]() | |
void | addObserver (RuntimeParameterObserver *obs) |
T | getRuntimeParameter (QString paramName) |
void | removeObserver (RuntimeParameterObserver *obs) |
void | setRuntimeParameter (QString paramName, T newvalue) |
QString | typeName () const |
![]() | |
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 void | describe (QString type) |
static QString | fullParameterDescriptionPath (QString type, QString param) |
static QString | fullSubgroupDescriptionPath (QString type, QString sub) |
![]() | |
static void | describe (QString type) |
static QString | fullParameterDescriptionPath (QString type, QString param) |
static QString | fullSubgroupDescriptionPath (QString type, QString sub) |
Additional Inherited Members | |
![]() | |
enum | Property |
![]() | |
typedef Resource::ResourceChangeType | ResourceChangeType |
![]() | |
AllowMultiple | |
Default | |
IsList | |
IsMandatory | |
![]() | |
static const double | Infinity |
static const int | MaxInteger |
static const int | MinInteger |
![]() | |
T * | getResource () |
ResourcesUser & | operator= (const ResourcesUser &other) |
ResourcesUser () | |
ResourcesUser (const ResourcesUser &other) | |
![]() | |
static Descriptor | addTypeDescription (QString type, QString shortHelp, QString longHelp=QString("")) |
![]() | |
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.
Constructor & Destructor Documentation
Arena | ( | ConfigurationParameters & | params, |
QString | prefix | ||
) |
Constructor.
- Parameters
-
params the configuration parameters object with parameters to use prefix the 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().
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
-
robots the 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 |
||
) |
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
-
radius the radius of the area color the 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
-
width the width of the area depth the depth of the area color the 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 |
||
) |
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
-
color the color of the wall start the starting point of the wall. The Z coordinate of the vector is discarded end the ending point of the wall. The Z component is discarded thickness the thickness of the wall height the 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.
|
static |
Adds to Factory::typeDescriptions() the descriptions of all parameters and subgroups.
- Parameters
-
type the 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().
|
inline |
|
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 | ( | ) |
|
inline |
|
inline |
|
virtual |
Saves the actual status of parameters into the ConfigurationParameters object passed.
This is not implemented yet
- Parameters
-
params the configuration parameters object on which save actual parameters prefix the 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: