本文整理了Java中us.ihmc.yoVariables.variable.YoVariable.getValueAsDouble()
方法的一些代码示例,展示了YoVariable.getValueAsDouble()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YoVariable.getValueAsDouble()
方法的具体详情如下:
包路径:us.ihmc.yoVariables.variable.YoVariable
类名称:YoVariable
方法名:getValueAsDouble
[英]Retrieves this variable's value interpreted as a double.
Abstract; implemented by each extension of YoVariable to return different interpretations.
[中]检索此变量的值,该值被解释为双精度。
摘要由变量的每个扩展实现,以返回不同的解释。
代码示例来源:origin: us.ihmc/simulation-construction-set-tools
private double[] getCompleteMessageValues()
{
double[] allVals = new double[allVariables.length];
for (int i = 0; i < allVariables.length; i++)
{
allVals[i] = allVariables[i].getValueAsDouble();
}
return allVals;
}
代码示例来源:origin: us.ihmc/simulation-construction-set-tools-test
@Override public void notifyOfVariableChange(YoVariable<?> v)
{
System.out.println("Knob button changed value: " + v.getValueAsDouble());
}
});
代码示例来源:origin: us.ihmc/ihmc-yovariables
/**
* Retreives this variable's value interpreted as a Double and converted to a String.
*
* @see #getValueAsDouble()
* @return String formatted double value of this variable
*/
public String getNumericValueAsAString()
{
return Double.toString(getValueAsDouble());
}
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces
public void saveYoVariablesAsDoubles()
{
for (int i = 0; i < varsToSave.size(); i++)
{
YoVariable<?> currentYoVariable = varsToSave.get(i);
yoVarsToDoublesMap.put(currentYoVariable, currentYoVariable.getValueAsDouble());
}
}
代码示例来源:origin: us.ihmc/ihmc-whole-body-controller
public void rememberCorruptorVariableValues()
{
corruptorVariableValuesToRemember = new double[corruptorVariables.size()];
for (int i=0; i<corruptorVariables.size(); i++)
{
corruptorVariableValuesToRemember[i] = corruptorVariables.get(i).getValueAsDouble();
}
}
代码示例来源:origin: us.ihmc/ihmc-whole-body-controller
public void notifyOfVariableChange(YoVariable<?> v)
{
matrix.setElement(i, j, v.getValueAsDouble());
}
}
代码示例来源:origin: us.ihmc/simulation-construction-set-tools
public void updateValues()
{
for (MidiControl tmpControl : controlsHashTable.values())
{
int mapping = tmpControl.mapping - 1;
VisualizerIcon icon = iconMap.get(mapping);
if (icon != null)
icon.updateCurrentValue(tmpControl.var.getValueAsDouble());
else
System.out.println("Icon requested does not exist on the board.");
}
}
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces-test
@Override
public void notifyOfVariableChange(YoVariable<?> v)
{
if (Double.isNaN(v.getValueAsDouble()))
{
fail("Desired ICP X value is NaN.");
}
}
});
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces-test
@Override
public void notifyOfVariableChange(YoVariable<?> v)
{
if (Double.isNaN(v.getValueAsDouble()))
{
fail("Desired ICP Y value is NaN.");
}
}
});
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces-test
@Override
public void notifyOfVariableChange(YoVariable<?> v)
{
if (Double.isNaN(v.getValueAsDouble()))
{
fail("Desired ICP Y value is NaN.");
}
}
});
代码示例来源:origin: us.ihmc/acsell
@Override
public void notifyOfVariableChange(YoVariable<?> v)
{
if (v.getValueAsDouble() < minVelocityX)
v.setValueFromDouble(minVelocityX, false);
if (v.getValueAsDouble() > maxVelocityX)
v.setValueFromDouble(maxVelocityX, false);
}
});
代码示例来源:origin: us.ihmc/simulation-construction-set-tools
public static int valueRatioConvertToIntWithExponents(MidiControl control, int sliderBoardMax)
{
double max = control.max;
double min = control.min;
double exponent = control.exponent;
double hires = control.hires;
double value = 0;
double minValueAllowed = Math.min(control.min, control.max);
double maxValueAllowed = Math.max(control.min, control.max);
value = MathTools.clamp(control.var.getValueAsDouble(), minValueAllowed, maxValueAllowed);
return valueRatioConvertToIntWithExponents(sliderBoardMax, max, min, exponent, hires, value);
}
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces-test
public static double[] findControllerDesiredJointAccelerations(String bodyName, RobotSide robotSide, OneDoFJointBasics[] armJoints, SimulationConstructionSet scs)
{
double[] qdd_ds = new double[armJoints.length];
String nameSpace = bodyName + "UserControlModule";
for (int i = 0; i < armJoints.length; i++)
{
String variable = bodyName + "UserMode_" + armJoints[i].getName() + "_qdd_d";
qdd_ds[i] = scs.getVariable(nameSpace, variable).getValueAsDouble();
}
return qdd_ds;
}
代码示例来源:origin: us.ihmc/acsell
@Override
public void notifyOfVariableChange(YoVariable<?> v)
{
desiredVelocityX.set(v.getValueAsDouble()+desiredVelX_Adjust.getDoubleValue());
}
});
代码示例来源:origin: us.ihmc/acsell
@Override
public void notifyOfVariableChange(YoVariable<?> v)
{
desiredVelocityX.set(v.getValueAsDouble()+desiredVelX_Setpoint.getDoubleValue());
}
});
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces-test
public static Quaternion findQuat4d(String nameSpace, String prefix, String suffix, SimulationConstructionSet scs)
{
double x = scs.getVariable(nameSpace, YoFrameVariableNameTools.createQxName(prefix, suffix)).getValueAsDouble();
double y = scs.getVariable(nameSpace, YoFrameVariableNameTools.createQyName(prefix, suffix)).getValueAsDouble();
double z = scs.getVariable(nameSpace, YoFrameVariableNameTools.createQzName(prefix, suffix)).getValueAsDouble();
double s = scs.getVariable(nameSpace, YoFrameVariableNameTools.createQsName(prefix, suffix)).getValueAsDouble();
return new Quaternion(x, y, z, s);
}
代码示例来源:origin: us.ihmc/simulation-construction-set-tools
@Override
public void moveControl(MidiControl midiControl, int sliderValue)
{
if (midiOut != null)
{
printIfDebug("ASetting control [" + midiControl.mapping + "] to " + midiControl.var.getValueAsDouble());
getOrStartSender(midiControl).set(midiControl, sliderValue);
}
}
代码示例来源:origin: us.ihmc/simulation-construction-set-tools
@Override
public void moveControl(MidiControl midiControl, int sliderValue)
{
if (midiOut != null)
{
printIfDebug("ASetting control [" + midiControl.mapping + "] to " + midiControl.var.getValueAsDouble());
getOrStartSender(midiControl).set(midiControl, sliderValue);
}
}
代码示例来源:origin: us.ihmc/simulation-construction-set-tools
@Override
public void moveControl(MidiControl midiControl)
{
if (midiOut != null)
{
printIfDebug("ASetting control [" + midiControl.mapping + "] to " + midiControl.var.getValueAsDouble());
getOrStartSender(midiControl).set(midiControl);
}
}
代码示例来源:origin: us.ihmc/simulation-construction-set-tools
@Override
public void notifyOfVariableChange(YoVariable<?> variable)
{
// System.out.println("commandListener.isConnected(): " + commandListener.isConnected());
// System.out.println("protocolListener: " + protocolListener);
if (GUISideCommandListener.isRecording())
{
if (commandListener.isConnected() && (protocolListener != null))
guiSideProtocolTalker.sendSet(commandListener.getIndex(variable), (float) variable.getValueAsDouble());
}
}
内容来源于网络,如有侵权,请联系作者删除!