gpt4 book ai didi

us.ihmc.graphicsDescription.yoGraphics.YoGraphicsList类的使用及代码示例

转载 作者:知者 更新时间:2024-03-16 23:46:40 30 4
gpt4 key购买 nike

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

YoGraphicsList介绍

暂无

代码示例

代码示例来源:origin: us.ihmc/ihmc-graphics-description

private void registerYoGraphics(String name, YoVariableRegistry registry, YoVariableRegistry parentYoVariableRegistry,
                YoGraphicsListRegistry yoGraphicsListRegistry)
{
 if (yoGraphicsListRegistry != null)
 {
   yoGraphicsList = new YoGraphicsList(name + "Balls");
   for (YoGraphicPosition yoGraphicPosition : yoGraphicPositions)
   {
    yoGraphicsList.add(yoGraphicPosition);
   }
   yoGraphicsListRegistry.registerYoGraphicsList(yoGraphicsList);
 }
}

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

public void update()
{
 for (YoGraphic yoGraphic : yoGraphicsList.getYoGraphics())
 {
   yoGraphic.update();
 }
}

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

public void setVisible(boolean visible)
  {
   yoGraphicsList.setVisible(visible);
  }
}

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

private void setupVisualization(String namePrefix, YoGraphicsListRegistry yoGraphicsListRegistry)
{
 YoGraphicsList list = new YoGraphicsList(name);
 YoGraphicCoordinateSystem desiredPoseViz = new YoGraphicCoordinateSystem(namePrefix + "DesiredPose", yoDesiredPose, 0.3);
 list.add(desiredPoseViz);
 yoGraphicsListRegistry.registerYoGraphicsList(list);
 list.hideYoGraphics();
}

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

public void registerYoGraphicsList(YoGraphicsList yoGraphicsList)
{
 if (alreadyAddedToSimulationConstructionSet)
   throw new RuntimeException("Graphics have already been added to the SimulationConstructionSet. Cannot register more objects after this.");
 if (yoGraphicsLists.contains(yoGraphicsList))
 {
   throw new RuntimeException("Already registered YoGraphicsList " + yoGraphicsList);
 }
 checkForRepeatNames(yoGraphicsList);
 for (YoGraphicsList list : yoGraphicsLists)
 {
   if (list.getLabel().equals(yoGraphicsList.getLabel()))
   {
    // Combine them:
    ArrayList<YoGraphic> yoGraphics = yoGraphicsList.getYoGraphics();
    list.addAll(yoGraphics);
    return;
   }
 }
 yoGraphicsLists.add(yoGraphicsList);
}

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

initialPosition.buildUpdatedYoFramePointForVisualizationOnly(), initialDirection.buildUpdatedYoFrameVectorForVisualizationOnly(), 0.2,
   YoAppearance.BlueViolet());
yoGraphicsList = new YoGraphicsList(namePrefix + "FinalApproachTraj");
yoGraphicsList.add(currentPositionViz);
yoGraphicsList.add(initialPositionViz);
yoGraphicsList.add(finalPositionViz);
yoGraphicsList.add(initialDirectionViz);
yoGraphicsListRegistry.registerYoGraphicsList(yoGraphicsList);
bagOfBalls = new BagOfBalls(numberOfBalls, 0.01, yoGraphicsList.getLabel(), registry, yoGraphicsListRegistry);

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

private void setupVisualizers(YoGraphicsListRegistry yoGraphicsListRegistry)
{
 YoGraphicsList yoGraphicsList = new YoGraphicsList(getClass().getSimpleName());
 ArtifactList artifactList = new ArtifactList(getClass().getSimpleName());
 referenceCMPsCalculator.createVisualizerForConstantCMPs(yoGraphicsList, artifactList);
 for (int i = 0; i < numberFootstepsToConsider.getIntegerValue() - 1; i++)
 {
   YoGraphicPosition icpEarlyCornerPointsViz = new YoGraphicPosition("EntryCornerPoints" + i,
      entryCornerPoints.get(i).buildUpdatedYoFramePointForVisualizationOnly(), ICP_CORNER_POINT_SIZE, YoAppearance.Blue(), GraphicType.SOLID_BALL);
   yoGraphicsList.add(icpEarlyCornerPointsViz);
   artifactList.add(icpEarlyCornerPointsViz.createArtifact());
   YoGraphicPosition lateCornerPointsViz = new YoGraphicPosition("ExitCornerPoints" + i,
      exitCornerPoints.get(i).buildUpdatedYoFramePointForVisualizationOnly(), ICP_CORNER_POINT_SIZE, YoAppearance.Blue(), GraphicType.BALL);
   yoGraphicsList.add(lateCornerPointsViz);
   artifactList.add(lateCornerPointsViz.createArtifact());
 }
 YoGraphicPosition singleSupportInitialICPViz = new YoGraphicPosition("singleSupportInitialICP",
    singleSupportInitialICP.buildUpdatedYoFramePointForVisualizationOnly(), 0.004, YoAppearance.Chocolate(), GraphicType.SOLID_BALL);
 yoGraphicsList.add(singleSupportInitialICPViz);
 artifactList.add(singleSupportInitialICPViz.createArtifact());
 YoGraphicPosition singleSupportFinalICPViz = new YoGraphicPosition("singleSupportFinalICP",
    singleSupportFinalICP.buildUpdatedYoFramePointForVisualizationOnly(), 0.004, YoAppearance.Chocolate(), GraphicType.BALL);
 yoGraphicsList.add(singleSupportFinalICPViz);
 artifactList.add(singleSupportFinalICPViz.createArtifact());
 icpSingleSupportTrajectoryGenerator.createVisualizers(yoGraphicsList, artifactList);
 artifactList.setVisible(VISUALIZE);
 yoGraphicsList.setVisible(VISUALIZE);
 yoGraphicsListRegistry.registerYoGraphicsList(yoGraphicsList);
 yoGraphicsListRegistry.registerArtifactList(artifactList);
}

代码示例来源:origin: us.ihmc/ihmc-graphics-description

public void registerYoGraphics(String listName, YoGraphic[] yoGraphics)
{
 YoGraphicsList list = new YoGraphicsList(listName, yoGraphics);
 registerYoGraphicsList(list);
}

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

@ContinuousIntegrationTest(estimatedDuration = 0.1)
@Test(timeout = 30000)
public void testVisualization()
{
 YoGraphicsList dummyGraphicsList = new YoGraphicsList("DummyGraphics");
 ArtifactList dummyArtifactList = new ArtifactList("DummyArtifacts");
 copPointsInFoot.setupVisualizers(dummyGraphicsList, dummyArtifactList, 0.05);
 assertEquals(dummyArtifactList.getArtifacts().size(), 10);
 assertEquals(dummyGraphicsList.getYoGraphics().size(), 10);
 copPointsInFoot.addWaypoint(CoPPointName.MIDFOOT_COP, 1.0, new FramePoint3D(footSpoof.getSoleFrame(), 1.0, 2.1, 3.1));
 YoGraphicPosition graphic = (YoGraphicPosition) dummyGraphicsList.getYoGraphics().get(0);
 assertEquals(1.0 - xToAnkle, graphic.getX(), 1e-5);
 assertEquals(2.1 - yToAnkle, graphic.getY(), 1e-5);
 assertEquals(3.1 - zToAnkle, graphic.getZ(), 1e-5);
}

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

public VisualizeFramesController(ArrayList<ReferenceFrame> referenceFrames, YoGraphicsListRegistry yoGraphicsListRegistry, double coordinateSystemLength)
{
 for (ReferenceFrame frame : referenceFrames)
 {
   YoGraphicReferenceFrame dynamicGraphicReferenceFrame = new YoGraphicReferenceFrame(frame, registry, coordinateSystemLength);
   dynamicGraphicReferenceFrames.add(dynamicGraphicReferenceFrame);
   yoGraphicsList.add(dynamicGraphicReferenceFrame);
 }
 yoGraphicsListRegistry.registerYoGraphicsList(yoGraphicsList);
}

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

for (YoGraphicsList yoGraphicsList : yoGraphicsLists)
  for (YoGraphic yoGraphic : yoGraphicsList.getYoGraphics())
     yoProtoHandshakeBuilder.addGraphicObject(msg.setListName(yoGraphicsList.getLabel()));

代码示例来源:origin: us.ihmc/ihmc-graphics-description

public void hideYoGraphics()
{
 int numberOfElements = yoGraphicsLists.size();
 for (int i = 0; i < numberOfElements; i++)
 {
   YoGraphicsList yoGraphicsList = yoGraphicsLists.get(i);
   yoGraphicsList.hideYoGraphics();
 }
}

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

final YoGraphicCoordinateSystem currentPoseViz = new YoGraphicCoordinateSystem(namePrefix + "CurrentPose",
   currentPosition.buildUpdatedYoFramePointForVisualizationOnly(), currentOrientationForViz, 0.25);
yoGraphicsList = new YoGraphicsList(namePrefix + "StraightLineTrajectory");
yoGraphicsList.add(currentPositionViz);
yoGraphicsList.add(initialPositionViz);
yoGraphicsList.add(finalPositionViz);
yoGraphicsList.add(initialPoseViz);
yoGraphicsList.add(finalPoseViz);
yoGraphicsList.add(currentPoseViz);
yoGraphicsListRegistry.registerYoGraphicsList(yoGraphicsList);
bagOfBalls = new BagOfBalls(numberOfBalls, 0.01, yoGraphicsList.getLabel(), registry, yoGraphicsListRegistry);

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

private void createFrameVisualizers(YoGraphicsListRegistry yoGraphicsListRegistry, FullHumanoidRobotModel fullRobotModel, String listName, boolean enable)
{
 YoGraphicsList list = new YoGraphicsList(listName);
 if (yoGraphicsListRegistry != null)
 {
   for (RobotSide robotSide : RobotSide.values)
   {
    ReferenceFrame handPositionControlFrame = fullRobotModel.getHandControlFrame(robotSide);
    if (handPositionControlFrame != null)
    {
      YoGraphicReferenceFrame dynamicGraphicReferenceFrame = new YoGraphicReferenceFrame(handPositionControlFrame, registry, 0.1);
      dynamicGraphicReferenceFrames.add(dynamicGraphicReferenceFrame);
      list.add(dynamicGraphicReferenceFrame);
    }
   }
   yoGraphicsListRegistry.registerYoGraphicsList(list);
   if (!enable)
    list.hideYoGraphics();
 }
}

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

private void setupVisualizers(YoGraphicsListRegistry yoGraphicsListRegistry, boolean visualize)
{
 YoGraphicsList yoGraphicsList = new YoGraphicsList(getClass().getSimpleName());
 ArtifactList artifactList = new ArtifactList(getClass().getSimpleName());
 YoGraphicPosition previousExitCMP = new YoGraphicPosition("previousExitCMP", previousStanceExitCMP, 0.01, YoAppearance.Red(), GraphicType.SQUARE);
 YoGraphicPosition entryCMP = new YoGraphicPosition("entryCMP", stanceEntryCMP, 0.01, YoAppearance.Red(), GraphicType.SQUARE);
 YoGraphicPosition exitCMP = new YoGraphicPosition("exitCMP", stanceExitCMP, 0.01, YoAppearance.Red(), GraphicType.SQUARE);
 YoGraphicPosition finalICP = new YoGraphicPosition("finalICP", this.finalICP, 0.005, YoAppearance.Black(), GraphicType.SOLID_BALL);
 yoGraphicsList.add(finalICP);
 artifactList.add(previousExitCMP.createArtifact());
 artifactList.add(entryCMP.createArtifact());
 artifactList.add(exitCMP.createArtifact());
 artifactList.add(finalICP.createArtifact());
 artifactList.setVisible(visualize);
 yoGraphicsList.setVisible(visualize);
 yoGraphicsListRegistry.registerYoGraphicsList(yoGraphicsList);
 yoGraphicsListRegistry.registerArtifactList(artifactList);
}

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

public void registerYoGraphics(String listName, YoGraphic[] yoGraphics)
{
 YoGraphicsList list = new YoGraphicsList(listName, yoGraphics);
 registerYoGraphicsList(list);
}

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

public void createVisualizerForConstantCMPs(YoGraphicsList yoGraphicsList, ArtifactList artifactList)
{
 for (int i = 0; i < entryCMPs.size(); i++)
 {
   YoGraphicPosition entryCMPViz = new YoGraphicPosition("Entry CMP" + i, entryCMPsInWorldFrameReadOnly.get(i), CMP_POINT_SIZE, YoAppearance.Green(),
      GraphicType.SOLID_BALL);
   yoGraphicsList.add(entryCMPViz);
   artifactList.add(entryCMPViz.createArtifact());
 }
 for (int i = 0; i < exitCMPs.size(); i++)
 {
   YoGraphicPosition exitCMPViz = new YoGraphicPosition("Exit CMP" + i, exitCMPsInWorldFrameReadOnly.get(i), CMP_POINT_SIZE, YoAppearance.Green(),
      GraphicType.BALL);
   yoGraphicsList.add(exitCMPViz);
   artifactList.add(exitCMPViz.createArtifact());
 }
}

代码示例来源:origin: us.ihmc/ihmc-graphics-description

public void registerYoGraphicsList(YoGraphicsList yoGraphicsList)
{
 if (alreadyAddedToSimulationConstructionSet)
   throw new RuntimeException("Graphics have already been added to the SimulationConstructionSet. Cannot register more objects after this.");
 if (yoGraphicsLists.contains(yoGraphicsList))
 {
   throw new RuntimeException("Already registered YoGraphicsList " + yoGraphicsList);
 }
 checkForRepeatNames(yoGraphicsList);
 for (YoGraphicsList list : yoGraphicsLists)
 {
   if (list.getLabel().equals(yoGraphicsList.getLabel()))
   {
    // Combine them:
    ArrayList<YoGraphic> yoGraphics = yoGraphicsList.getYoGraphics();
    list.addAll(yoGraphics);
    return;
   }
 }
 yoGraphicsLists.add(yoGraphicsList);
}

代码示例来源:origin: us.ihmc/ihmc-robot-data-logger

for (YoGraphicsList yoGraphicsList : yoGraphicsLists)
  for (YoGraphic yoGraphic : yoGraphicsList.getYoGraphics())
     msg.setListName(yoGraphicsList.getLabel());
     messageFromDynamicGraphicObject((RemoteYoGraphic) yoGraphic, msg);

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

public void hideYoGraphics()
{
 int numberOfElements = yoGraphicsLists.size();
 for (int i = 0; i < numberOfElements; i++)
 {
   YoGraphicsList yoGraphicsList = yoGraphicsLists.get(i);
   yoGraphicsList.hideYoGraphics();
 }
}

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com