The base abstract class of sensor controllers for infrared sensors. More...
Public Member Functions | |
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... | |
virtual void | setSensorActive (int i, bool active) |
Sets 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... | |
virtual void | update ()=0 |
Updates the sensor reading. More... | |
World * | world () |
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... | |
Ownable * | owner () const |
Returns the owner of this object. More... | |
void | setOwner (Ownable *owner, bool destroy=true) |
Sets the owner of this object. More... | |
Protected Attributes | |
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... | |
Additional Inherited Members | |
Public Types inherited from Ownable | |
typedef QList< Owned > | OwnedList |
The type for the list of owned objects. More... | |
Detailed Description
The base abstract class of sensor controllers for infrared sensors.
This is an abstract base class providing an uniform interface for different implementations, use one of its subclasses below. This class only provides a vector of activations (m_activations) which must be filled in the update() function by subclasses
Definition at line 132 of file sensorcontrollers.h.
Constructor & Destructor Documentation
IRSensorController | ( | World * | world, |
unsigned int | numSensors | ||
) |
Constructor.
- Parameters
-
world the world in which we live numSensors the number of proximity IR sensors
Definition at line 43 of file sensorcontrollers.cpp.
|
virtual |
Destructor.
Definition at line 50 of file sensorcontrollers.cpp.
Member Function Documentation
|
inline |
Returns the activation of the i-th sensors.
- Parameters
-
i the index of the sensor whose activation value should be returned
- Returns
- the activation of the i-th sensor
Definition at line 163 of file sensorcontrollers.h.
|
inline |
Returns the number of sensors.
Definition at line 151 of file sensorcontrollers.h.
|
inline |
Returns whether the i-th sensor is active or not.
- Parameters
-
i the index of the sensor
- Returns
- true if the sensor is active, false if it is not
Definition at line 174 of file sensorcontrollers.h.
|
virtual |
Sets whether the i-th sensor is active or not.
This is virtual to allow subclasses to take actions depending on whether the sensor is active or not
- Parameters
-
i the index of the sensor active if true the sensor is active
Reimplemented in SimulatedIRGroundSensorController, and SimulatedIRProximitySensorController.
Definition at line 55 of file sensorcontrollers.cpp.
References IRSensorController::m_activeSensor.
Referenced by SimulatedIRProximitySensorController::setSensorActive(), and SimulatedIRGroundSensorController::setSensorActive().
Member Data Documentation
|
protected |
The vector with sensors activations.
Definition at line 193 of file sensorcontrollers.h.
Referenced by SimulatedIRProximitySensorController::update(), and SimulatedIRGroundSensorController::update().
|
protected |
The vector storing whether the i-th sensor should be active or not.
If m_activeSensor[i] is false the i-th sensor should not be updated by subclasses
Definition at line 202 of file sensorcontrollers.h.
Referenced by SimulatedIRProximitySensorController::setGraphicalProperties(), SimulatedIRGroundSensorController::setGraphicalProperties(), IRSensorController::setSensorActive(), SimulatedIRProximitySensorController::update(), and SimulatedIRGroundSensorController::update().
The documentation for this class was generated from the following files:
- worldsim/include/sensorcontrollers.h
- worldsim/src/sensorcontrollers.cpp