本文整理了Java中us.ihmc.simulationconstructionset.SimulationConstructionSet.addScript()
方法的一些代码示例,展示了SimulationConstructionSet.addScript()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SimulationConstructionSet.addScript()
方法的具体详情如下:
包路径:us.ihmc.simulationconstructionset.SimulationConstructionSet
类名称:SimulationConstructionSet
方法名:addScript
暂无
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces
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");
}
}
代码示例来源:origin: us.ihmc/DarpaRoboticsChallenge
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");
}
}
代码示例来源:origin: us.ihmc/IHMCAvatarInterfaces
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");
}
}
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces-test
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;
}
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces-test
scs.addScript(new Script()
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces-test
@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());
}
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces-test
@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);
}
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces-test
@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());
}
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces-test
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());
}
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces-test
robot.setGravity(0.0);
ForwardDynamicComparisonScript script = new ForwardDynamicComparisonScript(robot, robotModel);
scs.addScript(script);
内容来源于网络,如有侵权,请联系作者删除!