public LogDataProcessorWrapper(SimulationConstructionSet scs) { scs.addYoVariableRegistry(logDataProcessorRegistry); scs.addScript(this); controllerTimerCount = (YoLong) scs.getVariable(DRCControllerThread.class.getSimpleName(), "controllerTimerCount"); haveFoundControllerTimerVariable = controllerTimerCount != null; if (!haveFoundControllerTimerVariable) { System.err.println("Could not find controller timer variable, running processors at log data rate"); } }
public LogDataProcessorWrapper(SimulationConstructionSet scs) { scs.addYoVariableRegistry(logDataProcessorRegistry); scs.addScript(this); controllerTimerCount = (LongYoVariable) scs.getVariable(DRCControllerThread.class.getSimpleName(), "controllerTimerCount"); haveFoundControllerTimerVariable = controllerTimerCount != null; if (!haveFoundControllerTimerVariable) { System.err.println("Could not find controller timer variable, running processors at log data rate"); } }
public LogDataProcessorWrapper(SimulationConstructionSet scs) { scs.addYoVariableRegistry(logDataProcessorRegistry); scs.addScript(this); controllerTimerCount = (LongYoVariable) scs.getVariable(DRCControllerThread.class.getSimpleName(), "controllerTimerCount"); haveFoundControllerTimerVariable = controllerTimerCount != null; if (!haveFoundControllerTimerVariable) { System.err.println("Could not find controller timer variable, running processors at log data rate"); } }
AngularMomentumRecorder(DRCSimulationTestHelper helper) { this.recordFrequency = (int) Math.round(angularMomentumRecordDT / helper.getSimulationConstructionSet().getDT()); this.angularMomentumX = (YoDouble) helper.getYoVariable("AngularMomentumX"); this.angularMomentumY = (YoDouble) helper.getYoVariable("AngularMomentumY"); this.angularMomentumZ = (YoDouble) helper.getYoVariable("AngularMomentumZ"); this.time = (YoDouble) helper.getYoVariable("t"); drcSimulationTestHelper.getSimulationConstructionSet().addScript(this); recordCounter = recordFrequency - 1; }
scs.addScript(new Script()
@Test(timeout = 300000) public void testStanding() throws Exception { BambooTools.reportTestStartedMessage(simulationTestingParameters.getShowWindows()); DRCRobotModel robotModel = getRobotModel(); drcSimulationTestHelper = new DRCSimulationTestHelper(simulationTestingParameters, robotModel); drcSimulationTestHelper.createSimulation("FwdDynamicAgainstSCS_Standing"); HumanoidFloatingRootJointRobot robot = drcSimulationTestHelper.getRobot(); ForwardDynamicComparisonScript script = new ForwardDynamicComparisonScript(robot, robotModel); drcSimulationTestHelper.getSimulationConstructionSet().addScript(script); assertTrue(drcSimulationTestHelper.simulateAndBlockAndCatchExceptions(2.0)); script.setPerformAssertions(true); assertTrue(drcSimulationTestHelper.simulateAndBlockAndCatchExceptions(5.0)); BambooTools.reportTestFinishedMessage(simulationTestingParameters.getShowWindows()); }
@ContinuousIntegrationAnnotations.ContinuousIntegrationTest(estimatedDuration = 0.0) @Test(timeout = timeout) public void testWalkingBetweenBollardsAStarPlanner() { DRCStartingLocation startingLocation = () -> new OffsetAndYawRobotInitialSetup(-1.5, 0.0, 0.007, 0.0); FramePose3D goalPose = new FramePose3D(); goalPose.setX(1.5); setupSimulation(bollardPlanarRegions, startingLocation); CollisionCheckerScript collisionChecker = getCollisionChecker(500); drcSimulationTestHelper.createSimulation("FootstepPlannerEndToEndTest"); drcSimulationTestHelper.getSimulationConstructionSet().addScript(collisionChecker); FootstepPlannerParameters parameters = getRobotModel().getFootstepPlannerParameters(); FootstepPlannerParametersPacket parametersPacket = new FootstepPlannerParametersPacket(); RemoteUIMessageConverter.copyFootstepPlannerParametersToPacket(parametersPacket, parameters); parametersPacket.setCheckForBodyBoxCollisions(true); parametersPacket.setReturnBestEffortPlan(false); footstepPlannerParametersPublisher.publish(parametersPacket); runEndToEndTestAndKeepSCSUpIfRequested(FootstepPlannerType.A_STAR, bollardPlanarRegions, goalPose); }
@Test(timeout = 300000) public void testWalking() throws Exception { BambooTools.reportTestStartedMessage(simulationTestingParameters.getShowWindows()); DRCRobotModel robotModel = getRobotModel(); drcSimulationTestHelper = new DRCSimulationTestHelper(simulationTestingParameters, robotModel); drcSimulationTestHelper.setAddFootstepMessageGenerator(true); drcSimulationTestHelper.setUseHeadingAndVelocityScript(true); drcSimulationTestHelper.createSimulation("FwdDynamicAgainstSCS_Walking"); HumanoidFloatingRootJointRobot robot = drcSimulationTestHelper.getRobot(); ForwardDynamicComparisonScript script = new ForwardDynamicComparisonScript(robot, robotModel); drcSimulationTestHelper.getSimulationConstructionSet().addScript(script); assertTrue(drcSimulationTestHelper.simulateAndBlockAndCatchExceptions(1.0)); drcSimulationTestHelper.getSimulationConstructionSet().getVariable("walkCSG").setValueFromDouble(1.0); script.setPerformAssertions(true); assertTrue(drcSimulationTestHelper.simulateAndBlockAndCatchExceptions(10.0)); BambooTools.reportTestFinishedMessage(simulationTestingParameters.getShowWindows()); }
public void testStandingWithStateEstimatorDrift() throws SimulationExceededMaximumTimeException { BambooTools.reportTestStartedMessage(simulationTestingParameters.getShowWindows()); FlatGroundEnvironment flatGround = new FlatGroundEnvironment(); drcSimulationTestHelper = new DRCSimulationTestHelper(simulationTestingParameters, getRobotModel()); drcSimulationTestHelper.setTestEnvironment(flatGround); drcSimulationTestHelper.createSimulation("DRCSimpleFlatGroundScriptTest"); SimulationConstructionSet simulationConstructionSet = drcSimulationTestHelper.getSimulationConstructionSet(); HumanoidFloatingRootJointRobot robot = drcSimulationTestHelper.getRobot(); FullHumanoidRobotModel fullRobotModel = drcSimulationTestHelper.getControllerFullRobotModel(); setupCameraForWalkingUpToRamp(); Vector3DReadOnly slidingVelocity = new Vector3D(0.10, 0.0, 0.0); double simDT = simulationConstructionSet.getDT(); Script stateEstimatorDriftator = createStateEstimatorDriftator(simulationConstructionSet, fullRobotModel, slidingVelocity, simDT); simulationConstructionSet.addScript(stateEstimatorDriftator); boolean success = drcSimulationTestHelper.simulateAndBlockAndCatchExceptions(10.0); drcSimulationTestHelper.createVideo(getSimpleRobotName(), 1); drcSimulationTestHelper.checkNothingChanged(); assertTrue(success); Point3D center = new Point3D(0.0, 0.0, 0.86); Vector3D plusMinusVector = new Vector3D(0.06, 0.06, 0.05); BoundingBox3D boundingBox = BoundingBox3D.createUsingCenterAndPlusMinusVector(center, plusMinusVector); drcSimulationTestHelper.assertRobotsRootJointIsInBoundingBox(boundingBox); BambooTools.reportTestFinishedMessage(simulationTestingParameters.getShowWindows()); }
robot.setGravity(0.0); ForwardDynamicComparisonScript script = new ForwardDynamicComparisonScript(robot, robotModel); scs.addScript(script);