本文整理了Java中us.ihmc.simulationconstructionset.SimulationConstructionSet.getRootRegistry()
方法的一些代码示例,展示了SimulationConstructionSet.getRootRegistry()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SimulationConstructionSet.getRootRegistry()
方法的具体详情如下:
包路径:us.ihmc.simulationconstructionset.SimulationConstructionSet
类名称:SimulationConstructionSet
方法名:getRootRegistry
暂无
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces-test
public YoVariableRegistry getYoVariableRegistry()
{
return scs.getRootRegistry();
}
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces-test
public void addChildRegistry(YoVariableRegistry childRegistry)
{
scs.getRootRegistry().addChild(childRegistry);
}
代码示例来源:origin: us.ihmc/simulation-construction-set-test
private YoDouble[] addDoubleYoVariablesInSCSRegistry(String[] varNames, double[] varValues, SimulationConstructionSet scs)
{
YoDouble[] yoDoubles = null;
if (varNames.length == varValues.length)
{
YoVariableRegistry scsRegistry = scs.getRootRegistry();
yoDoubles = createAndSetDoubleYoVariableToRegistry(varNames, varValues, scsRegistry);
}
else
{
System.out.print("Input arrays have different length.");
}
return yoDoubles;
}
代码示例来源:origin: us.ihmc/ihmc-robot-data-visualizer
private void printOutYoVariableNames()
{
YoVariableRegistry rootRegistry = scs.getRootRegistry();
ArrayList<YoVariable<?>> allVariablesIncludingDescendants = rootRegistry.getAllVariablesIncludingDescendants();
for (YoVariable<?> yoVariable : allVariablesIncludingDescendants)
{
System.out.println(yoVariable.getName());
}
}
代码示例来源:origin: us.ihmc/IHMCRobotDataVisualizer
private void printOutYoVariableNames()
{
YoVariableRegistry rootRegistry = scs.getRootRegistry();
ArrayList<YoVariable<?>> allVariablesIncludingDescendants = rootRegistry.getAllVariablesIncludingDescendants();
for (YoVariable<?> yoVariable : allVariablesIncludingDescendants)
{
System.out.println(yoVariable.getName());
}
}
代码示例来源:origin: us.ihmc/RobotDataCommunication
private void printOutYoVariableNames()
{
YoVariableRegistry rootRegistry = scs.getRootRegistry();
ArrayList<YoVariable<?>> allVariablesIncludingDescendants = rootRegistry.getAllVariablesIncludingDescendants();
for (YoVariable<?> yoVariable : allVariablesIncludingDescendants)
{
System.out.println(yoVariable.getName());
}
}
代码示例来源:origin: us.ihmc/IHMCRobotDataVisualizer
public void addLogPlaybackListener(YoVariableLogPlaybackListener listener)
{
listener.setYoVariableRegistry(scs.getRootRegistry());
robot.addLogPlaybackListener(listener);
}
代码示例来源:origin: us.ihmc/simulation-construction-set-test
private void assertSCSContainsTheVariables(SimulationConstructionSet scs, String[] variablesNames)
{
YoVariableRegistry registry = scs.getRootRegistry();
String[] variableNamesFromSCS = getAllVariableNamesFromRegistry(registry);
assertArrayOfStringsContainsTheStrings(variableNamesFromSCS, variablesNames);
}
代码示例来源:origin: us.ihmc/RobotDataCommunication
public void addLogPlaybackListener(YoVariableLogPlaybackListener listener)
{
listener.setYoVariableRegistry(scs.getRootRegistry());
robot.addLogPlaybackListener(listener);
}
代码示例来源:origin: us.ihmc/ihmc-robot-data-visualizer
public void addLogPlaybackListener(YoVariableLogPlaybackListener listener)
{
listener.setYoVariableRegistry(scs.getRootRegistry());
robot.addLogPlaybackListener(listener);
}
代码示例来源:origin: us.ihmc/ihmc-humanoid-behaviors
public void startOnAThread(int port)
{
final SimulationConstructionSet scs = new SimulationConstructionSet(new Robot("NullRobotMachineSide"));
YoVariableRegistry rootRegistry = scs.getRootRegistry();
rootRegistry.addChild(coactiveElement.getMachineWritableYoVariableRegistry());
rootRegistry.addChild(coactiveElement.getUserInterfaceWritableYoVariableRegistry());
scs.startOnAThread();
coactiveElement.initializeMachineSide();
CoactiveElementYoWhiteBoardSynchronizer machineSideSynchronizer = new CoactiveElementYoWhiteBoardSynchronizer(port, HumanOrMachine.MACHINE, coactiveElement);
final long millisecondsBetweenDataWrites = 300L;
machineSideSynchronizer.startASynchronizerOnAThread(millisecondsBetweenDataWrites);
Runnable runnable = new Runnable()
{
@Override
public void run()
{
while (true)
{
coactiveElement.updateMachineSide();
scs.tickAndUpdate();
sleep(millisecondsBetweenDataWrites);
}
}
};
Thread thread = new Thread(runnable);
thread.start();
}
代码示例来源:origin: us.ihmc/DarpaRoboticsChallenge
public static void main(String argv[]) throws FileNotFoundException, JAXBException, MalformedURLException
{
Robot robot = new Robot("robot");
SimulationConstructionSet scs = new SimulationConstructionSet(robot);
DRCVehicleSDFLoader drcVehicleSDFLoader = new DRCVehicleSDFLoader();
scs.addStaticLinkGraphics(drcVehicleSDFLoader.loadDRCVehicle(false));
RigidBodyTransform vehicleToWorldTransform = new RigidBodyTransform();
ReferenceFrame vehicleFrame = ReferenceFrame.constructFrameWithUnchangingTransformToParent("vehicle", ReferenceFrame.getWorldFrame(),
vehicleToWorldTransform, false, true, true);
VehicleModelObjects vehicleModelObjects = new VehicleModelObjects();
YoGraphicsListRegistry yoGraphicsListRegistry = new YoGraphicsListRegistry();
YoVariableRegistry registry = scs.getRootRegistry();
VehicleModelObjectVisualizer vehicleModelObjectVisualizer = new VehicleModelObjectVisualizer(vehicleFrame, vehicleModelObjects, yoGraphicsListRegistry, registry);
vehicleModelObjectVisualizer.setVisible(true);
vehicleModelObjectVisualizer.update();
scs.addYoGraphicsListRegistry(yoGraphicsListRegistry);
Thread thread = new Thread(scs);
thread.start();
}
代码示例来源:origin: us.ihmc/DarpaRoboticsChallenge
public static void visualizeFootsteps(Robot nullRobot, List<Footstep> footsteps, List<ContactablePlaneBody> contactablePlaneBodies)
{
SimulationConstructionSet scs = new SimulationConstructionSet(nullRobot);
scs.setDT(0.25, 1);
YoVariableRegistry rootRegistry = scs.getRootRegistry();
YoGraphicsListRegistry yoGraphicsListRegistry = new YoGraphicsListRegistry();
int maxNumberOfContacts = 2;
int maxPointsPerContact = 4;
FootstepGeneratorVisualizer footstepGeneratorVisualizer = new FootstepGeneratorVisualizer(maxNumberOfContacts, maxPointsPerContact, rootRegistry,
yoGraphicsListRegistry);
scs.addYoGraphicsListRegistry(yoGraphicsListRegistry);
footstepGeneratorVisualizer.addFootstepsAndTickAndUpdate(scs, footsteps, contactablePlaneBodies);
scs.startOnAThread();
deleteFirstDataPointAndCropData(scs);
}
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces
public static void main(String argv[]) throws FileNotFoundException, JAXBException, MalformedURLException
{
Robot robot = new Robot("robot");
SimulationConstructionSet scs = new SimulationConstructionSet(robot);
DRCVehicleSDFLoader drcVehicleSDFLoader = new DRCVehicleSDFLoader();
scs.addStaticLinkGraphics(drcVehicleSDFLoader.loadDRCVehicle(false));
RigidBodyTransform vehicleToWorldTransform = new RigidBodyTransform();
ReferenceFrame vehicleFrame = ReferenceFrame.constructFrameWithUnchangingTransformToParent("vehicle", ReferenceFrame.getWorldFrame(),
vehicleToWorldTransform);
VehicleModelObjects vehicleModelObjects = new VehicleModelObjects();
YoGraphicsListRegistry yoGraphicsListRegistry = new YoGraphicsListRegistry();
YoVariableRegistry registry = scs.getRootRegistry();
VehicleModelObjectVisualizer vehicleModelObjectVisualizer = new VehicleModelObjectVisualizer(vehicleFrame, vehicleModelObjects, yoGraphicsListRegistry, registry);
vehicleModelObjectVisualizer.setVisible(true);
vehicleModelObjectVisualizer.update();
scs.addYoGraphicsListRegistry(yoGraphicsListRegistry);
Thread thread = new Thread(scs);
thread.start();
}
代码示例来源:origin: us.ihmc/valkyrie
public ValkyrieDataFileNamespaceRenamer()
{
SimulationConstructionSet scs = new SimulationConstructionSet(new Robot("null"));
YoVariableRegistry rootRegistry = scs.getRootRegistry();
NameSpaceRenamer valkyrieNameSpaceRenamer = new ValkyrieNameSpaceRenamer();
ChangeNamespacesToMatchSimButton changeNamespacesToMatchSimButton = new ChangeNamespacesToMatchSimButton("ChangeValkyrieNamespaces", rootRegistry, valkyrieNameSpaceRenamer);
scs.addButton(changeNamespacesToMatchSimButton);
NameSpaceRenamer stepprNameSpaceRenamer = new StepprNameSpaceRenamer();
ChangeNamespacesToMatchSimButton changeStepprNamespacesToMatchSimButton = new ChangeNamespacesToMatchSimButton("ChangeStepprNamespaces", rootRegistry, stepprNameSpaceRenamer);
scs.addButton(changeStepprNamespacesToMatchSimButton);
scs.startOnAThread();
}
代码示例来源:origin: us.ihmc/IHMCAvatarInterfaces
public static void main(String argv[]) throws FileNotFoundException, JAXBException, MalformedURLException
{
Robot robot = new Robot("robot");
SimulationConstructionSet scs = new SimulationConstructionSet(robot);
DRCVehicleSDFLoader drcVehicleSDFLoader = new DRCVehicleSDFLoader();
scs.addStaticLinkGraphics(drcVehicleSDFLoader.loadDRCVehicle(false));
RigidBodyTransform vehicleToWorldTransform = new RigidBodyTransform();
ReferenceFrame vehicleFrame = ReferenceFrame.constructFrameWithUnchangingTransformToParent("vehicle", ReferenceFrame.getWorldFrame(),
vehicleToWorldTransform, false, true, true);
VehicleModelObjects vehicleModelObjects = new VehicleModelObjects();
YoGraphicsListRegistry yoGraphicsListRegistry = new YoGraphicsListRegistry();
YoVariableRegistry registry = scs.getRootRegistry();
VehicleModelObjectVisualizer vehicleModelObjectVisualizer = new VehicleModelObjectVisualizer(vehicleFrame, vehicleModelObjects, yoGraphicsListRegistry, registry);
vehicleModelObjectVisualizer.setVisible(true);
vehicleModelObjectVisualizer.update();
scs.addYoGraphicsListRegistry(yoGraphicsListRegistry);
Thread thread = new Thread(scs);
thread.start();
}
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces
private void initializeCollisionManager()
{
if (useShapeCollision)
{
double coefficientOfRestitution = 0.0;
double coefficientOfFriction = 0.9;
HybridImpulseSpringDamperCollisionHandler collisionHandler = new HybridImpulseSpringDamperCollisionHandler(coefficientOfRestitution,
coefficientOfFriction,
simulationConstructionSet.getRootRegistry(),
new YoGraphicsListRegistry());
collisionHandler.setKp(100000);
collisionHandler.setKd(500);
CollisionManager collisionManager = new CollisionManager(commonAvatarEnvironment.get().getTerrainObject3D(), collisionHandler);
simulationConstructionSet.initializeShapeCollision(collisionManager);
}
}
代码示例来源:origin: us.ihmc/simulation-construction-set-tools-test
scs1.getRootRegistry().addChild(rootRegistry1);
scs2.getRootRegistry().addChild(rootRegistry2);
代码示例来源:origin: us.ihmc/simulation-construction-set-tools-test
@ContinuousIntegrationTest(estimatedDuration = 0.4)
@Test(timeout = 30000)
public void testWithHighEpsilon()
{
AllYoVariablesSimulationComparer comparerWithLargeEpsilon = new AllYoVariablesSimulationComparer(5.0);
SimulationConstructionSetParameters parameters = new SimulationConstructionSetParameters();
parameters.setCreateGUI(false);
SimulationConstructionSet scs1 = new SimulationConstructionSet(robot1, parameters);
SimulationConstructionSet scs2 = new SimulationConstructionSet(robot2, parameters);
scs1.getRootRegistry().addChild(rootRegistry1);
scs2.getRootRegistry().addChild(rootRegistry2);
yoDouble1.set(98.56);
yoDouble2.set(97.01);
yoDouble3.set(94.98);
yoDouble4.set(92.02);
assertFalse(comparerWithLargeEpsilon.compare(scs1, scs2));
comparerWithLargeEpsilon.addException("yoDoubleA12");
comparerWithLargeEpsilon.addException("Ignore");
assertTrue(comparerWithLargeEpsilon.compare(scs1, scs2));
yoDouble1.set(97.02);
yoDouble2.set(95.01);
yoDouble3.set(9);
yoDouble4.set(92.02);
assertFalse(comparerWithLargeEpsilon.compare(scs1, scs2));
}
}
代码示例来源:origin: us.ihmc/simulation-construction-set-test
scs.startOnAThread();
YoVariableRegistry rootRegistry = scs.getRootRegistry();
DataBuffer dataBuffer = scs.getDataBuffer();
内容来源于网络,如有侵权,请联系作者删除!