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

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

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

SimulationConstructionSet.setGroundVisible介绍

暂无

代码示例

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

public void testSetupInEnvironment()
{
 // Not an actual test, could be given @Test(timeout=300000) for visual confirmation though
 SimulationConstructionSet scs = new SimulationConstructionSet();
 scs.addStaticLinkGraphics(inclinedTopFaceOctagon3d.getLinkGraphics());
 scs.setGroundVisible(false);
 scs.startOnAThread();
 while (true)
 {
   try
   {
    Thread.sleep(1000);
   }
   catch (InterruptedException e)
   {
   }
 }
}

代码示例来源: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/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/DarpaRoboticsChallenge

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

代码示例来源: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/IHMCHumanoidBehaviors

public static PlanarRegionBipedalFootstepPlannerVisualizer createWithSimulationConstructionSet(double dtForViz,
                                               SideDependentList<ConvexPolygon2d> footPolygonsInSoleFrame)
{
 YoVariableRegistry registry = new YoVariableRegistry(PlanarRegionBipedalFootstepPlannerVisualizerFactory.class.getSimpleName());
 YoGraphicsListRegistry graphicsListRegistry = new YoGraphicsListRegistry();
 PlanarRegionBipedalFootstepPlannerVisualizer footstepPlannerVisualizer = new PlanarRegionBipedalFootstepPlannerVisualizer(10, footPolygonsInSoleFrame,
                                                              registry, graphicsListRegistry);
 SimulationConstructionSet scs = new SimulationConstructionSet(new Robot("Test"));
 footstepPlannerVisualizer.setTickAndUpdatable(scs);
 scs.changeBufferSize(32000);
 scs.addYoVariableRegistry(registry);
 scs.addYoGraphicsListRegistry(graphicsListRegistry);
 scs.setDT(dtForViz, 1);
 scs.setGroundVisible(false);
 scs.startOnAThread();
 return footstepPlannerVisualizer;
}

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

public static void main(String[] args)
  {
   SimulationConstructionSet scs = new SimulationConstructionSet(new Robot("exampleRobot"));
//      PlanarRegionsList planarRegionsList = createMazeEnvironment();
   PlanarRegionsList planarRegionsList = generateSteppingStoneField(0.1, 0.1, 0.25, 0.3, 6);
   PlanarRegionsListDefinedEnvironment environment = new PlanarRegionsListDefinedEnvironment("ExamplePlanarRegionsListEnvironment",
                                                new PlanarRegionsList[] {planarRegionsList}, null, 1e-5, false);
   TerrainObject3D terrainObject3D = environment.getTerrainObject3D();
   scs.addStaticLinkGraphics(terrainObject3D.getLinkGraphics());
   scs.setGroundVisible(false);

//      Graphics3DObject startAndEndGraphics = new Graphics3DObject();
//      startAndEndGraphics.translate(0.0, 0.0, 0.5);
//      startAndEndGraphics.addSphere(0.2, YoAppearance.Green());
//      startAndEndGraphics.identity();
//      startAndEndGraphics.translate(3.0, 2.5, 0.5);
//      startAndEndGraphics.addSphere(0.2, YoAppearance.Red());
//      scs.addStaticLinkGraphics(startAndEndGraphics);

   scs.startOnAThread();
  }
}

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

public static void main(String[] args)
  {
   SimulationConstructionSet scs = new SimulationConstructionSet(new Robot("Null"));
   ConvexPolygon2D footPolygon = new ConvexPolygon2D(Vertex2DSupplier.asVertex2DSupplier(new double[][]
   {
     {-0.2, -0.2}, {-0.2, 0.2}, {0.2, 0.2}, {0.2, -0.2}
   }));

//    SteppingStones steppingStones = SteppingStones.generateRandomSteppingStones(new Random(1776L), 20, footPolygon); // Inside out?
//    SteppingStones steppingStones = SteppingStones.generateRectangularCheckeredStripSteppingStones(0.0,0.0,0.2,0.2,0.1,0.1,-0.1, 0.0,33); // Inside out?
//    SteppingStones steppingStones = SteppingStones.generateRectangularChessBoardSteppingStones(0.0,0.0,0.2,0.2,0.0,0.0,-0.1,0.0,6,6); // Inside out?
//      SteppingStones steppingStones = SteppingStones.generateRectangularUniformSteppingStones(0.0, 0.0, 2.0, 2.0, 0.5, 0.5, -0.1, 0.0, 6, 6, footPolygon,
//                                         false);    // Inside out?

//    SteppingStones steppingStones = SteppingStones.generateRegularPolygonalCheckeredStripSteppingStones(0.0,0.0,0.2,5,0.0,0.0,-0.1,0.0,33);
//    SteppingStones steppingStones = SteppingStones.generateRegularPolygonalChessBoardSteppingStones(0.0,0.0,0.2,7,0.0,0.0,-0.1,0.0,8,8);
//    SteppingStones steppingStones = SteppingStones.generateRegularPolygonalUniformSteppingStones(0.0,0.0,0.2,5,0.0,0.0,-0.1,0.0,5,5);
//    SteppingStones steppingStones = SteppingStones.generateRandomPolygonalCheckeredStripSteppingStones(0.0,0.0,0.2,7,0.0,0.0,-0.1,0.0,33);
//    SteppingStones steppingStones = SteppingStones.generateRandomPolygonalChessBoardSteppingStones(0.0,0.0,0.2,5,0.0,0.0,-0.2,0.0,8,8);
  SteppingStones steppingStones = SteppingStones.generateRandomPolygonalUniformSteppingStones(0.0,0.0,0.5,6,0.0, 0.0, -0.1, 0.01, 5, 5, footPolygon, false);

   ArrayList<Graphics3DObject> linkGraphics = steppingStones.createLinkGraphics();

   scs.setGroundVisible(false);
   scs.addStaticLinkGraphics(linkGraphics);

   scs.startOnAThread();
  }

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

private DRCFlatGroundWalkingTrack setupSimulationTrack(WalkingControllerParameters drcControlParameters, GroundProfile3D groundProfile,
   GroundProfile3D groundProfile3D, boolean drawGroundProfile, boolean useVelocityAndHeadingScript, boolean cheatWithGroundHeightAtForFootstep,
   DRCRobotInitialSetup<HumanoidFloatingRootJointRobot> robotInitialSetup)
{
 DRCGuiInitialSetup guiInitialSetup = createGUIInitialSetup();
 DRCSCSInitialSetup scsInitialSetup;
 if (groundProfile != null)
 {
   scsInitialSetup = new DRCSCSInitialSetup(groundProfile, robotModel.getSimulateDT());
 }
 else
 {
   scsInitialSetup = new DRCSCSInitialSetup(groundProfile3D, robotModel.getSimulateDT());
 }
 scsInitialSetup.setDrawGroundProfile(drawGroundProfile);
 if (cheatWithGroundHeightAtForFootstep)
   scsInitialSetup.setInitializeEstimatorToActual(true);
 DRCFlatGroundWalkingTrack drcFlatGroundWalkingTrack = new DRCFlatGroundWalkingTrack(robotInitialSetup, guiInitialSetup,
                              scsInitialSetup, useVelocityAndHeadingScript, cheatWithGroundHeightAtForFootstep, robotModel);
 SimulationConstructionSet scs = drcFlatGroundWalkingTrack.getSimulationConstructionSet();
 scs.setGroundVisible(false);
 setupCameraForUnitTest(scs);
 return drcFlatGroundWalkingTrack;
}

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

public ValkyrieSDFLoadingDemo()
{
 ValkyrieRobotModel robotModel = new ValkyrieRobotModel(RobotTarget.SCS, false);
 FloatingRootJointRobot valkyrieRobot = robotModel.createHumanoidFloatingRootJointRobot(false);
 valkyrieRobot.setPositionInWorld(new Vector3D());
 if (SHOW_ELLIPSOIDS)
 {
   addIntertialEllipsoidsToVisualizer(valkyrieRobot);
 }
 if (SHOW_COORDINATES_AT_JOINT_ORIGIN)
   addJointAxis(valkyrieRobot);
 FullRobotModel fullRobotModel = robotModel.createFullRobotModel();
 YoGraphicsListRegistry yoGraphicsListRegistry = new YoGraphicsListRegistry();
 CommonInertiaEllipsoidsVisualizer inertiaVis = new CommonInertiaEllipsoidsVisualizer(fullRobotModel.getElevator(), yoGraphicsListRegistry);
 inertiaVis.update();
 scs = new SimulationConstructionSet(valkyrieRobot);
 scs.addYoGraphicsListRegistry(yoGraphicsListRegistry);
 scs.setGroundVisible(false);
 scs.startOnAThread();
}

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

public FootstepVisualizer(GroundProfile3D groundProfile, Graphics3DObject linkGraphics, int maxNumberOfFootstepsPerSide, int maxContactPointsPerFoot, String description)
{
 nullRobot = new Robot("FootstepVisualizerRobot");
 
 if (groundProfile != null)
 {
   GroundContactModel gcModel = new LinearGroundContactModel(nullRobot, nullRobot.getRobotsYoVariableRegistry());
   gcModel.setGroundProfile3D(groundProfile);
   nullRobot.setGroundContactModel(gcModel);
 }
 
 scs = new SimulationConstructionSet(nullRobot);
 
 if (linkGraphics != null)
 {
   scs.setGroundVisible(false);
   scs.addStaticLinkGraphics(linkGraphics);
 }
 
 printifdebug("Attaching exit listener");
 scs.setDT(1, 1);
 yoGraphicsListRegistry = new YoGraphicsListRegistry();
 bagOfSingleFootstepVisualizers = new BagOfSingleFootstepVisualizers(maxNumberOfFootstepsPerSide, maxContactPointsPerFoot, registry, yoGraphicsListRegistry);
 addText(scs, yoGraphicsListRegistry, description);
}

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

public FootstepVisualizer(GroundProfile3D groundProfile, Graphics3DObject linkGraphics, int maxNumberOfFootstepsPerSide, int maxContactPointsPerFoot, String description)
{
 nullRobot = new Robot("FootstepVisualizerRobot");
 
 if (groundProfile != null)
 {
   GroundContactModel gcModel = new LinearGroundContactModel(nullRobot, nullRobot.getRobotsYoVariableRegistry());
   gcModel.setGroundProfile3D(groundProfile);
   nullRobot.setGroundContactModel(gcModel);
 }
 
 scs = new SimulationConstructionSet(nullRobot);
 
 if (linkGraphics != null)
 {
   scs.setGroundVisible(false);
   scs.addStaticLinkGraphics(linkGraphics);
 }
 
 printifdebug("Attaching exit listener");
 scs.setDT(1, 1);
 yoGraphicsListRegistry = new YoGraphicsListRegistry();
 bagOfSingleFootstepVisualizers = new BagOfSingleFootstepVisualizers(maxNumberOfFootstepsPerSide, maxContactPointsPerFoot, registry, yoGraphicsListRegistry);
 addText(scs, yoGraphicsListRegistry, description);
}

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

scs = new SimulationConstructionSet(robot);
scs.setGroundVisible(false);

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

scs.setCameraPosition(CAMPOS[0], CAMPOS[1], CAMPOS[2]);
scs.setGroundVisible(SHOW_COLLISION_TERRAIN);

代码示例来源:origin: us.ihmc/robot-environment-awareness-application

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

代码示例来源:origin: us.ihmc/ihmc-path-planning-test

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

代码示例来源:origin: us.ihmc/ihmc-footstep-planning-test

scs.setGroundVisible(false);

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

scs.setGroundVisible(false);

代码示例来源:origin: us.ihmc/ihmc-footstep-planning-test

public PolygonSnapperVisualizer(ConvexPolygon2D snappingPolygonShape)
{
 Robot robot = new Robot("Robot");
 scs = new SimulationConstructionSet(robot);
 scs.setDT(0.1, 1);
 polygonToSnap = new YoFrameConvexPolygon2D("polygonToSnap", ReferenceFrame.getWorldFrame(), 4, registry);
 snappedPolygon = new YoFrameConvexPolygon2D("snappedPolygon", ReferenceFrame.getWorldFrame(), 4, registry);
 polygonToSnap.set(snappingPolygonShape);
 snappedPolygon.set(snappingPolygonShape);
 polygonToSnapPose = new YoFramePoseUsingYawPitchRoll("polygonToSnapPose", ReferenceFrame.getWorldFrame(), registry);
 snappedPolygonPose = new YoFramePoseUsingYawPitchRoll("snappedPolygonPose", ReferenceFrame.getWorldFrame(), registry);
 polygonToSnapPose.setToNaN();
 snappedPolygonPose.setToNaN();
 polygonToSnapViz = new YoGraphicPolygon("polygonToSnapViz", polygonToSnap, polygonToSnapPose, 1.0, YoAppearance.Green());
 snappedPolygonViz = new YoGraphicPolygon("snappedPolygonViz", polygonToSnap, snappedPolygonPose, 1.0, YoAppearance.Red());
 polygonToSnapViz.update();
 snappedPolygonViz.update();
 scs.addYoGraphic(polygonToSnapViz);
 scs.addYoGraphic(snappedPolygonViz);
 scs.addYoVariableRegistry(registry);
 scs.setGroundVisible(false);
 scs.startOnAThread();
}

代码示例来源:origin: us.ihmc/ihmc-footstep-planning-test

scs.setGroundVisible(false);
scs.startOnAThread();
ThreadTools.sleepForever();

相关文章

SimulationConstructionSet类方法