本文整理了Java中us.ihmc.robotics.dataStructures.variable.YoVariable
类的一些代码示例,展示了YoVariable
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YoVariable
类的具体详情如下:
包路径:us.ihmc.robotics.dataStructures.variable.YoVariable
类名称:YoVariable
[英]Title: Yobotics! Simulation Construction Set
Description: Package for Simulating Dynamic Robots and Mechanisms
YoVariables provide a simple, convienent mechanism for storing and manipulating robot data. While each essentially contains a double value YoVariables are designed for integration into the SCS GUI. Once registered, a variable will automatically become available to the GUI for graphing, modification and other data manipulation. Historical values of all registered YoVariables are stored in the DataBuffer which may be exported for later use.
Copyright: Copyright (c) 2000-2011
Company: Yobotics, Inc. and IHMC
[中]标题:Yobotics!模拟构造集
描述:用于模拟动态机器人和机构的软件包
YoVariables为存储和操作机器人数据提供了一种简单、方便的机制。虽然每个基本上都包含一个双值变量,但这些变量是为集成到SCS GUI而设计的。一旦注册,变量将自动供GUI使用,用于绘图、修改和其他数据操作。所有注册变量的历史值都存储在DataBuffer中,可以导出以供以后使用。
版权所有:版权所有(c)2000-2011
公司:Yobotics,Inc.和IHMC
代码示例来源:origin: us.ihmc/IHMCRobotDataLogger
public void update()
{
updateVariable(variableOffset, variable);
if(variable.getValueAsDouble() < minimum)
{
minimum = variable.getValueAsDouble();
}
if(variable.getValueAsDouble() > maximum)
{
maximum = variable.getValueAsDouble();
}
samples++;
average += (variable.getValueAsDouble() - average) / ((double)samples);
}
代码示例来源:origin: us.ihmc/IHMCRobotDataVisualizer
@Override
public void actionPerformed(ActionEvent e)
{
var.setValueFromDouble(newValue);
}
});
代码示例来源:origin: us.ihmc/IHMCRoboticsToolkit
public String[] getCreatedVariableNames()
{
String[] ret = new String[createdVariables.length];
for (int i = 0; i < createdVariables.length; i++)
{
ret[i] = createdVariables[i].getName();
}
return ret;
}
代码示例来源:origin: us.ihmc/SensorProcessing
public void variableChanged(YoVariable variable)
{
output.setValueFromDouble(variable.getValueAsDouble() * multiplicationFactor);
}
}
代码示例来源:origin: us.ihmc/DarpaRoboticsChallenge
@Override
public void variableChanged(YoVariable<?> v)
{
System.out.println("Change: " + v.getShortName() + " -> " + v.getValueAsDouble());
}
};
代码示例来源:origin: us.ihmc/IHMCHumanoidBehaviors
@Override
public void variableChanged(YoVariable<?> v)
{
sendToBehavior(v.getName(), v.getValueAsDouble());
}
});
代码示例来源:origin: us.ihmc/IHMCRobotDataVisualizer
result[i].append(variable.getName());
result[i].append(" = [");
offsets[i] = this.variables.indexOf(variable);
variable.setValueFromLongBits(longBuffer.get(1 + offsets[i]), false);
variable.getValueString(result[i]);
result[i].append(",");
combine.append(result[i]);
Path path = Paths.get(variables.get(0).getName() + ".m");
Files.write(path, combine.toString().getBytes());
System.out.println("Wrote " + variables.get(0) + " to " + path);
代码示例来源:origin: us.ihmc/DarpaRoboticsChallenge
private void testAccess(YoVariable<?> v)
{
Thread currentThread = Thread.currentThread();
switch (currentThread.getName())
{
case "AWT-EventQueue-0":
case "SCS simulation thread":
System.out.println("[" + getClass().getSimpleName() + "] Variable " + v.getName() + " was changed from the UI.");
return;
}
if (accessorThread == null)
{
accessorThread = currentThread;
}
if (!currentThread.equals(accessorThread))
{
try
{
throw new Exception("Variable " + v.getFullNameWithNameSpace() + " changed by thread " + currentThread + ", expected: " + accessorThread);
}
catch(Exception e)
{
if (DEBUG)
{
e.printStackTrace();
}
}
}
}
代码示例来源:origin: us.ihmc/IHMCRoboticsToolkit
private YoVariableTestGoal(YoVariable<?>... yoVariables)
{
for (YoVariable<?> yoVariable : yoVariables)
{
yoVariable.addVariableChangedListener(this);
}
}
代码示例来源:origin: us.ihmc/IHMCRobotDataLogger
yoVariableDefinition.setName(variable.getName());
yoVariableDefinition.setRegistry(registryID);
switch (variable.getYoVariableType())
break;
default:
throw new RuntimeException("Unknown variable type: " + variable.getYoVariableType());
代码示例来源:origin: us.ihmc/IHMCRoboticsToolkit
public abstract void setValueFromLongBits(long value, boolean notifyListeners);
代码示例来源:origin: us.ihmc/RobotDataCommunication
long previousValue = variable.getValueAsLongBits();
long newValue = data.get();
variable.setValueFromLongBits(newValue, false);
if (previousValue != newValue)
ArrayList<VariableChangedListener> changedListeners = variable.getVariableChangedListeners();
if (changedListeners != null)
代码示例来源:origin: us.ihmc/IHMCRobotDataLogger
public void writeCSV(PrintWriter writer)
{
writer.print(variable.getNameSpace());
writer.print(',');
writer.print(variable.getName());
writer.print(',');
writer.print(minimum);
writer.print(',');
writer.print(maximum);
writer.print(',');
writer.print(average);
writer.print(',');
writer.print(maximum - minimum);
writer.println();
}
代码示例来源:origin: us.ihmc/IHMCRoboticsToolkit
/**
* hasSameFullName
*
* @param variable YoVariable
* @return boolean
*/
public boolean hasSameFullName(YoVariable<?> variable)
{
return this.getFullNameWithNameSpace().equals(variable.getFullNameWithNameSpace());
}
代码示例来源:origin: us.ihmc/IHMCRoboticsToolkit
/**
* Adds the variables name & value to the beginning of the given string buffer
*
* @param stringBuffer StringBuffer to which the data will be added
*/
public void getNameAndValueString(StringBuffer stringBuffer)
{
stringBuffer.append(name); // buffer.insert(0,this.name); // Add the variable name to it.
stringBuffer.append(SPACE_STRING); // Add a space.
getValueString(stringBuffer);
}
代码示例来源:origin: us.ihmc/IHMCHumanoidBehaviors
@Override
public void variableChanged(YoVariable<?> v)
{
sendToUI(v.getName(), v.getValueAsDouble());
}
});
代码示例来源:origin: us.ihmc/RobotDataCommunication
result[i].append(variable.getName());
result[i].append(" = [");
offsets[i] = this.variables.indexOf(variable);
variable.setValueFromLongBits(longBuffer.get(1 + offsets[i]), false);
variable.getValueString(result[i]);
result[i].append(",");
combine.append(result[i]);
Path path = Paths.get(variables.get(0).getName() + ".m");
Files.write(path, combine.toString().getBytes());
System.out.println("Wrote " + variables.get(0) + " to " + path);
代码示例来源:origin: us.ihmc/IHMCRoboticsToolkit
private void testAccess(YoVariable<?> v)
{
Thread currentThread = Thread.currentThread();
switch (currentThread.getName())
{
case "AWT-EventQueue-0":
case "SCS simulation thread":
System.out.println("[" + getClass().getSimpleName() + "] Variable " + v.getName() + " was changed from the UI.");
return;
}
if (accessorThread == null)
{
accessorThread = currentThread;
}
if (!currentThread.equals(accessorThread))
{
try
{
throw new Exception("Variable " + v.getFullNameWithNameSpace() + " changed by thread " + currentThread + ", expected: " + accessorThread);
}
catch(Exception e)
{
if (DEBUG)
{
e.printStackTrace();
}
}
}
}
代码示例来源:origin: us.ihmc/IHMCHumanoidBehaviors
public void registerYovaribleForAutoSendToBehavior(YoVariable var)
{
var.addVariableChangedListener(new VariableChangedListener()
{
@Override
public void variableChanged(YoVariable<?> v)
{
sendToBehavior(v.getName(), v.getValueAsDouble());
}
});
}
代码示例来源:origin: us.ihmc/RobotDataCommunication
yoVariableDefinition.setName(variable.getName());
yoVariableDefinition.setRegistry(registryID);
switch (variable.getYoVariableType())
break;
default:
throw new RuntimeException("Unknown variable type: " + variable.getYoVariableType());
内容来源于网络,如有侵权,请联系作者删除!