scs.tickAndUpdate(); assertTrue(maxRate >= processed.getSmoothedRate().getDoubleValue()); assertTrue(maxAcceleration >= processed.getSmoothedAcceleration().getDoubleValue()); assertTrue(Math.abs(processed.getSmoothedRate().getDoubleValue()) <= maxRate); assertTrue(Math.abs(processed.getSmoothedAcceleration().getDoubleValue()) <= maxAcceleration);
scs.tickAndUpdate(); assertTrue(maxRate >= processed.getSmoothedRate().getDoubleValue()); assertTrue(maxAcceleration >= processed.getSmoothedAcceleration().getDoubleValue()); assertEquals(value, processed.getSmoothedRate().getDoubleValue(), EPSILON); assertEquals(0.0, processed.getSmoothedAcceleration().getDoubleValue(), EPSILON);
scs.tickAndUpdate(); assertTrue(maxRate >= processed.getSmoothedRate().getDoubleValue()); assertTrue(maxAcceleration >= processed.getSmoothedAcceleration().getDoubleValue()); assertTrue(Math.abs(processed.getSmoothedRate().getDoubleValue()) <= maxRate); assertTrue(Math.abs(processed.getSmoothedAcceleration().getDoubleValue()) <= maxAcceleration);
fail(); if (processed.getSmoothedRate().getDoubleValue() > maxRate) fail(); scs.tickAndUpdate(); assertTrue(maxRate >= processed.getSmoothedRate().getDoubleValue()); assertTrue(maxAcceleration >= processed.getSmoothedAcceleration().getDoubleValue()); assertTrue(Math.abs(processed.getSmoothedRate().getDoubleValue()) <= maxRate); assertTrue(Math.abs(processed.getSmoothedAcceleration().getDoubleValue()) <= maxAcceleration);
@ContinuousIntegrationTest(estimatedDuration = 0.0) @Test(timeout=300000) public void testUpdate() { setupSCSStuff(); maxRate = 10.0; maxAcceleration = 7.0; double dT = 1; YoDouble maxRateYo = new YoDouble("max_Rate", registry); maxRateYo.set(maxRate, notifyListeners); YoDouble maxAccelerationYo = new YoDouble("max_Acceleration", registry); maxAccelerationYo.set(maxAcceleration, notifyListeners); AccelerationLimitedYoVariable processed = new AccelerationLimitedYoVariable(nameYo, registry, maxRateYo, maxAccelerationYo, dT); processed.setMaximumRate(maxRate); processed.setMaximumAcceleration(maxAcceleration); for(double displacement = 1.0; displacement < 10000.0; displacement += 1000.0) { processed.update(displacement); assertTrue(processed.getSmoothedRate().getDoubleValue() <= maxRate); } }
scs.tickAndUpdate(); assertTrue(maxRate >= processed.getSmoothedRate().getDoubleValue()); assertTrue(maxAcceleration >= processed.getSmoothedAcceleration().getDoubleValue()); assertTrue(Math.abs(processed.getSmoothedRate().getDoubleValue()) <= maxRate); assertTrue(Math.abs(processed.getSmoothedAcceleration().getDoubleValue()) <= maxAcceleration); assertEquals(0.0, processed.getSmoothedRate().getDoubleValue(), EPSILON); assertEquals(0.0, processed.getSmoothedAcceleration().getDoubleValue(), EPSILON);
scs.tickAndUpdate(); assertTrue(maxRate >= processed.getSmoothedRate().getDoubleValue()); assertTrue(maxAcceleration >= processed.getSmoothedAcceleration().getDoubleValue()); assertEquals(0.0, processed.getSmoothedRate().getDoubleValue(), EPSILON); assertEquals(0.0, processed.getSmoothedAcceleration().getDoubleValue(), EPSILON);
scs.tickAndUpdate(); assertTrue(maxRate >= processed.getSmoothedRate().getDoubleValue()); assertTrue(maxAcceleration >= processed.getSmoothedAcceleration().getDoubleValue()); assertEquals(2 * constant * time, processed.getSmoothedRate().getDoubleValue(), EPSILON); assertEquals(2 * constant, processed.getSmoothedAcceleration().getDoubleValue(), EPSILON); assertEquals(0.0, processed.getSmoothedRate().getDoubleValue(), EPSILON); assertEquals(0.0, processed.getSmoothedAcceleration().getDoubleValue(), EPSILON);