@Override public void setX(double x) { this.x.set(x); }
@Override public void setY(double y) { this.y.set(y); }
@Override public void setDerivativeGain(double derivativeGain) { maxDerivativeGain.set(derivativeGain); }
@Override public void setMaxDerivativeError(double maxDerivativeError) { this.maxDerivativeError.set(maxDerivativeError); }
@Override public void setIntegralGains(double integralGainX, double integralGainY, double integralGainZ, double maxIntegralError) { if (!usingIntegrator) { return; } kiMap.get(Axis.X).set(integralGainX); kiMap.get(Axis.Y).set(integralGainY); kiMap.get(Axis.Z).set(integralGainZ); this.maxIntegralError.set(maxIntegralError); }
private static DoubleProvider createMaxRateYoDouble(String namePrefix, String nameSuffix, double initialValue, YoVariableRegistry registry) { YoDouble maxRate = new YoDouble(namePrefix + "MaxRate" + nameSuffix, registry); maxRate.set(initialValue); return maxRate; }
public void setGaussianNoise(double standardDeviation) { this.noiseType.set(NoiseType.GAUSSIAN); this.standardDeviation.set(standardDeviation); }
public static void storeInYoVariablesSymmetric(DenseMatrix64F m, List<List<YoDouble>> yoM) { int size = m.getNumRows(); for (int i = 0; i < size; i++) { List<YoDouble> row = yoM.get(i); for (int j = 0; j <= i; j++) { row.get(j).set(m.get(i, j)); } } }
public void enableMax() { max = new YoDouble(variable.getName() + "Max", registry); max.set(Double.MIN_VALUE); }
public static void storeInYoVariablesMatrix(DenseMatrix64F m, List<List<YoDouble>> yoM) { for (int i = 0; i < m.getNumRows(); i++) { List<YoDouble> row = yoM.get(i); for (int j = 0; j < m.getNumCols(); j++) { row.get(j).set(m.get(i, j)); } } }
private void performModeChangeAction(double time) { modeChanged = true; timeModeChanged.set(time); timeInCurrentMode.set(time - timeModeChanged.getDoubleValue()); signalDerivative.initialize(DifferentiationMode.USING_DT, value.getDoubleValue(), timeInCurrentMode.getDoubleValue(), valueDot.getDoubleValue()); }
public RateLimitedYoVariable(String name, YoVariableRegistry registry, double maxRate, YoDouble positionVariable, double dt) { super(name, registry); this.hasBeenCalled = new YoBoolean(name + "HasBeenCalled", registry); this.limited = new YoBoolean(name + "Limited", registry); position = positionVariable; YoDouble maxRateVariable = new YoDouble(name + "MaxRate", registry); maxRateVariable.set(maxRate); this.maxRateVariable = maxRateVariable; this.dt = dt; reset(); }
public void update(double input) { int nUpdatesOld = nUpdates.getIntegerValue(); nUpdates.increment(); int nUpdatesNew = nUpdates.getIntegerValue(); double ratio = ((double) nUpdatesOld) / ((double) nUpdatesNew); average.set(average.getDoubleValue() * ratio + input / nUpdates.getIntegerValue()); }
public void update(double input) { if (!hasBeenInitialized.getBooleanValue()) initialize(input); double positionError = input - this.getDoubleValue(); double acceleration = -velocityGain.getDoubleValue() * smoothedRate.getDoubleValue() + positionGain.getDoubleValue() * positionError; acceleration = MathTools.clamp(acceleration, -maximumAcceleration.getDoubleValue(), maximumAcceleration.getDoubleValue()); smoothedAcceleration.set(acceleration); smoothedRate.add(smoothedAcceleration.getDoubleValue() * dt); smoothedRate.set(MathTools.clamp(smoothedRate.getDoubleValue(), maximumRate.getDoubleValue())); this.add(smoothedRate.getDoubleValue() * dt); }