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 T * getSensorValue () const
 
virtual const SensorValueBase * getSensorValue () const =0
 
std::string getSensorValueType (bool withoutNamespaceSpecifier=false) const
 Returns the SensorValue's type as a string.
 
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.
 
 SensorDevice (const std::string &name)
 Create a SensorDevice with the given name.
 
- Public Member Functions inherited from DeviceBase
 DeviceBase (const std::string &name)
 Create a Device with the given name.
 
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.
 

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
 

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

Constructor & Destructor Documentation

◆ SensorDevice()

SensorDevice ( const std::string & name)
inline

Create a SensorDevice with the given name.

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 ForceTorqueSimulationSensorDevice, GlobalRobotPoseCorrectionSensorDevice, GlobalRobotPoseSensorDevice, and GlobalRobotPoseSimulationSensorDevice.

◆ getSensorValue() [1/2]

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

◆ 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

◆ 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, GlobalRobotPoseCorrectionSensorDevice, and GlobalRobotPoseSensorDevice.

Friends And Related Symbol Documentation

◆ RobotUnitModule::Devices

friend class RobotUnitModule::Devices
friend

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.


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