SensorDevice Class Referenceabstract

This class represents some part of the robot providing sensor values. More...

#include <RobotAPI/components/units/RobotUnit/Devices/SensorDevice.h>

+ Inheritance diagram for SensorDevice:

Public Member Functions

virtual std::string getReportingFrame () const
 
template<class T >
const TgetSensorValue () const
 
virtual const SensorValueBasegetSensorValue () const =0
 
std::string getSensorValueType (bool withoutNamespaceSpecifier=false) const
 Returns the SensorValue's type as a string. More...
 
virtual void rtReadSensorValues (const IceUtil::Time &sensorValuesTimestamp, const IceUtil::Time &timeSinceLastIteration)
 This is a hook for implementations to read the sensor value from a bus. More...
 
 SensorDevice (const std::string &name)
 Create a SensorDevice with the given name. More...
 
- Public Member Functions inherited from DeviceBase
 DeviceBase (const std::string &name)
 Create a Device with the given name. More...
 
const std::string & getDeviceName () const
 
const std::set< std::string > & getTags () const
 
virtual bool hasError ()
 
bool hasTag (const std::string &tag) const
 
const char * rtGetDeviceName () const
 
virtual ~DeviceBase ()=default
 

Static Public Attributes

static const SensorDevicePtr NullPtr {nullptr}
 A static const nullptr in case a const ref to a nullptr needs to be returned. More...
 

Friends

class RobotUnitModule::Devices
 

Additional Inherited Members

- Protected Member Functions inherited from DeviceBase
void addDeviceTag (const std::string &tag)
 adds the given tag to the Device More...
 

Detailed Description

This class represents some part of the robot providing sensor values.

The SensorValue is accessed via getSensorValue.

A SensorDevice could also represent a virtual sensor reporting some status of the software (e.g. Timings): Examples for Sensorvalues are:

  • Position, Velocity, Torque, Current, Temperature of an actuator
  • Forces and Torques of an Force-Torque-Sensor
  • Timings of the ControlThread
  • Level of a battery power supply
  • 3d Velocity of a mobile Platform

Definition at line 59 of file SensorDevice.h.

Constructor & Destructor Documentation

◆ SensorDevice()

SensorDevice ( const std::string &  name)
inline

Create a SensorDevice with the given name.

Definition at line 66 of file SensorDevice.h.

Member Function Documentation

◆ getReportingFrame()

std::string getReportingFrame ( ) const
inlinevirtual
Returns
The reporting frame name of this sensor (e.g. The frame some force torque values are in). This may be empty for virtual sensors e.g. execution time sensors.

Reimplemented in GlobalRobotPoseSensorDevice, GlobalRobotPoseCorrectionSensorDevice, GlobalRobotPoseSimulationSensorDevice, and ForceTorqueSimulationSensorDevice.

Definition at line 137 of file SensorDevice.h.

◆ getSensorValue() [1/2]

const T* getSensorValue ( ) const
inline
Returns
The SensorDevice's sensor value casted to the given type (may be nullptr)

Definition at line 76 of file SensorDevice.h.

◆ getSensorValue() [2/2]

◆ getSensorValueType()

std::string getSensorValueType ( bool  withoutNamespaceSpecifier = false) const
inline

Returns the SensorValue's type as a string.

Parameters
withoutNamespaceSpecifierWhether namespace specifiers should be removed from the name.
Returns
The SensorValues type as a string.
See also
getSensorValue

Definition at line 131 of file SensorDevice.h.

◆ rtReadSensorValues()

virtual void rtReadSensorValues ( const IceUtil::Time &  sensorValuesTimestamp,
const IceUtil::Time &  timeSinceLastIteration 
)
inlinevirtual

This is a hook for implementations to read the sensor value from a bus.

Parameters
sensorValuesTimestampThe current timestamp
timeSinceLastIterationThe time delta since the last call

Reimplemented in GlobalRobotLocalizationSensorDevice, GlobalRobotPoseSensorDevice, and GlobalRobotPoseCorrectionSensorDevice.

Definition at line 99 of file SensorDevice.h.

Friends And Related Function Documentation

◆ RobotUnitModule::Devices

friend class RobotUnitModule::Devices
friend

Definition at line 105 of file SensorDevice.h.

Member Data Documentation

◆ NullPtr

const SensorDevicePtr NullPtr {nullptr}
static

A static const nullptr in case a const ref to a nullptr needs to be returned.

Definition at line 63 of file SensorDevice.h.


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