us.ihmc.graphicsDescription.yoGraphics.YoGraphicsList.add()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(16.5k)|赞(0)|评价(0)|浏览(125)

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

YoGraphicsList.add介绍

暂无

代码示例

代码示例来源: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/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/simulation-construction-set-test

private YoGraphicsListRegistry createYoGraphicsListRegistryWithObject()
{
 YoGraphicsListRegistry yoGraphicsListRegistry = new YoGraphicsListRegistry();
 YoGraphicsList yoGraphicsList = new YoGraphicsList(yoGraphicsListName);
 yoGraphicsList.add(yoGraphic);
 yoGraphicsListRegistry.registerYoGraphicsList(yoGraphicsList);
 return yoGraphicsListRegistry;
}

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

private void registerBalls(String name, YoVariableRegistry registry, YoVariableRegistry parentYoVariableRegistry,
   YoGraphicsListRegistry yoGraphicsListRegistry)
{
 if ((parentYoVariableRegistry != null) && (yoGraphicsListRegistry != null))
 {
   parentYoVariableRegistry.addChild(registry); // (name + " Balls")); //
   yoGraphicsList = new YoGraphicsList(name + "Balls");
   for (YoGraphicPosition dynamicGraphicPosition : dynamicGraphicPositions)
   {
    yoGraphicsList.add(dynamicGraphicPosition);
   }
   if (yoGraphicsListRegistry != null)
    yoGraphicsListRegistry.registerYoGraphicsList(yoGraphicsList);
 }
}

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

public InverseDynamicsMechanismReferenceFrameVisualizer(RigidBodyBasics rootBody, YoGraphicsListRegistry yoGraphicsListRegistry,
   double length)
{
 YoGraphicsList yoGraphicsList = new YoGraphicsList(name);
 List<JointBasics> jointStack = new ArrayList<JointBasics>(rootBody.getChildrenJoints());
 while (!jointStack.isEmpty())
 {
   JointBasics joint = jointStack.get(0);
   ReferenceFrame referenceFrame = joint.getSuccessor().getBodyFixedFrame();
   YoGraphicReferenceFrame yoGraphicReferenceFrame = new YoGraphicReferenceFrame(referenceFrame, registry, false, length);
   yoGraphicsList.add(yoGraphicReferenceFrame);
   yoGraphicReferenceFrames.add(yoGraphicReferenceFrame);
   List<? extends JointBasics> childrenJoints = joint.getSuccessor().getChildrenJoints();
   jointStack.addAll(childrenJoints);
   jointStack.remove(joint);
 }
 yoGraphicsListRegistry.registerYoGraphicsList(yoGraphicsList);
}

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

public void createVisualizers(YoGraphicsList yoGraphicsList, ArtifactList artifactList)
{
 YoGraphicPosition startOfSplineICPViz = new YoGraphicPosition("singleSupportInitialSplineICP", yoStartOfSplineICP, 0.004, YoAppearance.Black(),
    GraphicType.SOLID_BALL);
 yoGraphicsList.add(startOfSplineICPViz);
 artifactList.add(startOfSplineICPViz.createArtifact());
 YoGraphicPosition endOfSplineICPViz = new YoGraphicPosition("singleSupportFinalSplineICP", yoEndOfSplineICP, 0.004, YoAppearance.Black(),
    GraphicType.BALL);
 yoGraphicsList.add(endOfSplineICPViz);
 artifactList.add(endOfSplineICPViz.createArtifact());
}

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

private void addSupportBaseGraphics(YoGraphicsListRegistry yoGraphicsListRegistry,YoFramePoint[] basePoints, ArrayList<YoGraphic> basePointsList, ArrayList<YoGraphic> linesList, String namePrefix,AppearanceDefinition appearance)
{
 AppearanceDefinition[] colors = { YoAppearance.Red(), YoAppearance.Green(), YoAppearance.Blue(), YoAppearance.Yellow() };
 YoGraphicsList yoGraphicsList = new YoGraphicsList(namePrefix + "Points");
 for (int i = 0; i < basePoints.length; i++)
 {
   YoGraphicPosition baseControlPointViz = new YoGraphicPosition(namePrefix + "Point" + i, basePoints[i], 0.01, colors[i]);
   yoGraphicsList.add(baseControlPointViz);
   basePointsList.add(baseControlPointViz);
      for (int j = i + 1; j < basePoints.length; j++)
   {
    YoGraphicLineSegment dynamicGraphicLineSegment = new YoGraphicLineSegment(namePrefix + "SupportLine", basePoints[i], basePoints[j],
       1.0, appearance, false);
    yoGraphicsList.add(dynamicGraphicLineSegment);
    linesList.add(dynamicGraphicLineSegment);
   }
 }
 if (yoGraphicsListRegistry != null)
   yoGraphicsListRegistry.registerYoGraphicsList(yoGraphicsList);
 yoGraphicsList.hideYoGraphics();
}

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

private void addSupportBaseGraphics(YoGraphicsListRegistry yoGraphicsListRegistry,YoFramePoint3D[] basePoints, ArrayList<YoGraphic> basePointsList, ArrayList<YoGraphic> linesList, String namePrefix,AppearanceDefinition appearance)
{
 AppearanceDefinition[] colors = { YoAppearance.Red(), YoAppearance.Green(), YoAppearance.Blue(), YoAppearance.Yellow() };
 YoGraphicsList yoGraphicsList = new YoGraphicsList(namePrefix + "Points");
 for (int i = 0; i < basePoints.length; i++)
 {
   YoGraphicPosition baseControlPointViz = new YoGraphicPosition(namePrefix + "Point" + i, basePoints[i], 0.01, colors[i]);
   yoGraphicsList.add(baseControlPointViz);
   basePointsList.add(baseControlPointViz);
      for (int j = i + 1; j < basePoints.length; j++)
   {
    YoGraphicLineSegment yoGraphicLineSegment = new YoGraphicLineSegment(namePrefix + "SupportLine", basePoints[i], basePoints[j],
       1.0, appearance, false);
    yoGraphicsList.add(yoGraphicLineSegment);
    linesList.add(yoGraphicLineSegment);
   }
 }
 if (yoGraphicsListRegistry != null)
   yoGraphicsListRegistry.registerYoGraphicsList(yoGraphicsList);
 yoGraphicsList.hideYoGraphics();
}

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

private void setupVisualization(String prefix, YoGraphicsListRegistry graphicsListRegistry, YoVariableRegistry registry)
{
 YoGraphicsList yoGraphicsList = new YoGraphicsList(prefix + "VisGraph");
 for (int i = 0; i < bodyPathPointsForVisualization; i++)
 {
   YoFramePoint3D point = new YoFramePoint3D(prefix + "BodyPathPoint" + i, ReferenceFrame.getWorldFrame(), registry);
   point.setToNaN();
   bodyPathPoints.add(point);
   YoGraphicPosition pointVisualization = new YoGraphicPosition(prefix + "BodyPathPoint" + i, point, 0.02, YoAppearance.Yellow());
   yoGraphicsList.add(pointVisualization);
 }
 graphicsListRegistry.registerYoGraphicsList(yoGraphicsList);
}

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

public JointAxisVisualizer(RigidBodyBasics rootBody, YoGraphicsListRegistry yoGraphicsListRegistry, double length)
{
 YoGraphicsList yoGraphicsList = new YoGraphicsList(name);
 List<JointBasics> jointStack = new ArrayList<JointBasics>(rootBody.getChildrenJoints());
 while (!jointStack.isEmpty())
 {
   JointBasics joint = jointStack.get(0);
   if(joint instanceof OneDoFJointBasics)
   {
    FrameVector3DReadOnly jAxis=((OneDoFJointBasics)joint).getJointAxis();
    ReferenceFrame referenceFrame = GeometryTools.constructReferenceFrameFromPointAndZAxis(joint.getName()+"JointAxis", new FramePoint3D(jAxis.getReferenceFrame()), new FrameVector3D(jAxis.getReferenceFrame(),jAxis));
    YoGraphicReferenceFrame yoGraphicReferenceFrame = new YoGraphicReferenceFrame(referenceFrame , registry, false, length, YoAppearance.Gold());
    yoGraphicsList.add(yoGraphicReferenceFrame);
    yoGraphicReferenceFrames.add(yoGraphicReferenceFrame);
   }
   List<? extends JointBasics> childrenJoints = joint.getSuccessor().getChildrenJoints();
   jointStack.addAll(childrenJoints);
   jointStack.remove(joint);
 }
 yoGraphicsListRegistry.registerYoGraphicsList(yoGraphicsList);
}

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

public BasisVectorVisualizer(String name, int rhoSize, double vizScaling, YoGraphicsListRegistry yoGraphicsListRegistry,
   YoVariableRegistry parentRegistry)
{
 AppearanceDefinition basisAppearance = YoAppearance.Aqua();
 this.rhoSize = rhoSize;
 YoGraphicsList yoGraphicsList = new YoGraphicsList(name);
 for (int i = 0; i < rhoSize; i++)
 {
   String prefix = name + i;
   YoFrameVector basisVector = new YoFrameVector(prefix + "BasisVector", ReferenceFrame.getWorldFrame(), registry);
   yoBasisVectors.put(i, basisVector);
   YoFramePoint pointOfBasis = new YoFramePoint(prefix + "PointOfBasis", ReferenceFrame.getWorldFrame(), registry);
   pointOfBases.put(i, pointOfBasis);
   YoGraphicVector basisVisualizer = new YoGraphicVector(prefix + "BasisViz", pointOfBasis , basisVector, BASIS_VECTOR_SCALE  * vizScaling,
      basisAppearance, true);
   basisVisualizers.put(i, basisVisualizer);
   yoGraphicsList.add(basisVisualizer);
 }
 yoGraphicsListRegistry.registerYoGraphicsList(yoGraphicsList);
 parentRegistry.addChild(registry);
}

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

private void addText(SimulationConstructionSet scs, YoGraphicsListRegistry yoGraphicsListRegistry, String string)
{
 if (string == null)
   return;
 YoGraphicsList yoGraphicsList = new YoGraphicsList("TextDescription");
 textPoint = new YoFramePoint("Desc", worldFrame, registry);
 textPoint.set(focusX, focusY, -.003);
 YoFrameOrientation orientation = new YoFrameOrientation("Desc", worldFrame, registry);
 double scale = 0.5;
 YoGraphicText desc = new YoGraphicText("FootstepDescription", string, textPoint, orientation, scale, Color.WHITE, Color.BLACK);
 yoGraphicsList.add(desc);
 if (yoGraphicsListRegistry != null)
   yoGraphicsListRegistry.registerYoGraphicsList(yoGraphicsList);
}

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

private void addText(SimulationConstructionSet scs, YoGraphicsListRegistry yoGraphicsListRegistry, String string)
{
 if (string == null)
   return;
 YoGraphicsList yoGraphicsList = new YoGraphicsList("TextDescription");
 textPoint = new YoFramePoint3D("Desc", worldFrame, registry);
 textPoint.set(focusX, focusY, -.003);
 YoFrameYawPitchRoll orientation = new YoFrameYawPitchRoll("Desc", worldFrame, registry);
 double scale = 0.5;
 YoGraphicText desc = new YoGraphicText("FootstepDescription", string, textPoint, orientation, scale, Color.WHITE, Color.BLACK);
 yoGraphicsList.add(desc);
 if (yoGraphicsListRegistry != null)
   yoGraphicsListRegistry.registerYoGraphicsList(yoGraphicsList);
}

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

private YoGraphicsListRegistry createStartAndGoalGraphics(FramePose3D initialStancePose, FramePose3D goalPose)
{
 YoGraphicsListRegistry graphicsListRegistry = new YoGraphicsListRegistry();
 YoGraphicsList graphicsList = new YoGraphicsList("testViz");
 YoFramePoseUsingYawPitchRoll yoInitialStancePose = new YoFramePoseUsingYawPitchRoll("initialStancePose", initialStancePose.getReferenceFrame(),
                                           drcSimulationTestHelper.getYoVariableRegistry());
 yoInitialStancePose.set(initialStancePose);
 YoFramePoseUsingYawPitchRoll yoGoalPose = new YoFramePoseUsingYawPitchRoll("goalStancePose", goalPose.getReferenceFrame(),
                                       drcSimulationTestHelper.getYoVariableRegistry());
 yoGoalPose.set(goalPose);
 YoGraphicCoordinateSystem startPoseGraphics = new YoGraphicCoordinateSystem("startPose", yoInitialStancePose, 13.0);
 YoGraphicCoordinateSystem goalPoseGraphics = new YoGraphicCoordinateSystem("goalPose", yoGoalPose, 13.0);
 graphicsList.add(startPoseGraphics);
 graphicsList.add(goalPoseGraphics);
 return graphicsListRegistry;
}

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

public VehicleModelObjectVisualizer(ReferenceFrame vehicleFrame, VehicleModelObjects vehicleModelObjects, YoGraphicsListRegistry yoGraphicsListRegistry,
   YoVariableRegistry parentRegistry)
{
 yoGraphicsList = new YoGraphicsList("vehicleObjects");
 for (VehicleObject vehicleObject : VehicleObject.values())
 {
   FramePose3D framePose = vehicleModelObjects.getFramePose(vehicleFrame, vehicleObject);
   String objectName = FormattingTools.underscoredToCamelCase(vehicleObject.toString(), false);
   ReferenceFrame objectFrame = new PoseReferenceFrame(objectName, framePose);
   objectFrame.update();
   YoGraphicReferenceFrame yoGraphicReferenceFrame = new YoGraphicReferenceFrame(objectFrame, registry, true, objectFrameScale);
   yoGraphicsList.add(yoGraphicReferenceFrame);
 }
 YoGraphicReferenceFrame vehicleFrameViz = new YoGraphicReferenceFrame(vehicleFrame, registry, true, vehicleFrameScale);
 yoGraphicsList.add(vehicleFrameViz);
 yoGraphicsListRegistry.registerYoGraphicsList(yoGraphicsList);
 parentRegistry.addChild(registry);
}

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

public VehicleModelObjectVisualizer(ReferenceFrame vehicleFrame, VehicleModelObjects vehicleModelObjects, YoGraphicsListRegistry yoGraphicsListRegistry,
   YoVariableRegistry parentRegistry)
{
 yoGraphicsList = new YoGraphicsList("vehicleObjects");
 for (VehicleObject vehicleObject : VehicleObject.values())
 {
   FramePose framePose = vehicleModelObjects.getFramePose(vehicleFrame, vehicleObject);
   String objectName = FormattingTools.underscoredToCamelCase(vehicleObject.toString(), false);
   ReferenceFrame objectFrame = new PoseReferenceFrame(objectName, framePose);
   objectFrame.update();
   YoGraphicReferenceFrame dynamicGraphicReferenceFrame = new YoGraphicReferenceFrame(objectFrame, registry, objectFrameScale);
   yoGraphicsList.add(dynamicGraphicReferenceFrame);
 }
 YoGraphicReferenceFrame vehicleFrameViz = new YoGraphicReferenceFrame(vehicleFrame, registry, vehicleFrameScale);
 yoGraphicsList.add(vehicleFrameViz);
 yoGraphicsListRegistry.registerYoGraphicsList(yoGraphicsList);
 parentRegistry.addChild(registry);
}

代码示例来源: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);
}

相关文章