本文整理了Java中us.ihmc.simulationconstructionset.SimulationConstructionSet.getDataBuffer()
方法的一些代码示例,展示了SimulationConstructionSet.getDataBuffer()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SimulationConstructionSet.getDataBuffer()
方法的具体详情如下:
包路径:us.ihmc.simulationconstructionset.SimulationConstructionSet
类名称:SimulationConstructionSet
方法名:getDataBuffer
暂无
代码示例来源:origin: us.ihmc/IHMCRobotDataVisualizer
public DataBuffer getDataBuffer()
{
return scs.getDataBuffer();
}
代码示例来源:origin: us.ihmc/RobotDataCommunication
public DataBuffer getDataBuffer()
{
return scs.getDataBuffer();
}
代码示例来源:origin: us.ihmc/ihmc-robot-data-visualizer
public DataBuffer getDataBuffer()
{
return scs.getDataBuffer();
}
代码示例来源:origin: us.ihmc/simulation-construction-set-tools
public TorqueSpeedDataExporter(SimulationConstructionSet scs, Robot robot, Class<?> rootClassForDirectory, String subdirectoryName)
{
this.scs = scs;
this.robot = robot;
this.subdirectoryName = subdirectoryName;
this.graphCreator = new TorqueSpeedDataExporterGraphCreator(robot, scs.getDataBuffer());
this.excelWorkbookCreator = new DataExporterExcelWorkbookCreator(robot, scs.getDataBuffer());
this.rootClassForDirectory = rootClassForDirectory;
}
代码示例来源:origin: us.ihmc/simulation-construction-set-tools
public AbstractDataExporter(SimulationConstructionSet scs, String name, YoDouble timeYoVariable, Class<?> rootClassForDirectory,
String subdirectoryName)
{
this.scs = scs;
this.name = name;
this.subdirectoryName = subdirectoryName;
this.graphCreator = new DataExporterGraphCreator(timeYoVariable, scs.getDataBuffer());
// this.excelWorkbookCreator = new DataExporterExcelWorkbookCreator(robot, scs.getDataBuffer());
this.rootClassForDirectory = rootClassForDirectory;
}
代码示例来源:origin: us.ihmc/simulation-construction-set-test
private boolean getWrapBufferFromSCS(SimulationConstructionSet scs)
{
return scs.getDataBuffer().getWrapBuffer();
}
代码示例来源:origin: us.ihmc/simulation-construction-set-test
private int getMaxBufferSizeFromSCS(SimulationConstructionSet scs)
{
return scs.getDataBuffer().getMaxBufferSize();
}
代码示例来源:origin: us.ihmc/simulation-construction-set-test
private int getInOutBufferLengthFromSCS(SimulationConstructionSet scs)
{
return scs.getDataBuffer().getBufferInOutLength();
}
代码示例来源:origin: us.ihmc/simulation-construction-set-test
private int getBufferSizeFromSCS(SimulationConstructionSet scs)
{
return scs.getDataBuffer().getBufferSize();
}
代码示例来源:origin: us.ihmc/simulation-construction-set-tools-test
@ContinuousIntegrationTest(estimatedDuration = 1.0)
@Test(timeout = 30000)
public void testDataExporterGraphCreator() throws IOException
{
SimulationConstructionSet sim = createSimulation();
TorqueSpeedDataExporterGraphCreator graphCreator = new TorqueSpeedDataExporterGraphCreator(sim.getRobots()[0], sim.getDataBuffer());
File path = new File(System.getProperty("java.io.tmpdir"));
Path tmpPath = Files.createTempDirectory(Paths.get(path.getAbsolutePath()), "test");
graphCreator.createJointTorqueSpeedGraphs(tmpPath.toFile(), "", true, true);
int fileCount = tmpPath.toFile().listFiles(new FilenameFilter()
{
@Override
public boolean accept(File dir, String name)
{
return name.endsWith("jpg") || name.endsWith("pdf");
}
}).length;
assertTrue(fileCount > 1);
tmpPath.toFile().deleteOnExit();
}
代码示例来源:origin: us.ihmc/valkyrie
public static void main(String[] args)
{
final SimulationConstructionSet scs;
// initialize SCS
DRCRobotModel robotModel = new ValkyrieRobotModel(RobotTarget.REAL_ROBOT, false);
final FloatingRootJointRobot robot =robotModel.createHumanoidFloatingRootJointRobot(false);
SimulationConstructionSetParameters parameters = new SimulationConstructionSetParameters();
parameters.setDataBufferSize(65536);
scs = new SimulationConstructionSet(robot, parameters);
// add sysid button
JButton button = new JButton("findCOM");
button.addActionListener(new LinkComIDActionListener(scs.getDataBuffer(), robot));
scs.addButton(button);
scs.startOnAThread();
}
}
代码示例来源:origin: us.ihmc/ihmc-whole-body-controller
public void computeTorqueOffsetsBasedOnAverages()
{
for (OneDoFJointBasics oneDoFJoint : oneDoFJoints)
{
YoDouble appliedTorque = controller.getAppliedTorqueYoVariable(oneDoFJoint);
YoDouble estimatedTorque = controller.getEstimatedTorqueYoVariable(oneDoFJoint);
YoDouble torqueOffset = controller.getTorqueOffsetVariable(oneDoFJoint);
DataBuffer dataBuffer = simulationConstructionSet.getDataBuffer();
if (appliedTorque != null)
{
double appliedTorqueAverage = dataBuffer.computeAverage(appliedTorque);
double estimatedTorqueAverage = dataBuffer.computeAverage(estimatedTorque);
torqueOffset.add(appliedTorqueAverage - estimatedTorqueAverage);
// System.out.println("appliedTorque variable " + appliedTorque.getName() + " average = " + appliedTorqueAverage);
// System.out.println("estimatedTorque variable " + estimatedTorque.getName() + " average = " + estimatedTorqueAverage);
// System.out.println("Setting " + torqueOffset.getName() + " to " + torqueOffset.getDoubleValue());
}
}
}
代码示例来源:origin: us.ihmc/IHMCWholeBodyController
public void computeTorqueOffsetsBasedOnAverages()
{
for (OneDoFJoint oneDoFJoint : oneDoFJoints)
{
DoubleYoVariable appliedTorque = controller.getAppliedTorqueYoVariable(oneDoFJoint);
DoubleYoVariable estimatedTorque = controller.getEstimatedTorqueYoVariable(oneDoFJoint);
DoubleYoVariable torqueOffset = controller.getTorqueOffsetVariable(oneDoFJoint);
DataBuffer dataBuffer = simulationConstructionSet.getDataBuffer();
if (appliedTorque != null)
{
double appliedTorqueAverage = dataBuffer.computeAverage(appliedTorque);
double estimatedTorqueAverage = dataBuffer.computeAverage(estimatedTorque);
torqueOffset.add(appliedTorqueAverage - estimatedTorqueAverage);
// System.out.println("appliedTorque variable " + appliedTorque.getName() + " average = " + appliedTorqueAverage);
// System.out.println("estimatedTorque variable " + estimatedTorque.getName() + " average = " + estimatedTorqueAverage);
// System.out.println("Setting " + torqueOffset.getName() + " to " + torqueOffset.getDoubleValue());
}
}
}
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces
public void initializeSimulation(SimulationConstructionSet scs)
{
scs.setDT(simulateDT, recordFrequency);
if (drawGroundProfile)
{
scs.addStaticLinkGraphics(createGroundLinkGraphicsFromGroundProfile(groundProfile3D));
}
if (SHOW_WORLD_COORDINATE_FRAME)
{
Graphics3DObject linkGraphics = new Graphics3DObject();
linkGraphics.addCoordinateSystem(0.3);
scs.addStaticLinkGraphics(linkGraphics);
}
/*
* This makes sure that the initial values of all YoVariables that are added to the scs (i.e.
* at index 0 of the data buffer) are properly stored in the data buffer
*/
scs.getDataBuffer().copyValuesThrough();
}
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces-test
double[] desiredICPXData = scs.getDataBuffer().getEntry(desiredICPX).getData();
double[] desiredICPYData = scs.getDataBuffer().getEntry(desiredICPY).getData();
double[] tValues = scs.getDataBuffer().getEntry(t).getData();
double dt = tValues[1] - tValues[0];
代码示例来源:origin: us.ihmc/IHMCAvatarInterfaces
public void initializeSimulation(SimulationConstructionSet scs)
{
scs.setDT(simulateDT, recordFrequency);
if (drawGroundProfile)
{
// boolean drawGroundBelow = false;
// ArrayList<Graphics3DObject> groundLinkGraphics = commonTerrain.createLinkGraphics(drawGroundBelow);
ArrayList<Graphics3DObject> groundLinkGraphics = createGroundLinkGraphicsFromGroundProfile(groundProfile3D);
scs.addStaticLinkGraphics(groundLinkGraphics);
}
if (SHOW_WORLD_COORDINATE_FRAME)
{
Graphics3DObject linkGraphics = new Graphics3DObject();
linkGraphics.addCoordinateSystem(0.3);
scs.addStaticLinkGraphics(linkGraphics);
}
/*
* This makes sure that the initial values of all YoVariables that are added to the scs (i.e. at index 0 of the data buffer)
* are properly stored in the data buffer
*/
scs.getDataBuffer().copyValuesThrough();
}
代码示例来源:origin: us.ihmc/DarpaRoboticsChallenge
public void initializeSimulation(SimulationConstructionSet scs)
{
scs.setDT(simulateDT, recordFrequency);
if (drawGroundProfile)
{
// boolean drawGroundBelow = false;
// ArrayList<Graphics3DObject> groundLinkGraphics = commonTerrain.createLinkGraphics(drawGroundBelow);
ArrayList<Graphics3DObject> groundLinkGraphics = createGroundLinkGraphicsFromGroundProfile(groundProfile3D);
scs.addStaticLinkGraphics(groundLinkGraphics);
}
if (SHOW_WORLD_COORDINATE_FRAME)
{
Graphics3DObject linkGraphics = new Graphics3DObject();
linkGraphics.addCoordinateSystem(0.3);
scs.addStaticLinkGraphics(linkGraphics);
}
/*
* This makes sure that the initial values of all YoVariables that are added to the scs (i.e. at index 0 of the data buffer)
* are properly stored in the data buffer
*/
scs.getDataBuffer().copyValuesThrough();
}
代码示例来源:origin: us.ihmc/acsell
@Override
public void starting(SimulationConstructionSet scs, Robot robot, YoVariableRegistry registry)
{
registry.addChild(sliderBoardRegistry);
final SliderBoardConfigurationManager sliderBoardConfigurationManager = new SliderBoardConfigurationManager(scs);
for (StepprStandPrepSetpoints setpoint : StepprStandPrepSetpoints.values)
{
StandPrepVariables variables = new StandPrepVariables(setpoint, registry);
StepprJoint aJoint = setpoint.getJoints()[0];
sliderBoardConfigurationManager.setKnob(1, selectedJointPair, 0, StepprJoint.values.length);
sliderBoardConfigurationManager.setSlider(1, variables.tau_d, -100.0, 100.0);
sliderBoardConfigurationManager.setSlider(3, variables.damping, 0, 5 * aJoint.getRatio() * aJoint.getRatio());
sliderBoardConfigurationManager.saveConfiguration(setpoint.toString());
allSetpoints.put(setpoint, variables);
}
selectedJointPair.addVariableChangedListener(new VariableChangedListener()
{
@Override
public void notifyOfVariableChange(YoVariable<?> v)
{
sliderBoardConfigurationManager.loadConfiguration(selectedJointPair.getEnumValue().toString());
}
});
selectedJointPair.set(StepprStandPrepSetpoints.HIP_Y);
StepprDashboard.createDashboard(scs, registry);
scs.getDataBuffer().attachIndexChangedListener(this);
}
代码示例来源:origin: us.ihmc/simulation-construction-set-tools
GUISideCommandListener robotCommandListener = new GUISideCommandListener(scs.getDataBuffer(), scs.getRootRegistry(), guiUpdater, guiUpdater);
RobotSocketConnection robotSocketConnection = new RobotSocketConnection(host, robotCommandListener, scs.getRootRegistry(), newDataListeners);
代码示例来源:origin: us.ihmc/simulation-construction-set-test
DataBuffer dataBuffer = scs.getDataBuffer();
内容来源于网络,如有侵权,请联系作者删除!