Represents an IR distance sensor.
More...
#include <DistanceSensor.h>
Represents an IR distance sensor.
float rec::robotino::api2::DistanceSensor::distance |
( |
| ) |
const |
- Returns
- The measured distance in meters
virtual void rec::robotino::api2::DistanceSensor::distanceChangedEvent |
( |
float |
distance | ) |
|
|
virtual |
Called when distance changed
- Parameters
-
distance | The current distance in meters |
- Exceptions
-
- See also
- Com::processEvents
float rec::robotino::api2::DistanceSensor::heading |
( |
| ) |
const |
Returns the heading of this distance sensor.
- Returns
- The heading in rad. [0; 2*PI]
- Exceptions
-
- See also
- setSensorNumber, ComObject::setComId
static unsigned int rec::robotino::api2::DistanceSensor::numDistanceSensors |
( |
| ) |
|
|
static |
- Returns
- Returns the number of distance sensors.
void rec::robotino::api2::DistanceSensor::processEvents |
( |
| ) |
|
Call this function from your main thread to get the virtual DistanceSensor functions called. The virtual functions are called directly by a call of this function
- Exceptions
-
- See also
- Com::processEvents
void rec::robotino::api2::DistanceSensor::setComId |
( |
const ComId & |
id | ) |
|
Sets the associated communication object.
- Parameters
-
id | The id of the associated communication object. |
- Exceptions
-
void rec::robotino::api2::DistanceSensor::setSensorNumber |
( |
unsigned int |
n | ) |
|
Sets the number of this distance sensor.
- Parameters
-
n | The input number. Range [0; Robotstate::numDistanceSensors-1] |
- Exceptions
-
float rec::robotino::api2::DistanceSensor::voltage |
( |
| ) |
const |
Returns the current voltage of this distance sensor.
- Returns
- The current voltage of this sensor.
- Exceptions
-
- See also
- setSensorNumber, ComObject::setComId
virtual void rec::robotino::api2::DistanceSensor::voltageChangedEvent |
( |
float |
voltage | ) |
|
|
virtual |
Called when voltage changed
- Parameters
-
voltage | The current voltage in Volts. |
- Exceptions
-
- See also
- Com::processEvents
The documentation for this class was generated from the following file: