public static void main(String argv[]) throws FileNotFoundException, JAXBException, MalformedURLException { // JaxbSDFLoader loader = new JaxbSDFLoader(new File("Models/unitBox.sdf"), "Models/"); // Robot robot = loader.createRobot("unit_box_1"); SDFWorldLoader loader = new SDFWorldLoader(new File("Models/unitBox.sdf"), "Models/"); SimulationConstructionSet scs = new SimulationConstructionSet(); scs.addStaticLinkGraphics(loader.createGraphics3dObject()); Thread thread = new Thread(scs); thread.start(); } }
public WholeBodyVisualizier(DRCRobotModel robotModel) { //model = AtlasRobotModelFactory.selectSimulationModelFromFlag(args); FloatingRootJointRobot simulatedRobot = robotModel.createHumanoidFloatingRootJointRobot(false); scs = new SimulationConstructionSet(simulatedRobot); scs.startOnAThread(); } }
@Test// timeout = 30000 public void testSimulationConstructionSetWithoutARobot() { SimulationConstructionSet scs = new SimulationConstructionSet(parameters); Thread thread = new Thread(scs); thread.start(); sleep(pauseTimeForGUIs); scs.closeAndDispose(); }
private SimulationConstructionSet createNewSCSWithEmptyRobot(String robotName) { return new SimulationConstructionSet(new Robot(robotName), parameters); }
@Test// timeout = 30000 public void testSimulationConstructionSetWithARobot() { Robot robot = new Robot("NullRobot"); SimulationConstructionSet scs = new SimulationConstructionSet(robot, parameters); Thread thread = new Thread(scs); thread.start(); sleep(pauseTimeForGUIs); scs.closeAndDispose(); }
private SimulationConstructionSet createSimulation() { SimulationConstructionSetParameters parameters = new SimulationConstructionSetParameters(); parameters.setCreateGUI(false); return new SimulationConstructionSet(createRobot(), parameters); }
private void setupSim() { SimulationConstructionSetParameters parameters = new SimulationConstructionSetParameters(); parameters.setCreateGUI(simulationTestingParameters.getCreateGUI()); simulationConstructionSet = new SimulationConstructionSet(robot, parameters); simulationConstructionSet.setDT(0.001, 1); bsr = new BlockingSimulationRunner(simulationConstructionSet, 60.0 * 10.0); Thread simThread = new Thread(simulationConstructionSet); simThread.start(); }
private void setupSCS() { SimulationTestingParameters simulationTestingParameters = SimulationTestingParameters.createFromSystemProperties(); simulationTestingParameters.setKeepSCSUp(visualize); Robot robot = new Robot("Dummy"); yoTime = robot.getYoTime(); scs = new SimulationConstructionSet(robot, simulationTestingParameters); }
public static void main(String[] args) { SimulationConstructionSet scs = new SimulationConstructionSet(); scs.setGroundVisible(false); scs.addStaticLinkGraphics(new CinderBlockFieldPlanarRegionEnvironment().getTerrainObject3D().getLinkGraphics()); scs.startOnAThread(); }
public void startSimulation() { SimulationConstructionSetParameters simulationParameters = new SimulationConstructionSetParameters(true, 16000); SimulationConstructionSet scs = new SimulationConstructionSet(simulatedRobot, simulationParameters); scs.setDT(robotModel.getSimulateDT(), 10); scs.setCameraPosition(scsCameraPosition.x, scsCameraPosition.y, scsCameraPosition.z); scs.setCameraFix(scsCameraFix.x, scsCameraFix.y, scsCameraFix.z); scs.startOnAThread(); }
public void startSimulation() { SimulationConstructionSetParameters simulationParameters = new SimulationConstructionSetParameters(true, 16000); SimulationConstructionSet scs = new SimulationConstructionSet(simulatedRobot, simulationParameters); scs.setDT(robotModel.getSimulateDT(), 10); scs.setCameraPosition(scsCameraPosition.x, scsCameraPosition.y, scsCameraPosition.z); scs.setCameraFix(scsCameraFix.x, scsCameraFix.y, scsCameraFix.z); scs.startOnAThread(); }
private void startSimAndDisplayLink(Link linkToDisplay) { // Robot nullRobot = new Robot("Null"); sim = new SimulationConstructionSet(parameters); sim.addStaticLink(linkToDisplay); // position the camera to view links sim.setCameraPosition(6.0, 6.0, 3.0); sim.setCameraFix(0.5, 0.5, 0.0); sim.setGroundVisible(false); sim.startOnAThread(); ThreadTools.sleep(3000); sim.closeAndDispose(); }
public static void main(String[] args) { SimulationConstructionSet scs = new SimulationConstructionSet(new Robot("robot")); scs.addStaticLinkGraphics(new TwoBollardEnvironment(0.75).getTerrainObject3D().getLinkGraphics()); scs.setGroundVisible(false); scs.startOnAThread(); } }
public TestMultiThreadedSimulation() { DoublePendulum doublePendulum = new DoublePendulum(); SimulationConstructionSet scs = new SimulationConstructionSet(doublePendulum); DoublePendulumController controller = new DoublePendulumController(doublePendulum); MultiThreadedRobotController multiThreadedRobotController = new MultiThreadedRobotController("threadedController", doublePendulum, scs); multiThreadedRobotController.addController(controller, 10, false); multiThreadedRobotController.initialize(); doublePendulum.setController(multiThreadedRobotController); scs.setDT(0.0001, 1); scs.startOnAThread(); }
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); }
private void doATestWithJustAnSCS() throws SimulationExceededMaximumTimeException { // BambooTools.reportTestStartedMessage(simulationTestingParameters.getShowWindows()); SimulationConstructionSetParameters simulationConstructionSetParameters = new SimulationConstructionSetParameters(); simulationConstructionSetParameters.setCreateGUI(true); simulationConstructionSetParameters.setShowSplashScreen(false); simulationConstructionSetParameters.setShowWindows(true); SimulationConstructionSet scs = new SimulationConstructionSet(new Robot("TEST"), simulationConstructionSetParameters); scs.startOnAThread(); ThreadTools.sleep(4000); scs.closeAndDispose(); // BambooTools.reportTestFinishedMessage(simulationTestingParameters.getShowWindows()); }
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 void startSimulation() { SimulationConstructionSetParameters simulationParameters = new SimulationConstructionSetParameters(true, 16000); SimulationConstructionSet scs = new SimulationConstructionSet(simulatedRobot, simulationParameters); scs.setDT(robotModel.getSimulateDT(), 10); scs.setCameraPosition(scsCameraPosition.getX(), scsCameraPosition.getY(), scsCameraPosition.getZ()); scs.setCameraFix(scsCameraFix.getX(), scsCameraFix.getY(), scsCameraFix.getZ()); scs.startOnAThread(); }
@ContinuousIntegrationTest(estimatedDuration = 0.0) @Test(timeout = 30000, expected=RuntimeException.class) public void testSetMaxLessThanMin() { Robot robot = new Robot("Derivative"); YoVariableRegistry registry = new YoVariableRegistry("variables"); YoDouble position = new YoDouble("position", registry); robot.addYoVariableRegistry(registry); SimulationConstructionSet scs = new SimulationConstructionSet(robot, simulationTestingParameters); ValueDataCheckerParameters valueDataCheckerParameters = new ValueDataCheckerParameters(); YoVariableValueDataChecker yoVariableValueDataChecker = new YoVariableValueDataChecker(scs, position, robot.getYoTime(), valueDataCheckerParameters); double value = 10.0; yoVariableValueDataChecker.setMinimumValue(value); yoVariableValueDataChecker.setMaximumValue(value - 10.0); }
@ContinuousIntegrationTest(estimatedDuration = 0.0) @Test(timeout = 30000, expected=RuntimeException.class) public void testSetMinGreaterThanMax() { Robot robot = new Robot("Derivative"); YoVariableRegistry registry = new YoVariableRegistry("variables"); YoDouble position = new YoDouble("position", registry); robot.addYoVariableRegistry(registry); SimulationConstructionSet scs = new SimulationConstructionSet(robot, simulationTestingParameters); ValueDataCheckerParameters valueDataCheckerParameters = new ValueDataCheckerParameters(); YoVariableValueDataChecker yoVariableValueDataChecker = new YoVariableValueDataChecker(scs, position, robot.getYoTime(), valueDataCheckerParameters); double value = 10.0; yoVariableValueDataChecker.setMaximumValue(value); yoVariableValueDataChecker.setMinimumValue(value + 1.0); }