Represents an IR distance sensor.
More...
#include <DistanceSensorArray.h>
|
class | DistanceSensorArrayImpl |
|
Represents an IR distance sensor.
void rec::robotino::api2::DistanceSensorArray::distances |
( |
float * |
readings | ) |
const |
Returns the current distances of the distance sensors.
Example:
for( int i=0; i<vec.size(); ++i )
{
std::cout << "Distance[" << i << "]: " << vec[i] << " m" << std::endl;
}
- Parameters
-
[out] | readings | Pass an array of size numDistanceSensors() to store distance readings of all distance sensors in m |
virtual void rec::robotino::api2::DistanceSensorArray::distancesChangedEvent |
( |
const float * |
distances, |
|
|
unsigned int |
size |
|
) |
| |
|
virtual |
Called when distance changed
- Parameters
-
distances | Array of current distance in meters of all distance sensors. |
size | Size of distances array. |
- Exceptions
-
- See also
- Com::processEvents
void rec::robotino::api2::DistanceSensorArray::headings |
( |
float * |
readings | ) |
const |
Returns the headings of the distance sensors.
Example:
for( int i=0; i<vec.size(); ++i )
{
std::cout << "Heading[" << i << "]: " << vec[i] << " rad" << std::endl;
}
- Parameters
-
[out] | readings | Pass an array of size numDistanceSensors() to store headings of all distance sensors in rad. [0; 2*PI] |
- Exceptions
-
- See also
- setSensorNumber, ComObject::setComId
static unsigned int rec::robotino::api2::DistanceSensorArray::numDistanceSensors |
( |
| ) |
|
|
static |
- Returns
- Returns the number of distance sensors.
void rec::robotino::api2::DistanceSensorArray::processEvents |
( |
| ) |
|
Call this function from your main thread to get the virtual DistanceSensorArray functions called. The virtual functions are called directly by a call of this function
- Exceptions
-
- See also
- Com::processEvents
void rec::robotino::api2::DistanceSensorArray::setComId |
( |
const ComId & |
id | ) |
|
Sets the associated communication object.
- Parameters
-
id | The id of the associated communication object. |
- Exceptions
-
void rec::robotino::api2::DistanceSensorArray::voltages |
( |
float * |
readings | ) |
const |
Returns the current voltages of the distance sensors.
Example:
for( int i=0; i<vec.size(); ++i )
{
std::cout << "Voltage[" << i << "]: " << vec[i] << " V" << std::endl;
}
- Parameters
-
[out] | readings | Pass an array of size numDistanceSensors() to store current voltage readings of all distance sensors |
- Exceptions
-
- See also
- setSensorNumber, ComObject::setComId
virtual void rec::robotino::api2::DistanceSensorArray::voltagesChangedEvent |
( |
const float * |
voltages, |
|
|
unsigned int |
size |
|
) |
| |
|
virtual |
Called when voltage changed
- Parameters
-
voltages | Array of current voltage in Volts of all distance sensors. |
size | Size of voltages array. |
- Exceptions
-
- See also
- Com::processEvents
The documentation for this class was generated from the following file: