Skip to content
Snippets Groups Projects
Commit 6b773254 authored by Raphael's avatar Raphael
Browse files

now using pure virtual functions in target base (instead of ducktyping)

parent e3999580
No related branches found
No related tags found
No related merge requests found
......@@ -50,7 +50,7 @@ namespace armarx
TargetType* getTarget()
{
return target;
return & target;
}
void resetTarget()
......
......@@ -46,11 +46,11 @@ namespace armarx
{
return ePositionControl;
}
virtual void reset()
virtual void reset() override
{
position = ControllerConstatns::ValueNotSetNaN;
}
bool isValid() const
virtual bool isValid() const override
{
return std::isfinite(position);
}
......
......@@ -47,12 +47,12 @@ namespace armarx
{
return ePositionVelocityControl;
}
virtual void reset()
virtual void reset() override
{
position = ControllerConstatns::ValueNotSetNaN;
velocity = ControllerConstatns::ValueNotSetNaN;
}
bool isValid() const
virtual bool isValid() const override
{
return std::isfinite(position) && std::isfinite(velocity);
}
......
......@@ -43,6 +43,8 @@ namespace armarx
{
public:
virtual ControlMode getType() const = 0;
virtual void reset() = 0;
virtual bool isValid() const = 0;
};
}
......
......@@ -46,11 +46,11 @@ namespace armarx
{
return eTorqueControl;
}
virtual void reset()
virtual void reset() override
{
torque = ControllerConstatns::ValueNotSetNaN;
}
bool isValid() const
virtual bool isValid() const override
{
return std::isfinite(torque);
}
......
......@@ -46,11 +46,11 @@ namespace armarx
{
return eVelocityControl;
}
virtual void reset()
virtual void reset() override
{
velocity = ControllerConstatns::ValueNotSetNaN;
}
bool isValid() const
virtual bool isValid() const override
{
return std::isfinite(velocity);
}
......
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