A collection of SingleIR. More...
Public Member Functions | |
SimulatedIRProximitySensorController (World *world, const QVector< SingleIR > &sensors) | |
Constructor. | |
~SimulatedIRProximitySensorController () | |
Destructor. | |
void | setGraphicalProperties (bool drawSensor, bool drawRay=false, bool drawRealRay=false) |
Sets graphical properties of all sensors. | |
virtual void | setSensorActive (int i, bool active) |
Sets whether the i-th sensor is active or not. | |
virtual void | update () |
Updates sensor reading. | |
Public Member Functions inherited from IRSensorController | |
IRSensorController (World *world, unsigned int numSensors) | |
Constructor. | |
virtual | ~IRSensorController () |
Destructor. | |
double | activation (int i) const |
Returns the activation of the i-th sensors. | |
int | nSensors () const |
Returns the number of sensors. | |
bool | sensorIsActive (int i) const |
Returns whether the i-th sensor is active or not. | |
Public Member Functions inherited from SensorController | |
SensorController (World *world) | |
Constructor. | |
virtual | ~SensorController () |
Destructor. | |
bool | isEnabled () |
Returns true if the sensor is enabled. | |
void | setEnabled (bool b) |
Enables/Disables this sensor controller. | |
World * | world () |
Returns the world. | |
Public Member Functions inherited from Ownable | |
Ownable () | |
Constructor. | |
virtual | ~Ownable () |
Destructor. | |
const QList< Owned > & | owned () const |
Returns the list of objects owned by this one. | |
Ownable * | owner () const |
Returns the owner of this object. | |
void | setOwner (Ownable *owner, bool destroy=true) |
Sets the owner of this object. | |
Additional Inherited Members | |
Public Types inherited from Ownable | |
typedef QList< Owned > | OwnedList |
The type for the list of owned objects. | |
Protected Attributes inherited from IRSensorController | |
QVector< double > | m_activations |
The vector with sensors activations. | |
QVector< bool > | m_activeSensor |
The vector storing whether the i-th sensor should be active or not. | |
Detailed Description
A collection of SingleIR.
This class implements IRSensorController by using a collection of SingleIR. This takes the list of SingleIR in the constructor and uses them to obtain activations.
Definition at line 492 of file sensorcontrollers.h.
Constructor & Destructor Documentation
SimulatedIRProximitySensorController | ( | World * | world, |
const QVector< SingleIR > & | sensors | ||
) |
Constructor.
- Parameters
-
world the world in which we live sensors the list of single proximity IR sensors
Definition at line 502 of file sensorcontrollers.cpp.
References SimulatedIRProximitySensorController::setGraphicalProperties().
Destructor.
Definition at line 512 of file sensorcontrollers.cpp.
Member Function Documentation
void setGraphicalProperties | ( | bool | drawSensor, |
bool | drawRay = false , |
||
bool | drawRealRay = false |
||
) |
Sets graphical properties of all sensors.
By default the sensor is not drawn
- Parameters
-
drawSensor if true the sensor is drawn drawRay if true sensor rays are drawn drawRealRay if true the actual ray range is drawn, otherwise only the direction of the rays is given
Definition at line 542 of file sensorcontrollers.cpp.
References IRSensorController::m_activeSensor.
Referenced by PhyMarXbot::setProximityIRSensorsGraphicalProperties(), PhyKhepera::setProximityIRSensorsGraphicalProperties(), PhyEpuck::setProximityIRSensorsGraphicalProperties(), and SimulatedIRProximitySensorController::SimulatedIRProximitySensorController().
|
virtual |
Sets whether the i-th sensor is active or not.
This automatically disables graphics for sensors that are not active
- Parameters
-
i the index of the sensor active if true the sensor is active
Reimplemented from IRSensorController.
Definition at line 530 of file sensorcontrollers.cpp.
References IRSensorController::setSensorActive().
|
virtual |
Updates sensor reading.
Implements SensorController.
Definition at line 517 of file sensorcontrollers.cpp.
References IRSensorController::m_activations, and IRSensorController::m_activeSensor.
Referenced by PhyMarXbot::postUpdate(), PhyKhepera::postUpdate(), and PhyEpuck::postUpdate().
The documentation for this class was generated from the following files:
- worldsim/include/sensorcontrollers.h
- worldsim/src/sensorcontrollers.cpp