@ContinuousIntegrationTest(estimatedDuration = 0.0)
@Test(timeout=300000)
public void testVelocityNegativeWithoutCrossingZero2()
{
Random rand = new Random(1798L);
YoVariableRegistry registry = new YoVariableRegistry("blop");
YoDouble alphaVariable = new YoDouble("alpha", registry);
alphaVariable.set(RandomNumbers.nextDouble(rand, 0.0, 1.0));
double dt = RandomNumbers.nextDouble(rand, 1e-8, 1.0);
YoDouble slopTime = new YoDouble("slop", registry);
YoDouble rawPosition = new YoDouble("rawPosition", registry);
FilteredVelocityYoVariable filtVelocity = new FilteredVelocityYoVariable("filtVelocity", "", alphaVariable, rawPosition, dt, registry);
BacklashCompensatingVelocityYoVariable backlashAndFiltered = new BacklashCompensatingVelocityYoVariable("", "", alphaVariable, rawPosition, dt, slopTime,
registry);
filtVelocity.update();
backlashAndFiltered.update();
for (int i = 0; i < 1000; i++)
{
slopTime.set(RandomNumbers.nextDouble(rand, 0.0, 100.0));
alphaVariable.set(RandomNumbers.nextDouble(rand, 0.0, 1.0));
rawPosition.sub(RandomNumbers.nextDouble(rand, 0.0, 101.0));
filtVelocity.update();
backlashAndFiltered.update();
assertEquals(filtVelocity.getDoubleValue(), backlashAndFiltered.getDoubleValue(), EPSILON);
}
}