Skip to content
Snippets Groups Projects
Commit 7b01f6b6 authored by Raphael Grimm's avatar Raphael Grimm
Browse files

Add a templated version of SensorDevice::getSensorValue /...

Add a templated version of SensorDevice::getSensorValue / JointController::getControlTarget casting the result to the given type
parent e68669b3
No related branches found
No related tags found
No related merge requests found
......@@ -65,6 +65,13 @@ namespace armarx
/// @return The SensorDevice's sensor value
virtual const SensorValueBase* getSensorValue() const = 0;
/// @return The SensorDevice's sensor value casted to the given type (may be nullptr)
template<class T>
const T* getSensorValue() const
{
return getSensorValue()->asA<const T*>();
}
/**
* @brief Returns the \ref SensorValueBase "SensorValue's" type as a string.
* @param withoutNamespaceSpecifier Whether namespace specifiers should be removed from the name.
......
......@@ -46,6 +46,13 @@ namespace armarx
virtual const ControlTargetBase* getControlTarget() const;
/// @return The \ref JointController's \ref ControlTargetBase "ControlTarget" casted to the given type (may be nullptr)
template<class T>
const T* getControlTarget() const
{
return getControlTarget()->asA<const T*>();
}
virtual void rtResetTarget();
virtual bool rtIsTargetVaild() const;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment