us.ihmc.simulationconstructionset.SimulationConstructionSet.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(10.6k)|赞(0)|评价(0)|浏览(113)

本文整理了Java中us.ihmc.simulationconstructionset.SimulationConstructionSet.<init>()方法的一些代码示例,展示了SimulationConstructionSet.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SimulationConstructionSet.<init>()方法的具体详情如下:
包路径:us.ihmc.simulationconstructionset.SimulationConstructionSet
类名称:SimulationConstructionSet
方法名:<init>

SimulationConstructionSet.<init>介绍

暂无

代码示例

代码示例来源:origin: us.ihmc/ihmc-simulation-toolkit-test

public static void main(String argv[]) throws FileNotFoundException, JAXBException, MalformedURLException
  {
//      JaxbSDFLoader loader = new JaxbSDFLoader(new File("Models/unitBox.sdf"), "Models/");
//      Robot robot = loader.createRobot("unit_box_1");
   SDFWorldLoader loader = new SDFWorldLoader(new File("Models/unitBox.sdf"), "Models/");
   
   SimulationConstructionSet scs = new SimulationConstructionSet();
   scs.addStaticLinkGraphics(loader.createGraphics3dObject());
   
   
   Thread thread = new Thread(scs);
   thread.start();
  }
}

代码示例来源:origin: us.ihmc/DarpaRoboticsChallenge

public WholeBodyVisualizier(DRCRobotModel robotModel)
  {
   //model = AtlasRobotModelFactory.selectSimulationModelFromFlag(args);
     FloatingRootJointRobot simulatedRobot = robotModel.createHumanoidFloatingRootJointRobot(false);

   scs = new SimulationConstructionSet(simulatedRobot);
   scs.startOnAThread();
  }
}

代码示例来源:origin: us.ihmc/simulation-construction-set-test

@Test// timeout = 30000
public void testSimulationConstructionSetWithoutARobot()
{
 SimulationConstructionSet scs = new SimulationConstructionSet(parameters);
 Thread thread = new Thread(scs);
 thread.start();
 sleep(pauseTimeForGUIs);
 scs.closeAndDispose();
}

代码示例来源:origin: us.ihmc/simulation-construction-set-test

private SimulationConstructionSet createNewSCSWithEmptyRobot(String robotName)
{
 return new SimulationConstructionSet(new Robot(robotName), parameters);
}

代码示例来源:origin: us.ihmc/simulation-construction-set-test

@Test// timeout = 30000
public void testSimulationConstructionSetWithARobot()
{
 Robot robot = new Robot("NullRobot");
 SimulationConstructionSet scs = new SimulationConstructionSet(robot, parameters);
 Thread thread = new Thread(scs);
 thread.start();
 sleep(pauseTimeForGUIs);
 scs.closeAndDispose();
}

代码示例来源:origin: us.ihmc/simulation-construction-set-tools-test

private SimulationConstructionSet createSimulation()
{
  SimulationConstructionSetParameters parameters = new SimulationConstructionSetParameters();
  parameters.setCreateGUI(false);
  return new SimulationConstructionSet(createRobot(), parameters);
}

代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces-test

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();
}

代码示例来源:origin: us.ihmc/ihmc-common-walking-control-modules-test

private void setupSCS()
{
 SimulationTestingParameters simulationTestingParameters = SimulationTestingParameters.createFromSystemProperties();
 simulationTestingParameters.setKeepSCSUp(visualize);
 Robot robot = new Robot("Dummy");
 yoTime = robot.getYoTime();
 scs = new SimulationConstructionSet(robot, simulationTestingParameters);
}

代码示例来源:origin: us.ihmc/simulation-construction-set-tools

public static void main(String[] args)
{
 SimulationConstructionSet scs = new SimulationConstructionSet();
 scs.setGroundVisible(false);
 scs.addStaticLinkGraphics(new CinderBlockFieldPlanarRegionEnvironment().getTerrainObject3D().getLinkGraphics());
 scs.startOnAThread();
}

代码示例来源:origin: us.ihmc/DarpaRoboticsChallenge

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();
}

代码示例来源:origin: us.ihmc/IHMCAvatarInterfaces

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();
}

代码示例来源:origin: us.ihmc/simulation-construction-set-test

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();
  }

代码示例来源:origin: us.ihmc/simulation-construction-set-tools

public static void main(String[] args)
  {
   SimulationConstructionSet scs = new SimulationConstructionSet(new Robot("robot"));
   scs.addStaticLinkGraphics(new TwoBollardEnvironment(0.75).getTerrainObject3D().getLinkGraphics());
   scs.setGroundVisible(false);
   scs.startOnAThread();
  }
}

代码示例来源:origin: us.ihmc/simulation-construction-set-tools-test

public TestMultiThreadedSimulation()
{
 DoublePendulum doublePendulum = new DoublePendulum();
 SimulationConstructionSet scs = new SimulationConstructionSet(doublePendulum);
 DoublePendulumController controller = new DoublePendulumController(doublePendulum);
 
 MultiThreadedRobotController multiThreadedRobotController = new MultiThreadedRobotController("threadedController", doublePendulum, scs);
 multiThreadedRobotController.addController(controller, 10, false);
 multiThreadedRobotController.initialize();
 
 
 doublePendulum.setController(multiThreadedRobotController);
 
 scs.setDT(0.0001, 1);
 
 scs.startOnAThread();
}

代码示例来源:origin: us.ihmc/DarpaRoboticsChallenge

public static void visualizeFootsteps(Robot nullRobot, List<Footstep> footsteps, List<ContactablePlaneBody> contactablePlaneBodies)
{
 SimulationConstructionSet scs = new SimulationConstructionSet(nullRobot);
 scs.setDT(0.25, 1);
 YoVariableRegistry rootRegistry = scs.getRootRegistry();
 YoGraphicsListRegistry yoGraphicsListRegistry = new YoGraphicsListRegistry();
 int maxNumberOfContacts = 2;
 int maxPointsPerContact = 4;
 FootstepGeneratorVisualizer footstepGeneratorVisualizer = new FootstepGeneratorVisualizer(maxNumberOfContacts, maxPointsPerContact, rootRegistry,
    yoGraphicsListRegistry);
 scs.addYoGraphicsListRegistry(yoGraphicsListRegistry);
 footstepGeneratorVisualizer.addFootstepsAndTickAndUpdate(scs, footsteps, contactablePlaneBodies);
 scs.startOnAThread();
 deleteFirstDataPointAndCropData(scs);
}

代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces-test

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());
  }

代码示例来源:origin: us.ihmc/valkyrie

public ValkyrieDataFileNamespaceRenamer()
{
 SimulationConstructionSet scs = new SimulationConstructionSet(new Robot("null"));
 YoVariableRegistry rootRegistry = scs.getRootRegistry();
 
 NameSpaceRenamer valkyrieNameSpaceRenamer = new ValkyrieNameSpaceRenamer();
 ChangeNamespacesToMatchSimButton changeNamespacesToMatchSimButton = new ChangeNamespacesToMatchSimButton("ChangeValkyrieNamespaces", rootRegistry, valkyrieNameSpaceRenamer);
 scs.addButton(changeNamespacesToMatchSimButton);
 
 NameSpaceRenamer stepprNameSpaceRenamer = new StepprNameSpaceRenamer();
 ChangeNamespacesToMatchSimButton changeStepprNamespacesToMatchSimButton = new ChangeNamespacesToMatchSimButton("ChangeStepprNamespaces", rootRegistry, stepprNameSpaceRenamer);
 scs.addButton(changeStepprNamespacesToMatchSimButton);
 
 scs.startOnAThread();
}

代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces

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();
}

代码示例来源:origin: us.ihmc/simulation-construction-set-tools-test

@ContinuousIntegrationTest(estimatedDuration = 0.0)
@Test(timeout = 30000, expected=RuntimeException.class)
public void testSetMaxLessThanMin()
{
 Robot robot = new Robot("Derivative");
 YoVariableRegistry registry = new YoVariableRegistry("variables");
 YoDouble position = new YoDouble("position", registry);
 robot.addYoVariableRegistry(registry);
 SimulationConstructionSet scs = new SimulationConstructionSet(robot, simulationTestingParameters);
 ValueDataCheckerParameters valueDataCheckerParameters = new ValueDataCheckerParameters();
 YoVariableValueDataChecker yoVariableValueDataChecker = new YoVariableValueDataChecker(scs, position, robot.getYoTime(), valueDataCheckerParameters);
 double value = 10.0;
 yoVariableValueDataChecker.setMinimumValue(value);
 yoVariableValueDataChecker.setMaximumValue(value - 10.0);
}

代码示例来源:origin: us.ihmc/simulation-construction-set-tools-test

@ContinuousIntegrationTest(estimatedDuration = 0.0)
@Test(timeout = 30000, expected=RuntimeException.class)
public void testSetMinGreaterThanMax()
{
 Robot robot = new Robot("Derivative");
 YoVariableRegistry registry = new YoVariableRegistry("variables");
 YoDouble position = new YoDouble("position", registry);
 robot.addYoVariableRegistry(registry);
 SimulationConstructionSet scs = new SimulationConstructionSet(robot, simulationTestingParameters);
 ValueDataCheckerParameters valueDataCheckerParameters = new ValueDataCheckerParameters();
 YoVariableValueDataChecker yoVariableValueDataChecker = new YoVariableValueDataChecker(scs, position, robot.getYoTime(), valueDataCheckerParameters);
 double value = 10.0;
 yoVariableValueDataChecker.setMaximumValue(value);
 yoVariableValueDataChecker.setMinimumValue(value + 1.0);
}

相关文章

微信公众号

最新文章

更多

SimulationConstructionSet类方法