us.ihmc.yoVariables.variable.YoDouble.addVariableChangedListener()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(10.2k)|赞(0)|评价(0)|浏览(105)

本文整理了Java中us.ihmc.yoVariables.variable.YoDouble.addVariableChangedListener()方法的一些代码示例,展示了YoDouble.addVariableChangedListener()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YoDouble.addVariableChangedListener()方法的具体详情如下:
包路径:us.ihmc.yoVariables.variable.YoDouble
类名称:YoDouble
方法名:addVariableChangedListener

YoDouble.addVariableChangedListener介绍

暂无

代码示例

代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit

private void addLeakRatioClipper()
{
 VariableChangedListener leakRatioClipper = new VariableChangedListener()
 {
   @Override
   public void notifyOfVariableChange(YoVariable<?> v)
   {
    integralLeakRatio.set(MathTools.clamp(integralLeakRatio.getDoubleValue(), 0.0, 1.0), false);
   }
 };
 integralLeakRatio.addVariableChangedListener(leakRatioClipper);
}

代码示例来源:origin: us.ihmc/ihmc-yovariables

/**
* Attaches a listener to {@code this} that is to be triggered when this tuple components change.
* 
* @param variableChangedListener the listener to be attached.
*/
public final void attachVariableChangedListener(VariableChangedListener variableChangedListener)
{
 x.addVariableChangedListener(variableChangedListener);
 y.addVariableChangedListener(variableChangedListener);
 z.addVariableChangedListener(variableChangedListener);
}

代码示例来源:origin: us.ihmc/ihmc-yovariables

public void attachVariableChangedListener(VariableChangedListener variableChangedListener)
{
 yaw.addVariableChangedListener(variableChangedListener);
 pitch.addVariableChangedListener(variableChangedListener);
 roll.addVariableChangedListener(variableChangedListener);
}

代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit

public YoDoubleStatistics(YoDouble variable, YoVariableRegistry registry)
{
 this.variable = variable;
 this.registry = registry;
 
 variable.addVariableChangedListener(this::update);
}

代码示例来源:origin: us.ihmc/ihmc-yovariables

/**
* Attaches a listener to {@code this} that is to be triggered when this tuple components change.
* 
* @param variableChangedListener the listener to be attached.
*/
public final void attachVariableChangedListener(VariableChangedListener variableChangedListener)
{
 x.addVariableChangedListener(variableChangedListener);
 y.addVariableChangedListener(variableChangedListener);
}

代码示例来源:origin: us.ihmc/ihmc-yovariables

/**
* Attaches a listener to {@code this} that is to be triggered when this quaternion components
* change.
* 
* @param variableChangedListener the listener to be attached.
*/
public void attachVariableChangedListener(VariableChangedListener variableChangedListener)
{
 qx.addVariableChangedListener(variableChangedListener);
 qy.addVariableChangedListener(variableChangedListener);
 qz.addVariableChangedListener(variableChangedListener);
 qs.addVariableChangedListener(variableChangedListener);
}

代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit

public void createDerivativeGainUpdater(boolean updateNow)
{
 VariableChangedListener kdUpdater = new VariableChangedListener()
 {
   @Override
   public void notifyOfVariableChange(YoVariable<?> v)
   {
    kd.set(GainCalculator.computeDerivativeGain(kp.getDoubleValue(), zeta.getDoubleValue()));
   }
 };
 kp.addVariableChangedListener(kdUpdater);
 zeta.addVariableChangedListener(kdUpdater);
 if (updateNow) kdUpdater.notifyOfVariableChange(null);
}

代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit

private static void addDampingUpdater(Axis axis, Map<Axis, YoDouble> kpMap, Map<Axis, YoDouble> kdMap, Map<Axis, YoDouble> zetaMap, YoBoolean update)
{
 YoDouble kp = kpMap.get(axis);
 YoDouble kd = kdMap.get(axis);
 YoDouble zeta = zetaMap.get(axis);
 DampingUpdater kdUpdater = new DampingUpdater(kp, kd, zeta, update);
 kp.addVariableChangedListener(kdUpdater);
 zeta.addVariableChangedListener(kdUpdater);
}

代码示例来源:origin: us.ihmc/ihmc-whole-body-controller

public Matrix3D createLinearAccelerationWeightMatrix()
{
 Matrix3D weightMatrix = new Matrix3D();
 xAccelerationWeights.addVariableChangedListener(new MatrixUpdater(0, 0, weightMatrix));
 yAccelerationWeights.addVariableChangedListener(new MatrixUpdater(1, 1, weightMatrix));
 zAccelerationWeight.addVariableChangedListener(new MatrixUpdater(2, 2, weightMatrix));
 xAccelerationWeights.notifyVariableChangedListeners();
 yAccelerationWeights.notifyVariableChangedListeners();
 zAccelerationWeight.notifyVariableChangedListeners();
 return weightMatrix;
}

代码示例来源:origin: us.ihmc/ihmc-whole-body-controller

public Matrix3D createAngularAccelerationWeightMatrix()
{
 Matrix3D weightMatrix = new Matrix3D();
 yawAccelerationWeight.addVariableChangedListener(new MatrixUpdater(0, 0, weightMatrix));
 pitchAccelerationWeight.addVariableChangedListener(new MatrixUpdater(1, 1, weightMatrix));
 rollAccelerationWeight.addVariableChangedListener(new MatrixUpdater(2, 2, weightMatrix));
 yawAccelerationWeight.notifyVariableChangedListeners();
 pitchAccelerationWeight.notifyVariableChangedListeners();
 rollAccelerationWeight.notifyVariableChangedListeners();
 return weightMatrix;
}

代码示例来源:origin: us.ihmc/simulation-construction-set-tools-test

public GoalOrientedTestConductor(SimulationConstructionSet scs, SimulationTestingParameters simulationTestingParameters)
{
 this.scs = scs;
 this.simulationTestingParameters = simulationTestingParameters;
 
 YoDouble yoTime = (YoDouble) scs.getVariable("t");
 yoTime.addVariableChangedListener(this::notifyOfVariableChange);
 scs.startOnAThread();
 scs.addSimulateDoneListener(this);
}

代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces-test

final MutableInt yTicks = new MutableInt(0);
desiredICPX.addVariableChangedListener(new VariableChangedListener()
desiredICPY.addVariableChangedListener(new VariableChangedListener()

代码示例来源:origin: us.ihmc/simulation-construction-set-tools-test

@ContinuousIntegrationTest(estimatedDuration = 0.0)
@Test(timeout=300000)
public void testWeirdCase()
{
 MidiSliderBoard midiSliderBoard = new MidiSliderBoard(null, true);
 YoVariableRegistry registry = new YoVariableRegistry("testRegistry");
 //need one of these for each DOF
 YoDouble yoVariable = new YoDouble("test", registry);
 midiSliderBoard.setSlider(3, yoVariable, 1.5, 2.5); //set scale
 yoVariable.addVariableChangedListener(new VariableChangedListener()
 {
   @Override public void notifyOfVariableChange(YoVariable<?> v)
   {
    System.out.println(v.getValueAsDouble());
   }
 });
 while(true)
 {
 }
}

代码示例来源:origin: us.ihmc/ihmc-graphics-description

@Override
public Artifact createArtifact()
{
 MutableColor color3f = appearance.getColor();
 YoDouble endPointX = new YoDouble(getName() + "ArtifactEndPointX", base.getYoX().getYoVariableRegistry());
 YoDouble endPointY = new YoDouble(getName() + "ArtifactEndPointY", base.getYoY().getYoVariableRegistry());
 base.getYoX().addVariableChangedListener(v -> endPointX.set(base.getX() + vector.getX()));
 base.getYoY().addVariableChangedListener(v -> endPointY.set(base.getY() + vector.getY()));
 vector.getYoX().addVariableChangedListener(v -> endPointX.set(base.getX() + vector.getX()));
 vector.getYoY().addVariableChangedListener(v -> endPointY.set(base.getY() + vector.getY()));
 return new YoArtifactLineSegment2d(getName(),
                   new YoFrameLineSegment2D(base.getYoX(), base.getYoY(), endPointX, endPointY, ReferenceFrame.getWorldFrame()),
                   color3f.get());
}

代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit

public DitherProducer(String namePrefix, YoVariableRegistry parentRegistry, double controlDT)
{
 registry = new YoVariableRegistry(namePrefix);
 desiredDitherFrequency = new YoDouble(namePrefix + "_dither_frequency_desired", registry);
 desiredDitherFrequency.set(0.0);
 desiredDitherFrequency.addVariableChangedListener(new VariableChangedListener()
 {
   @Override
   public void notifyOfVariableChange(YoVariable<?> v)
   {
    checkFrequency();
   }
 });
 ditherFrequency = new YoDouble(namePrefix + "_dither_frequency", registry);
 ditherFrequency.set(0.0);
 amplitude = new YoDouble(namePrefix + "_dither_amplitude", registry);
 amplitude.set(0.0);
 dither = new YoDouble(namePrefix + "_dither_output", registry);
 dither.set(0.0);
 maxFrequency = 1.0 / (2.0 * controlDT);
 if (parentRegistry != null)
 {
   parentRegistry.addChild(registry);
 }
}

代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces

thisJoint.getQYoVariable().addVariableChangedListener(symmetricModeListener);
thisJoint.getQYoVariable().addVariableChangedListener(symmetricModeListener);
   YoDouble oppositeSideVariable = (YoDouble) scs.getVariable(oppositeSidePrefix + f + "_j" + j);
   SymmetricModeListener symmetricModeListener = new SymmetricModeListener(oppositeSideVariable, robotSide, 1.0);
   thisVariable.addVariableChangedListener(symmetricModeListener);

代码示例来源:origin: us.ihmc/acsell

public AcsellActuatorCommand(String name, AcsellActuator actuator, YoVariableRegistry parentRegistry)
{
 this.actuator = actuator;
 this.currentLimit = actuator.getCurrentLimit();
 this.registry = new YoVariableRegistry(name);
 this.enabled = new YoBoolean(name + "Enabled", registry);
 this.tauDesired = new YoDouble(name + "TauDesired", registry);
 this.tauInertia = new YoDouble(name + "TauInertia", registry);
 this.qddDesired = new YoDouble(name + "qdd_d", registry);
 this.damping = new YoDouble(name + "Damping", registry);
 //this.currentDesired = new YoDouble(name+"CurrentDesired", registry);
 this.rawCurrentDesired = new YoDouble(name+"CurrentDesired", registry);
 
 if(actuator==StepprActuator.LEFT_HIP_Z || actuator==StepprActuator.RIGHT_HIP_Z)
   this.filteredCurrentDesired = new AlphaFilteredYoVariable(name+"CurrentDesired_filt", registry, 0.90, rawCurrentDesired);
 else
   this.filteredCurrentDesired = new AlphaFilteredYoVariable(name+"CurrentDesired_filt", registry, 0.0, rawCurrentDesired);
 
 rawCurrentDesired.addVariableChangedListener(new VariableChangedListener()
 {
   @Override
   public void notifyOfVariableChange(YoVariable<?> v)
   {
     if(v.getValueAsDouble()>currentLimit) v.setValueFromDouble(currentLimit);
     if(v.getValueAsDouble()<-currentLimit) v.setValueFromDouble(-currentLimit);        	 
   }
 });
 
 parentRegistry.addChild(registry);
}

代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces-test

YoDouble desiredICPY = (YoDouble) drcSimulationTestHelper.getYoVariable("desiredICPY");
desiredICPX.addVariableChangedListener(new VariableChangedListener()
desiredICPY.addVariableChangedListener(new VariableChangedListener()

代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces-test

YoDouble desiredICPY = (YoDouble) drcSimulationTestHelper.getYoVariable("desiredICPY");
desiredICPX.addVariableChangedListener(new VariableChangedListener()
desiredICPY.addVariableChangedListener(new VariableChangedListener()

代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces-test

YoDouble desiredICPY = (YoDouble) drcSimulationTestHelper.getYoVariable("desiredICPY");
desiredICPX.addVariableChangedListener(new VariableChangedListener()
desiredICPY.addVariableChangedListener(new VariableChangedListener()

相关文章