gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-15 20:08:40 27 4
gpt4 key购买 nike

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

YoGraphicPolygon介绍

暂无

代码示例

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

static YoGraphicPolygon createAsRemoteYoGraphic(String name, YoVariable<?>[] yoVariables, double[] constants, AppearanceDefinition appearance)
{
 return new YoGraphicPolygon(name, yoVariables, constants, appearance);
}

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

public void updateConvexPolygon2d(FrameConvexPolygon2d frameConvexPolygon2d)
{
 yoFrameConvexPolygon2d.setFrameConvexPolygon2d(frameConvexPolygon2d);
 update();
}

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

private void updateFootGraphics()
  {
   stanceFootGraphic.setPose(stanceFootPose);
   stanceFootGraphic.updateConvexPolygon2d(footPolygon);
   swingStartGraphic.setPose(swingStartPose);
   swingStartGraphic.updateConvexPolygon2d(footPolygon);
   swingEndGraphic.setPose(swingEndPose);
   swingEndGraphic.updateConvexPolygon2d(footPolygon);
  }
}

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

@Override
public YoGraphicPolygon duplicate(YoVariableRegistry newRegistry)
{
 if (isUsingYawPitchRoll())
   return new YoGraphicPolygon(getName(), yoFrameConvexPolygon2d.duplicate(newRegistry), yoFramePoint.duplicate(newRegistry),
                 yoFrameYawPitchRoll.duplicate(newRegistry), scale, height, appearance);
 else
   return new YoGraphicPolygon(getName(), yoFrameConvexPolygon2d.duplicate(newRegistry), yoFramePoint.duplicate(newRegistry),
                 yoFrameQuaternion.duplicate(newRegistry), scale, height, appearance);
}

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

@Override
public void goalWasSet(RigidBodyTransform goalLeftFootPose, RigidBodyTransform goalRightFootPose)
{
 plannerUpdateIndex.increment();
 footstepGoalsViz.get(RobotSide.LEFT).setTransformToWorld(goalLeftFootPose);
 footstepGoalsViz.get(RobotSide.RIGHT).setTransformToWorld(goalRightFootPose);
 footstepGoalsViz.get(RobotSide.LEFT).update();
 footstepGoalsViz.get(RobotSide.RIGHT).update();
 tickAndUpdate();
}

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

RobotSide robotSide = nodeToExpand.getRobotSide();
acceptedFootstepsViz.get(robotSide).setPoseToNaN();
rejectedFootstepsViz.get(robotSide).setPoseToNaN();
nodeRejectedReason.set(null);
footstepUnderConsiderationViz.setTransformToWorld(soleTransform);
footstepUnderConsiderationViz.update();
tickAndUpdate();

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

private YoGraphicPolygon createStaticFootstep(String name, FramePose3D framePose, AppearanceDefinition appearance, YoVariableRegistry registry,
                       YoGraphicsListRegistry yoGraphicsListRegistry)
{
 YoFramePoseUsingYawPitchRoll footstepYoFramePose = new YoFramePoseUsingYawPitchRoll(name + "FramePose", ReferenceFrame.getWorldFrame(), registry);
 footstepYoFramePose.set(framePose);
 YoGraphicPolygon footstepYoGraphicPolygon = new YoGraphicPolygon(name + "YoGraphicPolygon", footstepYoFramePose, defaultFootPolygon.getNumberOfVertices(),
                                  registry, 1.0, appearance);
 footstepYoGraphicPolygon.updateConvexPolygon2d(defaultFootPolygon);
 yoGraphicsListRegistry.registerYoGraphic(getClass().getSimpleName(), footstepYoGraphicPolygon);
 return footstepYoGraphicPolygon;
}

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

leftFootstepStartViz = new YoGraphicPolygon("leftFootstepStartViz", leftFootstepStart, "leftFootstepStartPose", "", registry, 1.0, YoAppearance.Gold());
rightFootstepStartViz = new YoGraphicPolygon("rightFootstepStartViz", rightFootstepStart, "rightFootstepStartPose", "", registry, 1.0, YoAppearance.Gold());
leftFootstepGoalViz = new YoGraphicPolygon("leftFootstepGoalViz", leftFootstepGoal, "leftFootstepGoalPose", "", registry, 1.0, YoAppearance.Chocolate());
rightFootstepGoalViz = new YoGraphicPolygon("rightFootstepGoalViz", rightFootstepGoal, "rightFootstepGoalPose", "", registry, 1.0, YoAppearance.Chocolate());
leftFootstepToExpandViz = new YoGraphicPolygon("leftFootstepToExpandViz", leftFootstepUnderConsideration, "leftFootstepToExpandPose", "", registry, 1.0, YoAppearance.Yellow());
rightFootstepToExpandViz = new YoGraphicPolygon("rightFootstepToExpandViz", rightFootstepUnderConsideration, "rightFootstepToExpandPose", "", registry, 1.0, YoAppearance.Yellow());
leftAcceptedFootstepViz = new YoGraphicPolygon("leftAcceptedFootstepViz", leftAcceptedFootstep, "leftAcceptedFootstepPose", "", registry, 1.0, YoAppearance.Green());
rightAcceptedFootstepViz = new YoGraphicPolygon("rightAcceptedFootstepViz", rightAcceptedFootstep, "rightAcceptedFootstepPose", "", registry, 1.0, YoAppearance.DarkGreen());
leftRejectedFootstepViz = new YoGraphicPolygon("leftRejectedFootstepViz", leftRejectedFootstep, "leftRejectedFootstepPose", "", registry, 1.0, YoAppearance.Red());
rightRejectedFootstepViz = new YoGraphicPolygon("rightRejectedFootstepViz", rightRejectedFootstep, "rightRejectedFootstepPose", "", registry, 1.0, YoAppearance.DarkRed());
leftFootstepStartViz.setPoseToNaN();
rightFootstepStartViz.setPoseToNaN();
leftFootstepGoalViz.setPoseToNaN();
rightFootstepGoalViz.setPoseToNaN();
leftFootstepToExpandViz.setPoseToNaN();
rightFootstepToExpandViz.setPoseToNaN();
leftAcceptedFootstepViz.setPoseToNaN();
rightAcceptedFootstepViz.setPoseToNaN();
leftRejectedFootstepViz.setPoseToNaN();
rightRejectedFootstepViz.setPoseToNaN();
  YoGraphicPolygon leftFootstepSolvedPlanViz = new YoGraphicPolygon("leftFootstepSolvedPlanViz" + i, leftFootstepSolvedPlan, "leftFootstepSolvedPlan" + i, "", registry, 1.0, YoAppearance.Purple());
  graphicsListRegistry.registerYoGraphic("FootstepPlanner", leftFootstepSolvedPlanViz);
  YoGraphicPolygon rightFootstepSolvedPlanViz = new YoGraphicPolygon("rightFootstepSolvedPlanViz" + i, rightFootstepSolvedPlan, "rightFootstepSolvedPlan" + i, "", registry, 1.0, YoAppearance.Purple());
  graphicsListRegistry.registerYoGraphic("FootstepPlanner", rightFootstepSolvedPlanViz);
  leftFootstepSolvedPlanViz.setPoseToNaN();

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

polygonToSnapViz.update();
  snappedPolygonViz.update();
  return;
snappedPolygonViz.update();
  snappedPolygonViz.updateConvexPolygon2d(partialFootholdPolygon);
  snappedPolygonViz.updateConvexPolygon2d(snappedPolygon);

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

@Override
     public void doControl()
     {
      stanceFootPolygon.setYawPitchRoll(0.0, stanceFootPitch.getDoubleValue(), 0.0);
      stanceFramePose.setOrientationYawPitchRoll(0.0, stanceFootPitch.getDoubleValue(), 0.0);

      FramePose3D candidateFramePose = new FramePose3D(ReferenceFrame.getWorldFrame());

//            applySlopeCandidateSet(candidateFramePose, xYoVariable, yYoVariable);
      applyVerticalCandidateSet(candidateFramePose, xYoVariable, yYoVariable);

      double cost = stepAdjustmentCostCalculator.calculateCost(stanceFramePose, swingStartFramePose, idealFramePose, candidateFramePose, 1.0);
      costYoVariable.set(cost);

      if (candidateIndex.getIntegerValue() == 0)
      {
        for (YoGraphicPolygon candidateFootstepPolygon : candidateFootstepPolygons.values())
        {
         candidateFootstepPolygon.setPoseToNaN();
        }
      }
      candidateFootstepPolygons.get(candidateIndex.getIntegerValue()).setPose(candidateFramePose);
      candidateFootstepPolygons.get(candidateIndex.getIntegerValue()).updateAppearance(getAppearanceForCost(costYoVariable.getDoubleValue()));
     }
   });

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

yoGraphicPolygon.setPose(soleFramePose);
index++;

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

private void hideExpandingFootstepViz()
{
 for (RobotSide robotSide : RobotSide.values)
 {
   footstepsUnderConsiderationViz.get(robotSide).setPoseToNaN();
   acceptedFootstepsViz.get(robotSide).setPoseToNaN();
   rejectedFootstepsViz.get(robotSide).setPoseToNaN();
 }
}

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

@Override
public void nodeUnderConsiderationWasRejected(BipedalFootstepPlannerNode rejectedNode, BipedalFootstepPlannerNodeRejectionReason reason)
{
 plannerUpdateIndex.increment();
 RobotSide robotSide = rejectedNode.getRobotSide();
 RigidBodyTransform soleTransform = new RigidBodyTransform();
 rejectedNode.getSoleTransform(soleTransform);
 nodeIsAtGoal.get(robotSide).set(rejectedNode.isAtGoal());
 if (verbose)
 {
   System.out.println("Node rejected:");
   System.out.println(rejectedNode);
 }
 footstepsUnderConsiderationViz.get(robotSide).setPoseToNaN();
 acceptedFootstepsViz.get(robotSide).setPoseToNaN();
 YoGraphicPolygon rejectedFootstepViz = rejectedFootstepsViz.get(robotSide);
 rejectedFootstepViz.setTransformToWorld(soleTransform);
 moveUpSlightlyToEnsureVisible(rejectedFootstepViz);
 rejectedFootstepViz.update();
 nodeRejectedReason.set(reason);
 tickAndUpdate();
}

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

private void createCandidateFootstep(String name, int index, YoVariableRegistry registry, YoGraphicsListRegistry yoGraphicsListRegistry)
{
 YoFramePoseUsingYawPitchRoll footstepYoFramePose = new YoFramePoseUsingYawPitchRoll(name + index + "FramePose", ReferenceFrame.getWorldFrame(), registry);
 footstepYoFramePose.setToNaN();
 YoGraphicPolygon footstepYoGraphicPolygon = new YoGraphicPolygon(name + index + "YoGraphicPolygon", footstepYoFramePose,
                                  defaultFootPolygon.getNumberOfVertices(), registry, 1.0, YoAppearance.Red());
 footstepYoGraphicPolygon.updateConvexPolygon2d(defaultFootPolygon);
 candidateFootstepPolygons.put(index, footstepYoGraphicPolygon);
 yoGraphicsListRegistry.registerYoGraphic(getClass().getSimpleName(), footstepYoGraphicPolygon);
}

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

private void setPlanVizToNaN()
{
 for (RobotSide robotSide : RobotSide.values)
 {
   ArrayList<YoGraphicPolygon> polygonsViz = solvedPlanFootstepsViz.get(robotSide);
   for (YoGraphicPolygon polygonViz : polygonsViz)
   {
    polygonViz.setPoseToNaN();
   }
 }
}

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

public FootstepVisualizer(String name, String graphicListName, RobotSide robotSide, ContactablePlaneBody contactableFoot, AppearanceDefinition footstepColor,
   YoGraphicsListRegistry yoGraphicsListRegistry, YoVariableRegistry registry)
{
 this.robotSide = robotSide;
 yoFootstepPose = new YoFramePose(name + "Pose", worldFrame, registry);
 yoFoothold = new YoFrameConvexPolygon2d(name + "Foothold", "", worldFrame, maxNumberOfContactPoints, registry);
 double coordinateSystemSize = 0.2;
 double footholdScale = 1.0;
 poseViz = new YoGraphicCoordinateSystem(name + "Pose", yoFootstepPose, coordinateSystemSize, footstepColor);
 footholdViz = new YoGraphicPolygon(name + "Foothold", yoFoothold, yoFootstepPose, footholdScale, footstepColor);
 yoGraphicsListRegistry.registerYoGraphic(graphicListName, poseViz);
 yoGraphicsListRegistry.registerYoGraphic(graphicListName, footholdViz);
 List<FramePoint2d> contactPoints2d = contactableFoot.getContactPoints2d();
 for (int i = 0; i < contactPoints2d.size(); i++)
   defaultContactPointsInSoleFrame.add(contactPoints2d.get(i).getPointCopy());
}

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

public void updateConvexPolygon2d(FrameConvexPolygon2DReadOnly frameConvexPolygon2d)
{
 yoFrameConvexPolygon2d.set(frameConvexPolygon2d);
 update();
}

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

@Override
public void startNodeWasAdded(BipedalFootstepPlannerNode startNode)
{
 plannerUpdateIndex.increment();
 
 RobotSide robotSide = startNode.getRobotSide();
 hideExpandingFootstepViz();
 
 RigidBodyTransform soleTransform = new RigidBodyTransform();
 startNode.getSoleTransform(soleTransform);
 YoGraphicPolygon startNodeViz = footstepStartsViz.get(robotSide);
 startNodeViz.setTransformToWorld(soleTransform);
 moveUpSlightlyToEnsureVisible(startNodeViz);
 startNodeViz.update();
 
 YoGraphicPolygon otherStartNodesViz = footstepStartsViz.get(robotSide.getOppositeSide());
 otherStartNodesViz.setPoseToNaN();
 tickAndUpdate();
}

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

public Controller(YoGraphicsListRegistry graphicsListRegistry)
{
  for (int i = 0; i < numberOfPoints; i++)
  {
   YoFramePoint3D yoPoint = new YoFramePoint3D("Position" + i, ReferenceFrame.getWorldFrame(), registry);
   YoGraphicPosition position = new YoGraphicPosition("Position" + i, yoPoint, 0.02, YoAppearance.Blue());
   points.add(yoPoint);
   graphicsListRegistry.registerYoGraphic("BodyPath", position);
  }
  YoFrameConvexPolygon2D yoDefaultFootPolygon = new YoFrameConvexPolygon2D("DefaultFootPolygon", ReferenceFrame.getWorldFrame(), 4, registry);
  yoDefaultFootPolygon.set(PlannerTools.createDefaultFootPolygon());
  for (RobotSide side : RobotSide.values)
  {
   AppearanceDefinition appearance = side == RobotSide.RIGHT ? YoAppearance.Green() : YoAppearance.Red();
   ArrayList<YoFramePoseUsingYawPitchRoll> poses = new ArrayList<>();
   for (int i = 0; i < stepsPerSide; i++)
   {
     YoFramePoseUsingYawPitchRoll yoFootstepPose = new YoFramePoseUsingYawPitchRoll("footPose" + side.getCamelCaseName() + i, ReferenceFrame.getWorldFrame(), registry);
     YoGraphicPolygon footstepViz = new YoGraphicPolygon("footstep" + side.getCamelCaseName() + i, yoDefaultFootPolygon, yoFootstepPose, 1.0,
                               appearance);
     poses.add(yoFootstepPose);
     yoFootstepPose.setToNaN();
     graphicsListRegistry.registerYoGraphic("viz", footstepViz);
   }
   yoSteps.put(side, poses);
  }
  planner.setTimeout(1.0);
}

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