Skip to content
Snippets Groups Projects
Commit 378e61fb authored by Mirko Wächter's avatar Mirko Wächter
Browse files

added limitless joint support for trajectory controller

parent 96c6d8e2
No related branches found
No related tags found
No related merge requests found
......@@ -48,6 +48,7 @@ namespace armarx
//}
positions.resize(traj->dim(), 1);
veloctities.resize(traj->dim(), 1);
currentError.resize(traj->dim(), 1);
}
const Eigen::VectorXf& TrajectoryController::update(double deltaT, const Eigen::VectorXf& currentPosition)
......@@ -82,7 +83,18 @@ namespace armarx
veloctities(i) = 0;
}
}
currentError = positions - currentPosition;
for (size_t i = 0; i < dim; ++i)
{
if (pid->limitless.size() > i && pid->limitless.at(i))
{
currentError(i) = math::MathUtils::AngleDelta(currentPosition(i), positions(i));
}
else
{
currentError(i) = positions(i) - currentPosition(i);
}
}
pid->update(std::abs(deltaT), currentPosition, positions);
veloctities += pid->getControlValue();
......
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