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

Add JointControllerTemplate (it is templated on the control target and implements getControlTarget)

parent 05894913
No related branches found
No related tags found
No related merge requests found
......@@ -75,6 +75,18 @@ namespace armarx
void rtActivate();
void rtDeactivate();
};
template<class ControlTargetType>
class JointControllerTemplate : public virtual JointController
{
static_assert(std::is_base_of<ControlTargetBase, ControlTargetType>::value, "ControlTargetType has to inherit SensorValueBase");
public:
using JointController::JointController;
virtual ControlTargetType* getControlTarget() final;
ControlTargetType controlTarget;
};
}
//inline functions
......@@ -152,5 +164,11 @@ namespace armarx
rtPostDeactivateController();
rtResetTarget();
}
template<class ControlTargetType>
inline ControlTargetType* JointControllerTemplate<ControlTargetType>::getControlTarget()
{
return &controlTarget;
}
}
#endif
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