SimulatedIRGroundSensorController Class Reference

A collection of SingleIR modelling ground sensors. More...

Inheritance diagram for SimulatedIRGroundSensorController:

Public Member Functions

 SimulatedIRGroundSensorController (World *world, const QVector< SingleIR > &sensors)
 Constructor. More...
 
 ~SimulatedIRGroundSensorController ()
 Destructor. More...
 
const QVector< SingleIR > & sensors () const
 Returns a const reference to the list of SingleIR sensors. More...
 
void setGraphicalProperties (bool drawSensor, bool drawRay=false, bool drawRealRay=false)
 Sets graphical properties of all sensors. More...
 
virtual void setSensorActive (int i, bool active)
 Sets whether the i-th sensor is active or not. More...
 
virtual void update ()
 Updates sensor reading. More...
 
- Public Member Functions inherited from IRSensorController
 IRSensorController (World *world, unsigned int numSensors)
 Constructor. More...
 
virtual ~IRSensorController ()
 Destructor. More...
 
double activation (int i) const
 Returns the activation of the i-th sensors. More...
 
int nSensors () const
 Returns the number of sensors. More...
 
bool sensorIsActive (int i) const
 Returns whether the i-th sensor is active or not. More...
 
- Public Member Functions inherited from SensorController
 SensorController (World *world)
 Constructor. More...
 
virtual ~SensorController ()
 Destructor. More...
 
bool isEnabled ()
 Returns true if the sensor is enabled. More...
 
void setEnabled (bool b)
 Enables/Disables this sensor controller. More...
 
Worldworld ()
 Returns the world. More...
 
- Public Member Functions inherited from Ownable
 Ownable ()
 Constructor. More...
 
virtual ~Ownable ()
 Destructor. More...
 
const QList< Owned > & owned () const
 Returns the list of objects owned by this one. More...
 
Ownableowner () const
 Returns the owner of this object. More...
 
void setOwner (Ownable *owner, bool destroy=true)
 Sets the owner of this object. More...
 

Additional Inherited Members

- Public Types inherited from Ownable
typedef QList< OwnedOwnedList
 The type for the list of owned objects. More...
 
- Protected Attributes inherited from IRSensorController
QVector< double > m_activations
 The vector with sensors activations. More...
 
QVector< bool > m_activeSensor
 The vector storing whether the i-th sensor should be active or not. More...
 

Detailed Description

A collection of SingleIR modelling ground sensors.

This class implements IRSensorController by using a collection of SingleIR. This models ground sensors by assuming IR sensors are at a fixed distance from the ground and returning activation depending on the luminance component of the color of the object below the sensor. The SingleIR should have a single ray (zero aperture).

Definition at line 587 of file sensorcontrollers.h.

Constructor & Destructor Documentation

SimulatedIRGroundSensorController ( World world,
const QVector< SingleIR > &  sensors 
)

Constructor.

Parameters
worldthe world in which we live
sensorsthe list of single proximity IR sensors

Definition at line 553 of file sensorcontrollers.cpp.

References SimulatedIRGroundSensorController::setGraphicalProperties().

Destructor.

Definition at line 563 of file sensorcontrollers.cpp.

Member Function Documentation

const QVector<SingleIR>& sensors ( ) const
inline

Returns a const reference to the list of SingleIR sensors.

Returns
a const reference to the list of SingleIR sensors

Definition at line 633 of file sensorcontrollers.h.

void setGraphicalProperties ( bool  drawSensor,
bool  drawRay = false,
bool  drawRealRay = false 
)

Sets graphical properties of all sensors.

By default the sensor is not drawn

Parameters
drawSensorif true the sensor is drawn
drawRayif true sensor rays are drawn
drawRealRayif true the actual ray range is drawn, otherwise only the direction of the rays is given

Definition at line 599 of file sensorcontrollers.cpp.

References IRSensorController::m_activeSensor.

Referenced by PhyMarXbot::setGroundAroundIRSensorsGraphicalProperties(), PhyMarXbot::setGroundBottomIRSensorsGraphicalProperties(), PhyEpuck::setGroundIRSensorsGraphicalProperties(), and SimulatedIRGroundSensorController::SimulatedIRGroundSensorController().

void setSensorActive ( int  i,
bool  active 
)
virtual

Sets whether the i-th sensor is active or not.

This automatically disables graphics for sensors that are not active

Parameters
ithe index of the sensor
activeif true the sensor is active

Reimplemented from IRSensorController.

Definition at line 587 of file sensorcontrollers.cpp.

References IRSensorController::setSensorActive().

void update ( )
virtual

Updates sensor reading.

Implements SensorController.

Definition at line 568 of file sensorcontrollers.cpp.

References IRSensorController::m_activations, and IRSensorController::m_activeSensor.

Referenced by PhyMarXbot::postUpdate(), and PhyEpuck::postUpdate().


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