public void update() { if (position == null) { throw new NullPointerException("YoAlphaFilteredVariable must be constructed with a non null " + "position variable to call update(), otherwise use update(double)"); } update(position.getDoubleValue()); }
public void update() { if (position == null) { throw new NullPointerException(getClass().getSimpleName() + " must be constructed with a non null " + "position variable to call update(), otherwise use update(double)"); } update(position.getDoubleValue()); }
private void updateLowLevelData(Map<InverseDynamicsJoint, Double> jointTorquesSolution) { rootJointDesiredConfiguration.setDesiredAccelerationFromJoint(rootJoint); for (OneDoFJoint joint : controlledOneDoFJoints) { if (jointTorquesSolution.containsKey(joint)) { if (USE_LIMITED_JOINT_TORQUES) { if (firstTick) jointTorqueSolutions.get(joint).set(jointTorquesSolution.get(joint)); else jointTorqueSolutions.get(joint).update(jointTorquesSolution.get(joint)); lowLevelOneDoFJointDesiredDataHolder.setDesiredJointTorque(joint, jointTorqueSolutions.get(joint).getDoubleValue()); } else { lowLevelOneDoFJointDesiredDataHolder.setDesiredJointTorque(joint, jointTorquesSolution.get(joint)); } } } }
@ContinuousIntegrationTest(estimatedDuration = 0.0) @Test(timeout=300000) public void testUpdateWithMaxRateBeingNegative() { try { RateLimitedYoVariable rateLimitedYoVariableWithNegativeMaxRate = new RateLimitedYoVariable("rateLimitedYoVariableWithNegativeMaxRate", registry, -5.0, 1.0); rateLimitedYoVariableWithNegativeMaxRate.update(5.0); } catch (RuntimeException e) { assertTrue(e.getMessage() == "The maxRate parameter in the RateLimitedYoVariable cannot be negative."); } } }
public double computeStictionCompensation() { updateActionMode(); if (stictionActionMode.getEnumValue().active()) { double torqueSign = Math.signum(desiredTorque); double stictionMagnitude = stictionModel.getStictionMagnitude(); stictionCompensationLimit.set(Math.min(torqueSign * desiredTorque * desiredTorqueStictionLimitFactor.getValue(), stictionMagnitude)); stictionCompensation.update(torqueSign * stictionCompensationLimit.getDoubleValue()); } else { stictionCompensationLimit.set(0.0); stictionCompensation.update(stictionCompensationLimit.getDoubleValue()); } return stictionCompensation.getDoubleValue(); }
@Override public void compute() { if (!isEnabled.getBooleanValue()) return; qCurrent.set(joint.getQ()); qDCurrent.set(joint.getQd()); qError.set(qDesired.getDoubleValue() - qCurrent.getDoubleValue()); qDError.set(qDDesired.getDoubleValue() - qDCurrent.getDoubleValue()); double qdd_fb = kp.getDoubleValue() * qError.getDoubleValue() + kd.getDoubleValue() * qDError.getDoubleValue(); qdd_fb = MathTools.clipToMinMax(qdd_fb, maxFeedbackAcceleration.getDoubleValue()); qDDFeedback.set(qdd_fb); qDDFeedbackRateLimited.update(); qDDDesired.set(qDDFeedforward.getDoubleValue() + qDDFeedbackRateLimited.getDoubleValue()); output.setOneDoFJointDesiredAcceleration(0, qDDDesired.getDoubleValue()); }