The base abstract class for sensor controllers. More...
Public Member Functions | |
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. | |
virtual void | update ()=0 |
Updates the sensor reading. | |
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. | |
Detailed Description
The base abstract class for sensor controllers.
- Motivation
- Common interface among sensor controllers hierachy
- Description
- Warnings
- The world hasn't a list of sensors, so they must be destroyed by the owner or by the creator
Definition at line 43 of file sensorcontrollers.h.
Constructor & Destructor Documentation
SensorController | ( | World * | world | ) |
Constructor.
- Parameters
-
world The world in which we live
Definition at line 31 of file sensorcontrollers.cpp.
|
virtual |
Destructor.
Definition at line 38 of file sensorcontrollers.cpp.
Member Function Documentation
|
inline |
Returns true if the sensor is enabled.
A disabled sensor should not be updated
- Returns
- true if the sensor is enabled
Definition at line 72 of file sensorcontrollers.h.
Referenced by PhyMarXbot::postUpdate(), PhyKhepera::postUpdate(), and PhyEpuck::postUpdate().
|
inline |
Enables/Disables this sensor controller.
A disabled sensor should not be updated
- Parameters
-
b true to enable the controller, false to disable it
Definition at line 83 of file sensorcontrollers.h.
|
pure virtual |
Updates the sensor reading.
This is a pure virtual method implemented by actual sensor controllers that apply the logic of controller
Implemented in TractionSensorController, SimulatedIRGroundSensorController, and SimulatedIRProximitySensorController.
|
inline |
The documentation for this class was generated from the following files:
- worldsim/include/sensorcontrollers.h
- worldsim/src/sensorcontrollers.cpp