public YoVariableRegistry getYoVariableRegistry() { return scs.getRootRegistry(); }
public void addChildRegistry(YoVariableRegistry childRegistry) { scs.getRootRegistry().addChild(childRegistry); }
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; }
private void printOutYoVariableNames() { YoVariableRegistry rootRegistry = scs.getRootRegistry(); ArrayList<YoVariable<?>> allVariablesIncludingDescendants = rootRegistry.getAllVariablesIncludingDescendants(); for (YoVariable<?> yoVariable : allVariablesIncludingDescendants) { System.out.println(yoVariable.getName()); } }
private void printOutYoVariableNames() { YoVariableRegistry rootRegistry = scs.getRootRegistry(); ArrayList<YoVariable<?>> allVariablesIncludingDescendants = rootRegistry.getAllVariablesIncludingDescendants(); for (YoVariable<?> yoVariable : allVariablesIncludingDescendants) { System.out.println(yoVariable.getName()); } }
private void printOutYoVariableNames() { YoVariableRegistry rootRegistry = scs.getRootRegistry(); ArrayList<YoVariable<?>> allVariablesIncludingDescendants = rootRegistry.getAllVariablesIncludingDescendants(); for (YoVariable<?> yoVariable : allVariablesIncludingDescendants) { System.out.println(yoVariable.getName()); } }
public void addLogPlaybackListener(YoVariableLogPlaybackListener listener) { listener.setYoVariableRegistry(scs.getRootRegistry()); robot.addLogPlaybackListener(listener); }
private void assertSCSContainsTheVariables(SimulationConstructionSet scs, String[] variablesNames) { YoVariableRegistry registry = scs.getRootRegistry(); String[] variableNamesFromSCS = getAllVariableNamesFromRegistry(registry); assertArrayOfStringsContainsTheStrings(variableNamesFromSCS, variablesNames); }
public void addLogPlaybackListener(YoVariableLogPlaybackListener listener) { listener.setYoVariableRegistry(scs.getRootRegistry()); robot.addLogPlaybackListener(listener); }
public void addLogPlaybackListener(YoVariableLogPlaybackListener listener) { listener.setYoVariableRegistry(scs.getRootRegistry()); robot.addLogPlaybackListener(listener); }
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(); }
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(); }
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); }
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(); }
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(); }
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(); }
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); } }
scs1.getRootRegistry().addChild(rootRegistry1); scs2.getRootRegistry().addChild(rootRegistry2);
@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)); } }
scs.startOnAThread(); YoVariableRegistry rootRegistry = scs.getRootRegistry(); DataBuffer dataBuffer = scs.getDataBuffer();