SensorController Class Referenceabstract

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

Inheritance diagram for SensorController:

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.
 
Worldworld ()
 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.
 
Ownableowner () 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< OwnedOwnedList
 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
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: