SensorController Class Referenceabstract

The base abstract class for sensor controllers. More...

Inheritance diagram for SensorController:

Public Member Functions

 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...
 
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...
 

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
worldThe world in which we live

Definition at line 31 of file sensorcontrollers.cpp.

~SensorController ( )
virtual

Destructor.

Definition at line 38 of file sensorcontrollers.cpp.

Member Function Documentation

bool isEnabled ( )
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().

void setEnabled ( bool  b)
inline

Enables/Disables this sensor controller.

A disabled sensor should not be updated

Parameters
btrue to enable the controller, false to disable it

Definition at line 83 of file sensorcontrollers.h.

virtual void update ( )
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.

World* world ( )
inline

Returns the world.

Returns
the world

Definition at line 93 of file sensorcontrollers.h.


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