本文整理了Java中us.ihmc.simulationconstructionset.SimulationConstructionSet.getRobots()
方法的一些代码示例,展示了SimulationConstructionSet.getRobots()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SimulationConstructionSet.getRobots()
方法的具体详情如下:
包路径:us.ihmc.simulationconstructionset.SimulationConstructionSet
类名称:SimulationConstructionSet
方法名:getRobots
暂无
代码示例来源:origin: us.ihmc/simulation-construction-set-test
private boolean scsContainsTheRobot(SimulationConstructionSet scs, String robotName)
{
Robot[] robots = scs.getRobots();
boolean ret = false;
for (int i = 0; i < robots.length; i++)
{
ret = ret || robots[i].getName().equals(robotName);
}
return ret;
}
代码示例来源:origin: us.ihmc/simulation-construction-set-tools-test
private boolean didSimulationsGetToEndTime(double simulationTime, ArrayList<SimulationConstructionSet> simulationConstructionSets)
{
double endTime0 = simulationConstructionSets.get(0).getRobots()[0].getTime();
double endTime1 = simulationConstructionSets.get(0).getRobots()[0].getTime();
double errorTime0 = Math.abs(simulationTime - endTime0);
double errorTime1 = Math.abs(simulationTime - endTime1);
// System.out.println("errorTime0 = " + errorTime0);
// System.out.println("errorTime1 = " + errorTime1);
if (errorTime0 > 1e-3) return false;
if (errorTime1 > 1e-3) return false;
return true;
}
代码示例来源:origin: us.ihmc/simulation-construction-set-tools-test
private FloatingJoint getRootJoint(SimulationConstructionSet scs0)
{
Joint firstRootJoint = scs0.getRobots()[0].getRootJoints().get(0);
if (firstRootJoint instanceof FloatingJoint)
return (FloatingJoint) firstRootJoint;
throw new RuntimeException("first root joint is not a floating joint: " + firstRootJoint);
}
代码示例来源: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/simulation-construction-set-test
private double getExpectedFinalTime(SimulationConstructionSet scs)
{
double initialTime = scs.getRobots()[0].getTime();
double recordFreq = scs.getRecordFreq();
double DT = scs.getDT();
return initialTime + recordFreq * DT;
}
代码示例来源:origin: us.ihmc/IHMCSimulationToolkit
public FullRobotModelVisualizer(SimulationConstructionSet scs, FullRobotModel fullRobotModel, double updateDT)
{
this.fullRobot = fullRobotModel;
this.scs = scs;
this.robot = (FloatingRootJointRobot) scs.getRobots()[0];
this.name = robot.getName() + "Simulated";
this.updateDT = updateDT;
this.robotRegistry = robot.getRobotsYoVariableRegistry();
this.setMainRegistry(robotRegistry, fullRobotModel, null);
}
代码示例来源:origin: us.ihmc/ihmc-simulation-toolkit
public FullRobotModelVisualizer(SimulationConstructionSet scs, FullRobotModel fullRobotModel, double updateDT)
{
fullRobot = fullRobotModel;
this.scs = scs;
robot = (FloatingRootJointRobot) scs.getRobots()[0];
name = robot.getName() + "Simulated";
this.updateDT = updateDT;
robotRegistry = robot.getRobotsYoVariableRegistry();
rootJoint = fullRobotModel.getRootJoint();
revoluteJoints.clear();
OneDoFJointBasics[] revoluteJointsArray = fullRobotModel.getOneDoFJoints();
for (OneDoFJointBasics revoluteJoint : revoluteJointsArray)
{
String name = revoluteJoint.getName();
OneDegreeOfFreedomJoint oneDoFJoint = robot.getOneDegreeOfFreedomJoint(name);
ImmutablePair<OneDegreeOfFreedomJoint,OneDoFJointBasics> jointPair = new ImmutablePair<OneDegreeOfFreedomJoint, OneDoFJointBasics>(oneDoFJoint, revoluteJoint);
revoluteJoints.add(jointPair);
}
setMainRegistry(robotRegistry, null, null);
}
代码示例来源:origin: us.ihmc/simulation-construction-set-tools-test
BlockingSimulationRunner.waitForSimulationToFinish(scss.get(0), maximumClockRunTimeInSeconds, true);
assertEquals("indices not the same", scss.get(0).getIndex(), scss.get(1).getIndex());
assertEquals("times not the same", scss.get(0).getRobots()[0].getTime(), scss.get(1).getRobots()[0].getTime(), epsilon);
boolean result = comparer.compare(scss.get(0), scss.get(1));
代码示例来源:origin: us.ihmc/simulation-construction-set-tools-test
Robot robotToUseForTime = simulationConstructionSets.get(0).getRobots()[0];
double time = robotToUseForTime.getTime();
while (!differenceFound && (time < maxSimulationTime))
代码示例来源:origin: us.ihmc/simulation-construction-set-tools-test
public void concludeTesting(int additionalStackDepthForRelevantCallingMethod)
{
if (simulationTestingParameters.getKeepSCSUp())
{
ThreadTools.sleepForever();
}
if (simulationTestingParameters.getCreateSCSVideos())
{
BambooTools.createVideoWithDateTimeClassMethodAndShareOnSharedDriveIfAvailable(scs.getRobots()[0].getName(), scs, additionalStackDepthForRelevantCallingMethod + 1);
}
ThreadTools.sleep(200);
scs.closeAndDispose();
}
代码示例来源:origin: us.ihmc/simulation-construction-set-test
assertEquals(numberOfTicksBeforeUpdatingGraphs2, numberOfTicksBeforeUpdatingGraphsFromSCS2);
double initialTime = scs.getRobots()[0].getTime();
double DT = scs.getDT();
callSCSMethodSimulateOneTimeStep(scs);
double finalTime = scs.getRobots()[0].getTime();
assertEquals(initialTime + DT, finalTime, epsilon);
double finalTime2 = scs.getRobots()[0].getTime();
assertEquals(expectedFinalTime2, finalTime2, epsilon);
double finalTime3 = scs.getRobots()[0].getTime();
assertEquals(expectedFinalTime3, finalTime3, epsilon);
代码示例来源:origin: us.ihmc/simulation-construction-set-test
Robot[] robotFromSCS = scs.getRobots();
assertEquals(simpleRobot, robotFromSCS[0]);
代码示例来源:origin: us.ihmc/ihmc-footstep-planning-test
YoVariableRegistry robotsYoVariableRegistry = scs.getRobots()[0].getRobotsYoVariableRegistry();
PlanarRegionsListDefinedEnvironment environment = new PlanarRegionsListDefinedEnvironment("ExamplePlanarRegionsListEnvironment", planarRegionsList, 1e-5,
generateGroundPlane);
内容来源于网络,如有侵权,请联系作者删除!