us.ihmc.graphicsDescription.appearance.YoAppearance类的使用及代码示例

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

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

YoAppearance介绍

暂无

代码示例

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

public void addCoordinateSystem(double length, AppearanceDefinition arrowAppearance)
{
 addCoordinateSystem(length, YoAppearance.Red(), YoAppearance.White(), YoAppearance.Blue(), arrowAppearance);
}

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

public static AppearanceDefinition[] getStandardRoyGBivRainbow()
{
 AppearanceDefinition[] rainbow = new AppearanceDefinition[] { YoAppearance.Red(), YoAppearance.OrangeRed(), YoAppearance.Yellow(),
    YoAppearance.Green(), YoAppearance.Blue(), YoAppearance.Indigo(), YoAppearance.Purple()};
 
 return rainbow;
}

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

private AppearanceDefinition getYoAppearance(RobotQuadrant robotQuadrant)
{
 switch (robotQuadrant)
 {
 case FRONT_LEFT:
   return YoAppearance.White();
 case FRONT_RIGHT:
   return YoAppearance.Yellow();
 case HIND_LEFT:
   return YoAppearance.Blue();
 case HIND_RIGHT:
   return YoAppearance.Black();
 default:
   throw new RuntimeException("bad quad");
 }
}

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

AppearanceDefinition bubble = YoAppearance.LightBlue();
bubble.setTransparency(0.5);
collisionSphere = new YoGraphicEllipsoid("CollisionSphere", solePose.getPosition(), solePose.getOrientation(), bubble, new Vector3D());
stanceFootGraphic = new YoGraphicPolygon("StanceFootGraphic", footPolygon.getNumberOfVertices(), registry, true, 1.0, YoAppearance.Blue());
swingStartGraphic = new YoGraphicPolygon("SwingStartGraphic", footPolygon.getNumberOfVertices(), registry, true, 1.0, YoAppearance.Green());
swingEndGraphic = new YoGraphicPolygon("SwingEndGraphic", footPolygon.getNumberOfVertices(), registry, true, 1.0, YoAppearance.Yellow());
intersectionMap = new HashMap<SwingOverPlanarRegionsTrajectoryCollisionType, YoGraphicPosition>();
for (SwingOverPlanarRegionsTrajectoryCollisionType swingOverPlanarRegionsTrajectoryCollisionType : SwingOverPlanarRegionsTrajectoryCollisionType.values())
   appearance = YoAppearance.Red();
   size = 0.014;
   break;
  case INTERSECTION_BUT_OUTSIDE_TRAJECTORY:
   appearance = YoAppearance.Orange();
   size = 0.013;
   break;
  case INTERSECTION_BUT_BELOW_IGNORE_PLANE:
   appearance = YoAppearance.Yellow();
   size = 0.012;
   break;
  case NO_INTERSECTION:
   appearance = YoAppearance.Blue();
   size = 0.011;
   break;
  default:
   appearance = YoAppearance.Black();
   size = 0.01;
   break;

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

linkGraphics.addCube(CUBE_L, CUBE_W, CUBE_H, YoAppearance.Teal());
linkGraphics.addSphere(SPHERE_R, YoAppearance.Aqua());
linkGraphics.addEllipsoid(ELLIPSOID_RX, ELLIPSOID_RY, ELLIPSOID_RZ, YoAppearance.Navy());
linkGraphics.addHemiEllipsoid(HEMI_ELLIPSOID_RX, HEMI_ELLIPSOID_RY, HEMI_ELLIPSOID_RZ, YoAppearance.DarkBlue());
linkGraphics.addCylinder(CYLINDER_H, CYLINDER_R, YoAppearance.Green());
linkGraphics.addCone(CONE_H, CONE_R, YoAppearance.DarkGreen());
linkGraphics.addCoordinateSystem(COORD_LENGTH);
linkGraphics.addGenTruncatedCone(GEN_TRUNCATED_CONE_HEIGHT, GEN_TRUNCATED_CONE_BX, GEN_TRUNCATED_CONE_BY, GEN_TRUNCATED_CONE_TX, GEN_TRUNCATED_CONE_TY,
                 YoAppearance.Red());
linkGraphics.addArcTorus(ARC_TORUS_START_ANG, ARC_TORUS_END_ANG, ARC_TORUS_MAJ_RAD, ARC_TORUS_MIN_RAD, YoAppearance.DarkRed());
linkGraphics.addPyramidCube(PYRAMID_CUBE_LX, PYRAMID_CUBE_LY, PYRAMID_CUBE_LZ, PYRAMID_CUBE_LH, YoAppearance.BlackMetalMaterial());
polygonPoints.add(new Point2D(0.3, 0.3));
double height = 0.25;
linkGraphics.addExtrudedPolygon(polygonPoints, height, YoAppearance.Purple());
linkGraphics.addCoordinateSystem(COORD_LENGTH);
MeshDataHolder meshData = MeshDataGenerator.Wedge(WEDGE_X, WEDGE_Y, WEDGE_Z);
AppearanceDefinition meshAppearance = YoAppearance.Gold();
linkGraphics.addMeshData(meshData, meshAppearance);

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

public ArrayList<Graphics3DObject>  createLinkGraphics()
  {
   ArrayList<Graphics3DObject> linkGraphicsArray = new ArrayList<Graphics3DObject>();
   
   for (SteppingStone steppingStone : steppingStones)
   {
     Graphics3DObject linkGraphics = steppingStone.createLinkGraphics(YoAppearance.Red()); //YoAppearance.Black());
//       LinkGraphics linkGraphics = steppingStone.createLinkGraphics(YoAppearance.Red());
          linkGraphicsArray.add(linkGraphics);
   }

   return linkGraphicsArray;
  }

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

private void addSupportBaseControlGraphics(YoGraphicsListRegistry yoGraphicsListRegistry)
{
 addSupportBaseGraphics(yoGraphicsListRegistry,baseControlPoints,baseControlPointsList,baseControlLinesList,"baseControl",YoAppearance.Green());
}

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

AppearanceDefinition color = YoAppearance.Red();
color = YoAppearance.Orange();
color = YoAppearance.Gray();
float rampHeight = 0.625f;

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

public BagOfBalls(int numberOfBalls, double sizeInMeters, String name, YoVariableRegistry parentYoVariableRegistry,
   YoGraphicsListRegistry yoGraphicsListRegistry)
{
 this(numberOfBalls, sizeInMeters, name, YoAppearance.Black(), parentYoVariableRegistry, yoGraphicsListRegistry);
}

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

polygonSnapperVisualizer.addPlanarRegionsList(planarRegionsList, YoAppearance.Gold(), YoAppearance.Purple(), YoAppearance.Brown(), YoAppearance.Blue(), YoAppearance.Chartreuse());

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

private void visualizeNormalVector(Plane3D plane)
{
 this.linkGraphics.identity();
 linkGraphics.translate(new Vector3D(plane.getPointCopy()));
 linkGraphics.addSphere(0.005, YoAppearance.Black());
 Vector3D normalCopy = plane.getNormalCopy();
 normalCopy.scale(0.01);
 linkGraphics.translate(normalCopy);
 linkGraphics.addSphere(0.005, YoAppearance.Blue());
}

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

private CombinedTerrainObject3D setUpVessel(String name, Point2D doorLocation)
{
 CombinedTerrainObject3D combinedTerrainObject = new CombinedTerrainObject3D(name);
 combinedTerrainObject.addSphere(doorLocation.getX(), doorLocation.getY(), vesselCartWheelRadius + vesselCartBodyHeight + vesselRadius, vesselRadius,
                 YoAppearance.Blue());
 combinedTerrainObject.addBox(doorLocation.getX() - vesselCartLength / 2, doorLocation.getY() - vesselCartLength / 2,
                doorLocation.getX() + vesselCartLength / 2, doorLocation.getY() + vesselCartLength / 2, vesselCartWheelRadius,
                vesselCartWheelRadius + vesselCartBodyHeight, YoAppearance.Gray());
 RigidBodyTransform frontWheel = new RigidBodyTransform();
 RigidBodyTransform rearWheel = new RigidBodyTransform();
 frontWheel.setTranslation(doorLocation.getX() + vesselCartLength * 0.25, doorLocation.getY(), vesselCartWheelRadius);
 rearWheel.setTranslation(doorLocation.getX() - vesselCartLength * 0.25, doorLocation.getY(), vesselCartWheelRadius);
 frontWheel.appendRollRotation(Math.PI / 2);
 rearWheel.appendRollRotation(Math.PI / 2);
 double offset = 0.05;
 combinedTerrainObject.addCylinder(frontWheel, vesselCartLength - offset, vesselCartWheelRadius, YoAppearance.DarkGray());
 combinedTerrainObject.addCylinder(rearWheel, vesselCartLength - offset, vesselCartWheelRadius, YoAppearance.DarkGray());
 return combinedTerrainObject;
}

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

public static void addGoalViz(FramePose3D goalPose, YoVariableRegistry registry, YoGraphicsListRegistry graphicsListRegistry)
  {
   YoFramePoint3D yoGoal = new YoFramePoint3D("GoalPosition", worldFrame, registry);
   yoGoal.set(goalPose.getPosition());
   graphicsListRegistry.registerYoGraphic("viz", new YoGraphicPosition("GoalViz", yoGoal, 0.05, YoAppearance.Yellow()));
   YoFramePoint3D yoStart = new YoFramePoint3D("StartPosition", worldFrame, registry);
   graphicsListRegistry.registerYoGraphic("viz", new YoGraphicPosition("StartViz", yoStart, 0.05, YoAppearance.Blue()));
   PoseReferenceFrame goalFrame = new PoseReferenceFrame("GoalFrame", goalPose);
   FrameVector3D goalOrientation = new FrameVector3D(goalFrame, 0.5, 0.0, 0.0);
   goalOrientation.changeFrame(worldFrame);
   YoFrameVector3D yoGoalOrientation = new YoFrameVector3D("GoalVector", worldFrame, registry);
   yoGoalOrientation.set(goalOrientation);
//      graphicsListRegistry.registerYoGraphic("vizOrientation", new YoGraphicVector("GoalOrientationViz", yoGoal, yoGoalOrientation, 1.0, YoAppearance.White()));
  }

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

private void createWheelGraphics(FrameTorus3d wheelTorus)
{
 linkGraphics.addCone(0.05, 0.05);
 linkGraphics.addArcTorus(FastMath.PI / 3, 2 * FastMath.PI / 3, wheelTorus.getRadius(), wheelTorus.getThickness(), YoAppearance.Yellow());
 wheelGraphic = linkGraphics.addArcTorus(2 * FastMath.PI / 3, 7 * FastMath.PI / 3, wheelTorus.getRadius(), wheelTorus.getThickness(), YoAppearance.Black());
}

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

sphereObject.addCoordinateSystem(1.0);
sphereObject.translate(translation);
sphereObject.addSphere(0.5, YoAppearance.Green());
groundObject.addHeightMap(flatHeightMap, 100, 100, YoAppearance.Purple());
Graphics3DNode groundNode = new Graphics3DNode("ground", Graphics3DNodeType.JOINT);

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

private CombinedTerrainObject3D setUpGround(String name)
{
 CombinedTerrainObject3D combinedTerrainObject = new CombinedTerrainObject3D(name);
 combinedTerrainObject.addBox(-5.0, -5.0, 5.0, 5.0, -0.05, 0.0, YoAppearance.Blue());
 return combinedTerrainObject;
}

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

public SmartCMPProjector(YoGraphicsListRegistry graphicsListRegistry, YoVariableRegistry parentRegistry)
{
 activeProjection.set(ProjectionMethod.NONE);
 if (parentRegistry != null)
   parentRegistry.addChild(registry);
 if (graphicsListRegistry != null)
 {
   YoArtifactPosition desiredCMPViz = new YoArtifactPosition("Desired CMP Position", yoDesiredCMP, GraphicType.SOLID_BALL, DarkRed().getAwtColor(),
      0.008);
   graphicsListRegistry.registerArtifact(getClass().getSimpleName(), desiredCMPViz);
   YoArtifactPosition projectedCMPViz = new YoArtifactPosition("Projected CMP Position", yoProjectedCMP, GraphicType.BALL_WITH_ROTATED_CROSS,
      DarkRed().getAwtColor(), 0.01);
   graphicsListRegistry.registerArtifact(getClass().getSimpleName(), projectedCMPViz);
   YoArtifactPolygon projectionAreaViz = new YoArtifactPolygon("CMP Projection Area", yoProjectionArea, Blue().getAwtColor(), false);
   graphicsListRegistry.registerArtifact(getClass().getSimpleName(), projectionAreaViz);
 }
}

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

public Graphics3DObject getGraphicObject()
{
 graphicObject.transform(transform);
 graphicObject.addCapsule(radius, height, YoAppearance.Yellow());
 return graphicObject;
}

相关文章