本文整理了Java中us.ihmc.simulationconstructionset.SimulationConstructionSet.simulate()
方法的一些代码示例,展示了SimulationConstructionSet.simulate()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SimulationConstructionSet.simulate()
方法的具体详情如下:
包路径:us.ihmc.simulationconstructionset.SimulationConstructionSet
类名称:SimulationConstructionSet
方法名:simulate
暂无
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces
public void simulate()
{
simulationConstructionSet.simulate();
}
代码示例来源:origin: us.ihmc/simulation-construction-set-tools-test
private void simulate(ArrayList<SimulationConstructionSet> simulationConstructionSets, double simulationTime)
{
for (SimulationConstructionSet scs : simulationConstructionSets)
{
scs.simulate(simulationTime);
}
}
代码示例来源:origin: us.ihmc/DarpaRoboticsChallenge
public void simulate()
{
scs.simulate();
}
代码示例来源:origin: us.ihmc/IHMCAvatarInterfaces
public void simulate()
{
simulationConstructionSet.simulate();
}
代码示例来源:origin: us.ihmc/simulation-construction-set-tools-test
public static SimulationConstructionSet runNumberOfTicks(SimulationConstructionSet scs, int nTicks)
{
scs.simulate(nTicks);
waitForSimulationToFinish(scs);
// System.out.println("Simulation run for " + nTicks + " ticks");
return scs;
}
代码示例来源:origin: us.ihmc/simulation-construction-set-tools-test
@Override
public void doInitialAction(SimulationConstructionSet scs0, SimulationConstructionSet scs1)
{
SimulationConstructionSet[] scss = {scs0, scs1};
for (SimulationConstructionSet scs : scss)
{
scs.simulate(nTicksInitial);
}
for (SimulationConstructionSet scs : scss)
{
waitForSimulationToFinish(scs);
}
}
代码示例来源:origin: us.ihmc/simulation-construction-set-test
private void simulateForTime(SimulationConstructionSet scs, double simulateTime)
{
scs.simulate(simulateTime);
while (scs.isSimulating())
{
ThreadTools.sleep(100L);
}
}
代码示例来源:origin: us.ihmc/simulation-construction-set-tools-test
@Override
public void doFinalAction(SimulationConstructionSet scs0, SimulationConstructionSet scs1)
{
SimulationConstructionSet[] scss = {scs0, scs1};
for (SimulationConstructionSet scs : scss)
{
scs.setInPoint();
scs.simulate(nTicksCompare);
}
for (SimulationConstructionSet scs : scss)
{
waitForSimulationToFinish(scs);
}
File stateFile = new File("stateFile");
scs0.writeState(stateFile);
scs0.gotoInPointNow();
scs0.simulate(1);
scs0.writeState(stateFile);
stateFile.delete();
for (SimulationConstructionSet scs : scss)
{
scs.simulate(nTicksFinal);
}
for (SimulationConstructionSet scs : scss)
{
waitForSimulationToFinish(scs);
}
}
代码示例来源:origin: us.ihmc/simulation-construction-set-tools-test
@Override
public void doInitialAction(SimulationConstructionSet scs0, SimulationConstructionSet scs1)
{
if (scs0.getRecordFreq() != scs1.getRecordFreq())
{
throw new RuntimeException("scs0.getRecordFreq() != scs1.getRecordFreq()");
}
if (nTicksInitial % scs0.getRecordFreq() != 0)
{
throw new RuntimeException("nTicksInitial must be divisible by record frequency!");
}
SimulationConstructionSet[] scss = {scs0, scs1};
for (SimulationConstructionSet scs : scss)
{
scs.simulate(nTicksInitial);
}
for (SimulationConstructionSet scs : scss)
{
waitForSimulationToFinish(scs);
}
}
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces-test
public void simulateAndBlock(int simulationTicks) throws SimulationExceededMaximumTimeException, ControllerFailureException
{
double startTime = scs.getTime();
scs.simulate(simulationTicks);
BlockingSimulationRunner.waitForSimulationToFinish(scs, 600, true);
if (hasControllerFailed.get())
{
throw new ControllerFailureException("Controller failure has been detected.");
}
double endTime = scs.getTime();
double elapsedTime = endTime - startTime;
if (Math.abs(elapsedTime - scs.getDT() * simulationTicks) > 0.01)
{
throw new SimulationExceededMaximumTimeException("Elapsed time didn't equal requested. Sim probably crashed");
}
}
代码示例来源:origin: us.ihmc/simulation-construction-set-tools-test
scs.simulate();
代码示例来源:origin: us.ihmc/simulation-construction-set-tools-test
scs0.simulate(nTicksCompare);
waitForSimulationToFinish(scs0);
scs.simulate(nTicksFinal);
waitForSimulationToFinish(scs);
代码示例来源:origin: us.ihmc/simulation-construction-set-test
scs.simulate(2.0);
代码示例来源:origin: us.ihmc/simulation-construction-set-tools-test
public static void testRewindabilityNumberOfTicks(SimulationConstructionSet scs, int nTicks, List<String> namesToSkipOver)
throws SimulationExceededMaximumTimeException
{
// create state files
int nStateFiles = 2;
ArrayList<File> stateFiles = createStateFiles(nStateFiles);
// System.out.println("Simulation created");
// run, write state file, rewind, repeat
for (int i = 0; i < nStateFiles; i++)
{
scs.simulate(nTicks);
BlockingSimulationRunner.waitForSimulationToFinish(scs, 120.0, true);
scs.writeState(stateFiles.get(i));
// System.out.println("Run " + i + " done.");
scs.gotoInPointNow();
assertEquals(scs.getIndex(), 0);
}
compare(stateFiles, scs, namesToSkipOver);
}
代码示例来源:origin: us.ihmc/simulation-construction-set-tools-test
/**
* Simple rewindability test.
* run, write state file, rewind, run, write state file.
* @throws SimulationExceededMaximumTimeException
*/
public static void testRewindabilitySimple(SimulationConstructionSet scs, double simulationTime, ArrayList<String> namesToSkipOver)
throws SimulationExceededMaximumTimeException
{
// create state files
int nStateFiles = 2;
ArrayList<File> stateFiles = createStateFiles(nStateFiles);
// System.out.println("Simulation created");
// run, write state file, rewind, repeat
for (int i = 0; i < nStateFiles; i++)
{
scs.simulate(simulationTime);
BlockingSimulationRunner.waitForSimulationToFinish(scs, 120.0, true);
scs.writeState(stateFiles.get(i));
// System.out.println("Run " + i + " done.");
scs.gotoInPointNow();
assertEquals(scs.getIndex(), 0);
}
// compare
compare(stateFiles, scs, namesToSkipOver);
}
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces-test
public void runPelvisCorrectionControllerOutOfTheLoop() throws SimulationExceededMaximumTimeException
{
setupSimulationWithStandingControllerAndCreateExternalPelvisThread();
setupYoVariables(registry, "PelvisPoseHistoryCorrection");
setPelvisPoseHistoryCorrectorAlphaBreakFreq(registry, 0.015, 0.015);
maxTranslationVelocityClip.set(1.0);
maxRotationVelocityClip.set(1.0);
activatePelvisPoseHistoryCorrector(registry, true);
simulationConstructionSet.simulate();
while (simulationConstructionSet.isSimulationThreadRunning())
{
ThreadTools.sleep(100);
}
}
代码示例来源:origin: us.ihmc/simulation-construction-set-tools-test
@ContinuousIntegrationTest(estimatedDuration = 7.2)
@Test(timeout = 36000)
public void test()
{
TwoLinkRobotForTesting twoLinkRobotForTesting = new TwoLinkRobotForTesting();
SimulationConstructionSet scs = new SimulationConstructionSet(twoLinkRobotForTesting, simulationTestingParameters);
scs.setDT(0.00001, 100);
scs.startOnAThread();
twoLinkRobotForTesting.setElbowPosition(0.0);
twoLinkRobotForTesting.setUpperPosition(3.0);
twoLinkRobotForTesting.setElbowVelocity(-2.0);
twoLinkRobotForTesting.setUpperVelocity(-3.0);
scs.simulate(6.0);
while(scs.isSimulating())
{
Thread.yield();
}
RobotAllJointsDataChecker robotAllJointsDataChecker = new RobotAllJointsDataChecker(scs, twoLinkRobotForTesting);
robotAllJointsDataChecker.cropFirstPoint();
scs.applyDataProcessingFunction(robotAllJointsDataChecker);
}
代码示例来源:origin: us.ihmc/robot-environment-awareness-application
public void startSimulation() throws IOException
{
SimpleLidarRobot robot = new SimpleLidarRobot();
SimulationConstructionSetParameters parameters = new SimulationConstructionSetParameters(true, RealtimeTools.nextPowerOfTwo(200000));
SimulationConstructionSet scs = new SimulationConstructionSet(robot, parameters);
double simDT = 0.0001;
double controlDT = 0.01;
scs.setDT(simDT, 10);
scs.setSimulateDoneCriterion(() -> false);
Graphics3DAdapter graphics3dAdapter = scs.getGraphics3dAdapter();
YoGraphicsListRegistry yoGraphicsListRegistry = new YoGraphicsListRegistry();
SimpleLidarRobotController controller = new SimpleLidarRobotController(robot, controlDT, ros2Node, graphics3dAdapter,
yoGraphicsListRegistry);
robot.setController(controller, (int) (controlDT / simDT));
scs.addYoGraphicsListRegistry(yoGraphicsListRegistry);
createGroundTypeListener(scs);
scs.setGroundVisible(false);
scs.startOnAThread();
scs.simulate();
}
代码示例来源:origin: us.ihmc/IHMCSimulationToolkit
scs.setDT(simulateDT, recordFrequency);
scs.startOnAThread();
scs.simulate();
代码示例来源:origin: us.ihmc/simulation-construction-set-test
scs.simulate(Double.MAX_VALUE);
boolean isSCSSimulatingBeforeCriterion = scs.isSimulating();
setSimulationDoneCriterion.set(true);
内容来源于网络,如有侵权,请联系作者删除!