public DRCGuiInitialSetup(boolean groundProfileVisible, boolean drawPlaneAtZeroHeight, boolean showGUI) { this(groundProfileVisible, drawPlaneAtZeroHeight, new SimulationConstructionSetParameters(showGUI)); }
public DRCGuiInitialSetup(boolean groundProfileVisible, boolean drawPlaneAtZeroHeight, boolean showGUI) { this(groundProfileVisible, drawPlaneAtZeroHeight, new SimulationConstructionSetParameters(showGUI)); }
public DRCGuiInitialSetup(boolean groundProfileVisible, boolean drawPlaneAtZeroHeight, boolean showGUI) { this(groundProfileVisible, drawPlaneAtZeroHeight, new SimulationConstructionSetParameters(showGUI)); }
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(); }
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(); } }
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 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 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 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 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 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 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(); }
public void startSimulation() throws IOException { SimpleLidarRobot robot = new SimpleLidarRobot(); SimulationConstructionSetParameters parameters = new SimulationConstructionSetParameters(true, RealtimeTools.nextPowerOfTwo(200000)); SimulationConstructionSet scs = new SimulationConstructionSet(robot, parameters); double simDT = 0.0001; double controlDT = 0.01; scs.setDT(simDT, 10); scs.setSimulateDoneCriterion(() -> false); Graphics3DAdapter graphics3dAdapter = scs.getGraphics3dAdapter(); YoGraphicsListRegistry yoGraphicsListRegistry = new YoGraphicsListRegistry(); SimpleLidarRobotController controller = new SimpleLidarRobotController(robot, controlDT, ros2Node, graphics3dAdapter, yoGraphicsListRegistry); robot.setController(controller, (int) (controlDT / simDT)); scs.addYoGraphicsListRegistry(yoGraphicsListRegistry); createGroundTypeListener(scs); scs.setGroundVisible(false); scs.startOnAThread(); scs.simulate(); }
public ReachabilitySphereMapExample() { final RobotArm robot = new RobotArm(); SimulationConstructionSetParameters parameters = new SimulationConstructionSetParameters(true, 16000); SimulationConstructionSet scs = new SimulationConstructionSet(robot, parameters); Graphics3DObject coordinate = new Graphics3DObject(); coordinate.transform(robot.getElevatorFrameTransformToWorld()); coordinate.addCoordinateSystem(1.0); scs.addStaticLinkGraphics(coordinate); scs.startOnAThread(); OneDoFJointBasics[] armJoints = MultiBodySystemTools.filterJoints(robot.getJacobian().getJointsInOrder(), OneDoFJointBasics.class); ReachabilitySphereMapCalculator reachabilitySphereMapCalculator = new ReachabilitySphereMapCalculator(armJoints, scs); // reachabilitySphereMapCalculator.setControlFrameFixedInEndEffector(robot.getControlFrame()); ReachabilityMapListener listener = new ReachabilityMapListener() { @Override public void hasReachedNewConfiguration() { robot.copyRevoluteJointConfigurationToPinJoints(); } }; reachabilitySphereMapCalculator.attachReachabilityMapListener(listener); reachabilitySphereMapCalculator.buildReachabilitySpace(); }
public ReachabilitySphereMapExample() { final RobotArm robot = new RobotArm(); SimulationConstructionSetParameters parameters = new SimulationConstructionSetParameters(true, 16000); SimulationConstructionSet scs = new SimulationConstructionSet(robot, parameters); Graphics3DObject coordinate = new Graphics3DObject(); coordinate.transform(robot.getElevatorFrameTransformToWorld()); coordinate.addCoordinateSystem(1.0); scs.addStaticLinkGraphics(coordinate); scs.startOnAThread(); OneDoFJoint[] armJoints = ScrewTools.filterJoints(robot.getJacobian().getJointsInOrder(), OneDoFJoint.class); ReachabilitySphereMapCalculator reachabilitySphereMapCalculator = new ReachabilitySphereMapCalculator(armJoints, scs); reachabilitySphereMapCalculator.setControlFrameFixedInEndEffector(robot.getControlFrame()); ReachabilityMapListener listener = new ReachabilityMapListener() { @Override public void hasReachedNewConfiguration() { robot.copyRevoluteJointConfigurationToPinJoints(); } }; reachabilitySphereMapCalculator.attachReachabilityMapListener(listener); reachabilitySphereMapCalculator.buildReachabilitySpace(); }
@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); }
@ContinuousIntegrationTest(estimatedDuration = 0.3) @Test(timeout = 30000) public void testWithLowEpsilon() { AllYoVariablesSimulationComparer comparerWithLowEpsilon = new AllYoVariablesSimulationComparer(0.01); 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(1.8); yoDouble2.set(2.0); yoDouble3.set(1.791); yoDouble4.set(2.009); assertFalse(comparerWithLowEpsilon.compare(scs1, scs2)); comparerWithLowEpsilon.addException("yoDoubleA12"); comparerWithLowEpsilon.addException("Ignore"); assertTrue(comparerWithLowEpsilon.compare(scs1, scs2)); yoDouble1.set(1.80); yoDouble2.set(2.0); yoDouble3.set(1.79); yoDouble4.set(2.009); assertFalse(comparerWithLowEpsilon.compare(scs1, scs2)); }