public static void main(String[] args) { final SimulationConstructionSet scs; // initialize SCS DRCRobotModel robotModel = new ValkyrieRobotModel(RobotTarget.REAL_ROBOT, false); final FloatingRootJointRobot robot =robotModel.createHumanoidFloatingRootJointRobot(false); SimulationConstructionSetParameters parameters = new SimulationConstructionSetParameters(); parameters.setDataBufferSize(65536); scs = new SimulationConstructionSet(robot, parameters); // add sysid button JButton button = new JButton("findCOM"); button.addActionListener(new LinkComIDActionListener(scs.getDataBuffer(), robot)); scs.addButton(button); scs.startOnAThread(); } }
parameters.setDataBufferSize((int) Math.ceil(maxTime * jointTrajectories.size() / dt) + 1); SimulationConstructionSet scs = new SimulationConstructionSet(nullRobot, parameters); scs.hideViewport();
parameters.setDataBufferSize((int) Math.ceil(maxTime * jointTrajectories.size() / dt) + 1); SimulationConstructionSet scs = new SimulationConstructionSet(nullRobot, parameters); scs.hideViewport();
public LogVisualizer(int bufferSize, boolean showOverheadView, File logFile) throws IOException { if (logFile == null) { logFile = FileSelectionDialog.loadDirectoryWithFileNamed(YoVariableLoggerListener.propertyFile); } if (logFile != null) { System.out.println("loading log from folder:" + logFile); SimulationConstructionSetParameters parameters = new SimulationConstructionSetParameters(); parameters.setCreateGUI(true); parameters.setDataBufferSize(bufferSize); scs = new SimulationConstructionSet(parameters); scs.setFastSimulate(true, 50); readLogFile(logFile, showOverheadView); if (PRINT_OUT_YOVARIABLE_NAMES) printOutYoVariableNames(); } else { scs = null; } }
public LogVisualizer(int bufferSize, boolean showOverheadView, File logFile) throws IOException { if (logFile == null) { logFile = FileSelectionDialog.loadDirectoryWithFileNamed(YoVariableLoggerListener.propertyFile); } if (logFile != null) { System.out.println("loading log from folder:" + logFile); SimulationConstructionSetParameters parameters = new SimulationConstructionSetParameters(); parameters.setCreateGUI(true); parameters.setDataBufferSize(bufferSize); scs = new SimulationConstructionSet(parameters); scs.setFastSimulate(true, 50); readLogFile(logFile, showOverheadView); if (PRINT_OUT_YOVARIABLE_NAMES) printOutYoVariableNames(); } else { scs = null; } }
public LogVisualizer(int bufferSize, boolean showOverheadView, File logFile) throws IOException { if (logFile == null) { logFile = FileSelectionDialog.loadDirectoryWithFileNamed(YoVariableLoggerListener.propertyFile); } if (logFile != null) { System.out.println("loading log from folder:" + logFile); SimulationConstructionSetParameters parameters = new SimulationConstructionSetParameters(); parameters.setCreateGUI(true); parameters.setDataBufferSize(bufferSize); scs = new SimulationConstructionSet(parameters); scs.setFastSimulate(true, 50); readLogFile(logFile, showOverheadView); if (PRINT_OUT_YOVARIABLE_NAMES) printOutYoVariableNames(); } else { scs = null; } }
parameters.setDataBufferSize(encoder.getNumTicks() + 1); SimulationConstructionSet scs = new SimulationConstructionSet(nullRobot, parameters); scs.hideViewport();
parameters.setDataBufferSize(5000); scs = new SimulationConstructionSet(robot, parameters); parameters.setDataBufferSize(5000); scs = new SimulationConstructionSet(parameters);
public static void main(String[] args) { YoGraphicsListRegistry yoGraphicsListRegistry = new YoGraphicsListRegistry(); DRCDemoEnvironmentSimpleSteeringWheelContact env = new DRCDemoEnvironmentSimpleSteeringWheelContact(yoGraphicsListRegistry); List<Robot> robots = env.getEnvironmentRobots(); Robot[] robotArray = new Robot[robots.size()]; robots.toArray(robotArray); SimulationConstructionSetParameters parameters = new SimulationConstructionSetParameters(); parameters.setDataBufferSize(36000); SimulationConstructionSet scs = new SimulationConstructionSet(robotArray, parameters); scs.setDT(1e-4, 20); TerrainObject3D terrainObject = env.getTerrainObject3D(); scs.addStaticLinkGraphics(terrainObject.getLinkGraphics()); scs.addYoGraphicsListRegistry(yoGraphicsListRegistry); scs.setGroundVisible(false); scs.startOnAThread(); }
private void setupSimulationConstructionSet() { SimulationConstructionSetParameters simulationConstructionSetParameters = guiInitialSetup.get().getSimulationConstructionSetParameters(); simulationConstructionSetParameters.setDataBufferSize(scsInitialSetup.get().getSimulationDataBufferSize()); List<Robot> allSimulatedRobotList = new ArrayList<Robot>(); allSimulatedRobotList.add(humanoidFloatingRootJointRobot); if (commonAvatarEnvironment.get() != null && commonAvatarEnvironment.get().getEnvironmentRobots() != null) { allSimulatedRobotList.addAll(commonAvatarEnvironment.get().getEnvironmentRobots()); commonAvatarEnvironment.get().addContactPoints(humanoidFloatingRootJointRobot.getAllGroundContactPoints()); commonAvatarEnvironment.get().createAndSetContactControllerToARobot(); } simulationConstructionSet = new SimulationConstructionSet(allSimulatedRobotList.toArray(new Robot[0]), guiInitialSetup.get().getGraphics3DAdapter(), simulationConstructionSetParameters); simulationConstructionSet.setDT(robotModel.get().getSimulateDT(), 1); }
private void setupSimulationConstructionSet() { SimulationConstructionSetParameters simulationConstructionSetParameters = guiInitialSetup.get().getSimulationConstructionSetParameters(); simulationConstructionSetParameters.setDataBufferSize(scsInitialSetup.get().getSimulationDataBufferSize()); List<Robot> allSimulatedRobotList = new ArrayList<Robot>(); allSimulatedRobotList.add(humanoidFloatingRootJointRobot); if (commonAvatarEnvironment.get() != null && commonAvatarEnvironment.get().getEnvironmentRobots() != null) { allSimulatedRobotList.addAll(commonAvatarEnvironment.get().getEnvironmentRobots()); commonAvatarEnvironment.get().addContactPoints(humanoidFloatingRootJointRobot.getAllGroundContactPoints()); commonAvatarEnvironment.get().createAndSetContactControllerToARobot(); } simulationConstructionSet = new SimulationConstructionSet(allSimulatedRobotList.toArray(new Robot[0]), guiInitialSetup.get().getGraphics3DAdapter(), simulationConstructionSetParameters); simulationConstructionSet.setDT(robotModel.get().getSimulateDT(), 1); }
public <T extends RobotControllerWithAttachRobot> SimulationConstructionSet setupSCS(T controller) throws InterruptedException { boolean showGUI = true; FallingBrickRobot robot = new FallingBrickRobot(); controller.attachRobot(robot); assertFalse(controller.getYoVariableRegistry() == null); robot.setController(controller); SimulationConstructionSetParameters parameters = SimulationConstructionSetParameters.createFromSystemProperties();; parameters.setCreateGUI(showGUI); parameters.setDataBufferSize(2000); SimulationConstructionSet scs = new SimulationConstructionSet(robot, parameters); scs.setFrameMaximized(); scs.startOnAThread(); Thread.sleep(DELAY_TIME_FOR_HUMAN_CONVENIENT_VIEWING); StandardSimulationGUI scsGUI = scs.getStandardSimulationGUI(); EntryBoxArrayPanel temp = scsGUI.getEntryBoxArrayPanel(); temp.removeAllEntryBoxes(); scsGUI.getEntryBoxArrayPanel().updateUI(); Thread.sleep(DELAY_TIME_FOR_HUMAN_CONVENIENT_VIEWING); return scs; }
parameters.setDataBufferSize(100); SimulationConstructionSet scs0 = new SimulationConstructionSet(new Robot("Null"), parameters); SimulationConstructionSet scs1 = new SimulationConstructionSet(new Robot("Null"), parameters);
parameters.setDataBufferSize(initialBufferSize);
parameters.setDataBufferSize(initialBufferSize);
parameters.setDataBufferSize(initialBufferSize);
parameters.setDataBufferSize(initialBufferSize);
@ContinuousIntegrationTest(estimatedDuration = 0.6) @Test(timeout = 30000) public void testTwoRewindableSimulationsWithAScript() throws IllegalArgumentException, SecurityException, IllegalAccessException, NoSuchFieldException, UnreasonableAccelerationException { Robot robot0 = createSimpleRobot(); RobotController rewindableController0 = new RewindableOrNotRewindableController(true); robot0.setController(rewindableController0); SimulationConstructionSetParameters parameters = new SimulationConstructionSetParameters(); parameters.setCreateGUI(false); parameters.setDataBufferSize(100); SimulationConstructionSet scs0 = new SimulationConstructionSet(robot0, parameters); scs0.setDT(0.0001, 11); scs0.startOnAThread(); Robot robot1 = createSimpleRobot(); RobotController rewindableController1 = new RewindableOrNotRewindableController(true); robot1.setController(rewindableController1); SimulationConstructionSet scs1 = new SimulationConstructionSet(robot1, parameters); scs1.setDT(0.0001, 11); scs1.startOnAThread(); int nTicksInitial = 121; int nTicksCompare = 121; int nTicksFinal = 11; SimulationComparisonScript script = new SimpleRewindabilityComparisonScript(nTicksInitial, nTicksCompare, nTicksFinal); ReflectionSimulationComparer.compareTwoSimulations(scs0, scs1, script, true, true); }
@ContinuousIntegrationTest(estimatedDuration = 0.5) @Test(timeout = 30000) public void testTwoNonRewindableSimulationsWithAScript() throws IllegalArgumentException, SecurityException, IllegalAccessException, NoSuchFieldException, UnreasonableAccelerationException { Robot robot0 = new Robot("robot"); RobotController rewindableController0 = new RewindableOrNotRewindableController(false); robot0.setController(rewindableController0); SimulationConstructionSetParameters parameters = new SimulationConstructionSetParameters(); parameters.setCreateGUI(false); parameters.setDataBufferSize(100); SimulationConstructionSet scs0 = new SimulationConstructionSet(robot0, parameters); scs0.setDT(0.0001, 10); scs0.startOnAThread(); Robot robot1 = new Robot("robot"); RobotController rewindableController1 = new RewindableOrNotRewindableController(false); robot1.setController(rewindableController1); SimulationConstructionSet scs1 = new SimulationConstructionSet(robot1, parameters); scs1.setDT(0.0001, 10); scs1.startOnAThread(); int nTicksInitial = 20; int nTicksCompare = 30; int nTicksFinal = 40; SimulationComparisonScript script = new SimpleRewindabilityComparisonScript(nTicksInitial, nTicksCompare, nTicksFinal); ReflectionSimulationComparer.compareTwoSimulations(scs0, scs1, script, false, true); }
simulationConstructionSetParameters.setDataBufferSize(scsInitialSetup.getSimulationDataBufferSize()); scs = new SimulationConstructionSet(allSimulatedRobots, guiInitialSetup.getGraphics3DAdapter(), simulationConstructionSetParameters); scs.setDT(drcRobotModel.getSimulateDT(), 1);