Skip to content
Snippets Groups Projects

Improve armar7 platform movement

Merged Tobias Gröger requested to merge feature/improve-armar7-platform-movement into master
All threads resolved!
Compare and Show latest version
2 files
+ 40
6
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -92,10 +92,20 @@ namespace armarx
rtGetControlStruct().velocityY,
rtGetControlStruct().velocityRotation);
Eigen::VectorXf result = ramp.update(x, timeSinceLastIteration.toSecondsDouble());
target->velocityX = result(0);
target->velocityY = result(1);
target->velocityRotation = result(2);
if (x == Eigen::Vector3f::Zero())
{
target->velocityX = 0;
target->velocityY = 0;
target->velocityRotation = 0;
}
else
{
Eigen::VectorXf result = ramp.update(x, timeSinceLastIteration.toSecondsDouble());
target->velocityX = result(0);
target->velocityY = result(1);
target->velocityRotation = result(2);
}
}
}
@@ -145,7 +155,29 @@ namespace armarx
throw LocalException("Error factor negative!");
}
Eigen::Vector3f oldState = state;
state += delta / factor;
if (target == Eigen::Vector3f::Zero() && state != Eigen::Vector3f::Zero())
{
// if (state.norm() >= oldState.norm())
// {
ARMARX_RT_LOGF_IMPORTANT("Target %.04f %.04f %.04f", target(0), target(1), target(2));
ARMARX_RT_LOGF_IMPORTANT(
"OStte %.04f %.04f %.04f", oldState(0), oldState(1), oldState(2));
ARMARX_RT_LOGF_IMPORTANT("State %.04f %.04f %.04f", state(0), state(1), state(2));
ARMARX_RT_LOGF_IMPORTANT("Delta %.04f %.04f %.04f", delta(0), delta(1), delta(2));
ARMARX_RT_LOGF_IMPORTANT("Factor %.04f", factor);
if (state.norm() > oldState.norm())
{
ARMARX_RT_LOGF_IMPORTANT("!!!!NORM INVALID!!!!");
}
// throw LocalException("haeee");
// }
}
return state;
}
Loading