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 void visualizeFootstep(ContactablePlaneBody bipedFoot, Footstep footstep) { bagOfSingleFootstepVisualizers.visualizeFootstep(footstep, bipedFoot); nullRobot.setTime(nullRobot.getTime() + scs.getDT()); FramePoint solePositon = new FramePoint(footstep.getSoleReferenceFrame()); solePositon.changeFrame(worldFrame); updateFocus(solePositon); scs.setCameraFix(focusX, focusY, 0.0); scs.setCameraPosition(focusX, focusY - 1.5, 6.0); scs.tickAndUpdate(); }
public void visualizeFootstep(ContactablePlaneBody bipedFoot, Footstep footstep) { bagOfSingleFootstepVisualizers.visualizeFootstep(footstep, bipedFoot); nullRobot.setTime(nullRobot.getTime() + scs.getDT()); FramePoint3D solePositon = new FramePoint3D(footstep.getSoleReferenceFrame()); solePositon.changeFrame(worldFrame); updateFocus(solePositon); scs.setCameraFix(focusX, focusY, 0.0); scs.setCameraPosition(focusX, focusY - 1.5, 6.0); scs.tickAndUpdate(); }
private DRCRobotModel setup(DRCStartingLocation startingLocation) throws SimulationExceededMaximumTimeException { String className = getClass().getSimpleName(); FlatGroundEnvironment environment = new FlatGroundEnvironment(); DRCRobotModel robotModel = getRobotModel(); drcSimulationTestHelper = new DRCSimulationTestHelper(simulationTestingParameters, robotModel, environment); drcSimulationTestHelper.setStartingLocation(startingLocation); drcSimulationTestHelper.createSimulation(className); drcSimulationTestHelper.getSimulationConstructionSet().setCameraPosition(0.0, -3.0, 1.0); drcSimulationTestHelper.getSimulationConstructionSet().setCameraFix(0.0, 0.0, 0.2); pushController = new PushRobotController(drcSimulationTestHelper.getRobot(), robotModel.createFullRobotModel().getChest().getParentJoint().getName(), new Vector3D(0, 0, 0.15)); ThreadTools.sleep(1000); assertTrue(drcSimulationTestHelper.simulateAndBlockAndCatchExceptions(0.5)); return robotModel; }
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(); }
private void startSCS() { scs.addYoVariableRegistry(registry); scs.addYoGraphicsListRegistry(graphicsListRegistry); scs.setPlaybackRealTimeRate(0.025); Graphics3DObject linkGraphics = new Graphics3DObject(); linkGraphics.addCoordinateSystem(0.3); scs.addStaticLinkGraphics(linkGraphics); scs.setCameraFix(0.0, 0.0, 0.5); scs.setCameraPosition(-0.5, 0.0, 1.0); SimulationOverheadPlotterFactory simulationOverheadPlotterFactory = scs.createSimulationOverheadPlotterFactory(); simulationOverheadPlotterFactory.addYoGraphicsListRegistries(graphicsListRegistry); simulationOverheadPlotterFactory.createOverheadPlotter(); scs.startOnAThread(); }
scs.setPlaybackRealTimeRate(playbackRate); scs.setMaxBufferSize(64000); scs.setCameraFix(0.0, 0.0, 0.0); scs.setCameraPosition(-0.001, 0.0, 15.0); scs.tickAndUpdate();
private void setupTest() throws SimulationExceededMaximumTimeException { BambooTools.reportTestStartedMessage(simulationTestingParameters.getShowWindows()); DRCObstacleCourseStartingLocation selectedLocation = DRCObstacleCourseStartingLocation.DEFAULT; FlatGroundEnvironment environment = new FlatGroundEnvironment(); drcSimulationTestHelper = new DRCSimulationTestHelper(simulationTestingParameters, getRobotModel()); drcSimulationTestHelper.setTestEnvironment(environment); drcSimulationTestHelper.setStartingLocation(selectedLocation); drcSimulationTestHelper.createSimulation(getClass().getSimpleName()); ThreadTools.sleep(1000); FullHumanoidRobotModel fullRobotModel = drcSimulationTestHelper.getControllerFullRobotModel(); head = fullRobotModel.getHead(); chest = fullRobotModel.getChest(); neckJoints = MultiBodySystemTools.createOneDoFJointPath(chest, head); numberOfJoints = neckJoints.length; drcSimulationTestHelper.getSimulationConstructionSet().hideAllYoGraphics(); drcSimulationTestHelper.getSimulationConstructionSet().setCameraPosition(5.0, 0.0, 2.0); drcSimulationTestHelper.getSimulationConstructionSet().setCameraFix(0.0, 0.0, 0.4); assertTrue(drcSimulationTestHelper.simulateAndBlockAndCatchExceptions(1.0)); }
scs.addStaticLinkGraphics(linkGraphics); scs.setCameraFix(CAMFIX[0], CAMFIX[1], CAMFIX[2]); scs.setCameraPosition(CAMPOS[0], CAMPOS[1], CAMPOS[2]);
scs.setCameraFix(0.0, 0.0, 1.0); scs.setCameraPosition(8.0, 0.0, 3.0); scs.startOnAThread();
private static SimulationConstructionSet setupSCS(String testName, YoVariableRegistry testRegistry, PlanarRegionsList regions, Point3D start, Point3D goal) { Robot robot = new Robot(VisibilityGraphsOcclusionTest.class.getSimpleName()); robot.addYoVariableRegistry(testRegistry); SimulationConstructionSet scs = new SimulationConstructionSet(robot, simulationTestingParameters); Graphics3DObject graphics3DObject = new Graphics3DObject(); graphics3DObject.addCoordinateSystem(0.8); if (regions != null) { Graphics3DObjectTools.addPlanarRegionsList(graphics3DObject, regions, YoAppearance.White(), YoAppearance.Grey(), YoAppearance.DarkGray()); scs.setGroundVisible(false); } graphics3DObject.identity(); graphics3DObject.translate(start); graphics3DObject.translate(0.0, 0.0, 0.05); graphics3DObject.addCone(0.3, 0.05, YoAppearance.Green()); graphics3DObject.identity(); graphics3DObject.translate(goal); graphics3DObject.translate(0.0, 0.0, 0.05); graphics3DObject.addCone(0.3, 0.05, YoAppearance.Red()); scs.addStaticLinkGraphics(graphics3DObject); scs.setCameraPosition(-7.0, -1.0, 25.0); scs.setCameraFix(0.0, 0.0, 0.0); return scs; }
SimulationConstructionSet scs = drcSimulationTestHelper.getSimulationConstructionSet(); scs.setCameraPosition(8.0, -8.0, 5.0); scs.setCameraFix(1.5, 0.0, 0.8); assertTrue(drcSimulationTestHelper.simulateAndBlockAndCatchExceptions(0.5));
scs.addYoGraphicsListRegistry(yoGraphicsListRegistry); scs.setDT(1.0, 1); scs.setCameraFix(0.4, 0.0, 0.0);
scs.setCameraFix(0.0, 0.0, 0.0);
scs.addYoGraphicsListRegistry(graphicsListRegistry); scs.setCameraPosition(-0.01, 0.0, 10.0); scs.setCameraFix(0.0, 0.0, 0.0); scs.startOnAThread(); scs.play();
public static void visualizeSphereVoxelShape() { SimulationConstructionSet scs = new SimulationConstructionSet(new Robot("Dummy")); scs.startOnAThread(); Point3D sphereOrigin = new Point3D(0.0, 0.0, 1.0); scs.setCameraFix(sphereOrigin.getX(), sphereOrigin.getY(), sphereOrigin.getZ()); double voxelSize = 0.10; int numberOfRays = 20; int numberOfRotationsAroundRay = 10; SphereVoxelShape sphereVoxelShape = new SphereVoxelShape(worldFrame, voxelSize, numberOfRays, numberOfRotationsAroundRay, SphereVoxelType.graspAroundSphere); for (int i = 0; i < sphereVoxelShape.getNumberOfRays(); i++) { for (int j = 0; j < sphereVoxelShape.getNumberOfRotationsAroundRay(); j++) { FrameVector3D translationFromVoxelOrigin = new FrameVector3D(); FrameQuaternion orientation = new FrameQuaternion(); sphereVoxelShape.getPose(translationFromVoxelOrigin, orientation, i, j); Graphics3DObject staticLinkGraphics = new Graphics3DObject(); staticLinkGraphics.translate(sphereOrigin); staticLinkGraphics.translate(translationFromVoxelOrigin); RotationMatrix rotationMatrix = new RotationMatrix(); rotationMatrix.set(orientation); staticLinkGraphics.rotate(rotationMatrix); staticLinkGraphics.addCoordinateSystem(0.05); scs.addStaticLinkGraphics(staticLinkGraphics); } } }
scs.setCameraFix(0.0, 0.0, 1.0); scs.setCameraPosition(8.0, 0.0, 3.0); scs.startOnAThread();
scs.setCameraFix(0.0, 0.0, 1.0); scs.setCameraPosition(8.0, 0.0, 3.0); scs.startOnAThread();