Skip to content
Snippets Groups Projects
Commit 7cd7b561 authored by Tobias Gröger's avatar Tobias Gröger
Browse files

test

parent b82f9b94
No related branches found
No related tags found
No related merge requests found
Pipeline #19022 passed
......@@ -73,29 +73,29 @@ namespace armarx
const IceUtil::Time& sensorValuesTimestamp,
const IceUtil::Time& timeSinceLastIteration)
{
auto commandAge = sensorValuesTimestamp - rtGetControlStruct().commandTimestamp;
// auto commandAge = sensorValuesTimestamp - rtGetControlStruct().commandTimestamp;
if (commandAge > maxCommandDelay && // command must be recent
(rtGetControlStruct().velocityX != 0.0f || rtGetControlStruct().velocityY != 0.0f ||
rtGetControlStruct().velocityRotation !=
0.0f)) // only throw error if any command is not zero
{
throw LocalException(
"Platform target velocity was not set for a too long time: delay: ")
<< commandAge.toSecondsDouble()
<< " s, max allowed delay: " << maxCommandDelay.toSecondsDouble() << " s";
}
else
{
Eigen::VectorXf x(6);
x << rtGetControlStruct().velocityX, rtGetControlStruct().velocityY, 0, 0, 0,
rtGetControlStruct().velocityRotation;
// if (commandAge > maxCommandDelay && // command must be recent
// (rtGetControlStruct().velocityX != 0.0f || rtGetControlStruct().velocityY != 0.0f ||
// rtGetControlStruct().velocityRotation !=
// 0.0f)) // only throw error if any command is not zero
// {
// throw LocalException(
// "Platform target velocity was not set for a too long time: delay: ")
// << commandAge.toSecondsDouble()
// << " s, max allowed delay: " << maxCommandDelay.toSecondsDouble() << " s";
// }
// else
// {
Eigen::VectorXf x(6);
x << rtGetControlStruct().velocityX, rtGetControlStruct().velocityY, 0, 0, 0,
rtGetControlStruct().velocityRotation;
Eigen::VectorXf result = ramp.update(x, timeSinceLastIteration.toSecondsDouble());
target->velocityX = result(0);
target->velocityY = result(1);
target->velocityRotation = result(5);
}
Eigen::VectorXf result = ramp.update(x, timeSinceLastIteration.toSecondsDouble());
target->velocityX = result(0);
target->velocityY = result(1);
target->velocityRotation = result(5);
// }
}
void
......
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