sensorcontrollers.cpp
104 SingleIRGraphic(WObject *object, const wMatrix& offset, const QVector<wVector>& startingRayPoints, const QVector<wVector>& endingRayPoints, bool drawRay, bool drawRealRay, QString name = "unamed") :
316 SingleIR::SingleIR(WObject* obj, wMatrix mtr, double minDist, double maxDist, double aperture, unsigned int numRays) :
429 void SingleIR::set(WObject* obj, wMatrix mtr, double minDist, double maxDist, double aperture, unsigned int numRays)
472 const double angularIncrement = (m_numRays == 1) ? 0.0 : (toRad(m_aperture) / double(m_numRays - 1));
498 m_sensorGraphics = new SingleIRGraphic(m_object, m_transformation, m_startingRayPoints, m_endingRayPoints, m_drawRay, m_drawRealRay);
502 SimulatedIRProximitySensorController::SimulatedIRProximitySensorController(World* world, const QVector<SingleIR>& sensors) :
542 void SimulatedIRProximitySensorController::setGraphicalProperties(bool drawSensor, bool drawRay, bool drawRealRay)
553 SimulatedIRGroundSensorController::SimulatedIRGroundSensorController(World* world, const QVector<SingleIR>& sensors) :
599 void SimulatedIRGroundSensorController::setGraphicalProperties(bool drawSensor, bool drawRay, bool drawRealRay)
FARSA_UTIL_TEMPLATE real toRad(real x)
virtual void setSensorActive(int i, bool active)
Sets whether the i-th sensor is active or not.
Definition: sensorcontrollers.cpp:530
The graphical representation of the single IR sensor.
Definition: sensorcontrollers.cpp:74
rayCastHitVector worldRayCast(wVector start, wVector end, bool onlyClosest, const QSet< PhyObject * > &ignoredObjs=QSet< PhyObject * >())
Returns the bodyes which intersect the ray from start to end.
Definition: world.cpp:623
void setUseColorTextureOfOwner(bool b)
set if the object will be rendered with the color and texture of our owner (if we have one) ...
Definition: wobject.cpp:97
const bool m_drawRay
If true a red segments giving the direction of the sensor rays are drawn.
Definition: sensorcontrollers.cpp:282
void setGraphicalProperties(bool drawSensor, bool drawRay=false, bool drawRealRay=false)
Sets graphical properties, i.e. whether sensors are drawn and how.
Definition: sensorcontrollers.cpp:452
real distance
The distance from start at which the ray intersects the object.
Definition: world.h:202
virtual void setSensorActive(int i, bool active)
Sets whether the i-th sensor is active or not.
Definition: sensorcontrollers.cpp:587
void attachToObject(WObject *object, bool makeOwner=false, const wMatrix &displacement=wMatrix::identity())
Attaches this object to another WObject.
Definition: graphicalwobject.cpp:43
void setTexture(QString textureName)
Set the texture to use for this WObject when rendered.
Definition: wobject.cpp:73
void set(WObject *obj, wMatrix mtr, double minDist, double maxDist, double aperture, unsigned int numRays)
Configures the sensor.
Definition: sensorcontrollers.cpp:429
virtual void setSensorActive(int i, bool active)
Sets whether the i-th sensor is active or not.
Definition: sensorcontrollers.cpp:55
QVector< bool > m_activeSensor
The vector storing whether the i-th sensor should be active or not.
Definition: sensorcontrollers.h:202
IRSensorController(World *world, unsigned int numSensors)
Constructor.
Definition: sensorcontrollers.cpp:43
WObject *const m_object
The object to which this graphicalc representation is attached.
Definition: sensorcontrollers.cpp:254
const QVector< wVector > m_endingRayPoints
The vector with ending points of the rays.
Definition: sensorcontrollers.cpp:276
const wMatrix & matrix() const
return a reference to the transformation matrix
Definition: wobject.cpp:47
The base abstract class for sensor controllers.
Definition: sensorcontrollers.h:43
SimulatedIRProximitySensorController(World *world, const QVector< SingleIR > &sensors)
Constructor.
Definition: sensorcontrollers.cpp:502
wVectorT & rotateAround(wVectorT< false > axis, real theta)
rotate the position indicated by this wVectorT around the axis by the angle theta ...
Definition: wvector.h:434
An helper class to draw stuffs in the world.
Definition: graphicalwobject.h:48
The base abstract class of sensor controllers for infrared sensors.
Definition: sensorcontrollers.h:132
const QVector< wVector > m_startingRayPoints
The vector with starting points of the rays.
Definition: sensorcontrollers.cpp:268
wVector traction() const
Returns the force applied on the joint.
Definition: sensorcontrollers.cpp:625
SingleIRGraphic(WObject *object, const wMatrix &offset, const QVector< wVector > &startingRayPoints, const QVector< wVector > &endingRayPoints, bool drawRay, bool drawRealRay, QString name="unamed")
Constructor.
Definition: sensorcontrollers.cpp:104
wVectorT< false > scale(real s) const
return a new wVectorT with element scaled by s
Definition: wvector.h:305
virtual wVector getForceOnJoint() const =0
Returns the force applied to this joint.
RenderWObjectContainer * container()
return the Container on which this object is, or the OpenGL windows where it is displayed ...
Definition: renderworld.h:100
const bool m_drawRealRay
Whether to draw the actual ray lengths or not.
Definition: sensorcontrollers.cpp:291
void setGraphicalProperties(bool drawSensor, bool drawRay=false, bool drawRealRay=false)
Sets graphical properties of all sensors.
Definition: sensorcontrollers.cpp:599
SimulatedIRGroundSensorController(World *world, const QVector< SingleIR > &sensors)
Constructor.
Definition: sensorcontrollers.cpp:553
virtual void render(RenderWObject *renderer, QGLContext *gw)
Performs the actual drawing.
Definition: sensorcontrollers.cpp:141
wVector transformVector(const wVector &v) const
apply both rotation and translation to the vector v
Definition: wmatrix.h:364
QVector< double > m_activations
The vector with sensors activations.
Definition: sensorcontrollers.h:193
const wMatrix m_offset
The displacement matrix relative to the object to which we are attached.
Definition: sensorcontrollers.cpp:260
void setupColorTexture(QGLContext *, RenderWObject *obj)
Setup the Color and Texture into the OpenGL Context for RenderWObject passed.
Definition: renderworld.cpp:268
TractionSensorController(World *world, const PhyJoint &j)
Constructor.
Definition: sensorcontrollers.cpp:610
void setGraphicalProperties(bool drawSensor, bool drawRay=false, bool drawRealRay=false)
Sets graphical properties of all sensors.
Definition: sensorcontrollers.cpp:542