gpt4 book ai didi

us.ihmc.robotics.math.frames.YoFramePointInMultipleFrames.switchCurrentReferenceFrame()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-14 01:57:31 25 4
gpt4 key购买 nike

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

YoFramePointInMultipleFrames.switchCurrentReferenceFrame介绍

[英]Change the current reference frame and set to zero the coordinates (different from changeFrame() ).
[中]更改当前参考帧并将坐标设置为零(与changeFrame()不同)。

代码示例

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

private void switchCornerPointsToWorldFrame()
{
 for (int i = 0; i < entryCornerPoints.size(); i++)
   entryCornerPoints.get(i).switchCurrentReferenceFrame(worldFrame);
 for (int i = 0; i < exitCornerPoints.size(); i++)
   exitCornerPoints.get(i).switchCurrentReferenceFrame(worldFrame);
}

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

singleSupportInitialICP.switchCurrentReferenceFrame(worldFrame);
singleSupportFinalICP.switchCurrentReferenceFrame(worldFrame);

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

private void computeFinalCMPBetweenSupportFeet(int cmpIndex, FrameConvexPolygon2d footA, FrameConvexPolygon2d footB)
{
 footA.getCentroid(tempCentroid);
 firstCMP.setXYIncludingFrame(tempCentroid);
 firstCMP.changeFrame(worldFrame);
 footB.getCentroid(tempCentroid);
 secondCMP.setXYIncludingFrame(tempCentroid);
 secondCMP.changeFrame(worldFrame);
 upcomingSupport.clear(worldFrame);
 tempFootPolygon.setIncludingFrame(footA);
 tempFootPolygon.changeFrameAndProjectToXYPlane(worldFrame);
 upcomingSupport.addVertices(tempFootPolygon);
 tempFootPolygon.setIncludingFrame(footB);
 tempFootPolygon.changeFrameAndProjectToXYPlane(worldFrame);
 upcomingSupport.addVertices(tempFootPolygon);
 upcomingSupport.update();
 entryCMPs.get(cmpIndex).switchCurrentReferenceFrame(worldFrame);
 exitCMPs.get(cmpIndex).switchCurrentReferenceFrame(worldFrame);
 upcomingSupport.getCentroid(tempCentroid);
 tempCentroid3d.setXYIncludingFrame(tempCentroid);
 double chicken = MathTools.clipToMinMax(percentageChickenSupport.getDoubleValue(), 0.0, 1.0);
 if (chicken <= 0.5)
   entryCMPs.get(cmpIndex).interpolate(firstCMP, tempCentroid3d, chicken * 2.0);
 else
   entryCMPs.get(cmpIndex).interpolate(tempCentroid3d, secondCMP, (chicken-0.5) * 2.0);
 exitCMPs.get(cmpIndex).set(entryCMPs.get(cmpIndex));
}

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

@ContinuousIntegrationTest(estimatedDuration = 0.0)
@Test(timeout=300000)
public void testSetToZero()
{
 YoVariableRegistry registry = new YoVariableRegistry("youhou");
 YoFramePointInMultipleFrames yoFramePointInMultipleFrames = new YoFramePointInMultipleFrames("blop", registry, allFrames);
 yoFramePointInMultipleFrames.switchCurrentReferenceFrame(worldFrame);
 
 FramePoint3D framePoint = new FramePoint3D(worldFrame);
 framePoint.setToZero(worldFrame);
 assertTrue(framePoint.epsilonEquals(yoFramePointInMultipleFrames, 1e-10));
}

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

@ContinuousIntegrationTest(estimatedDuration = 0.0)
  @Test(timeout=300000)
  public void testSetIncludingFrame()
  {
   YoVariableRegistry registry = new YoVariableRegistry("youhou");
   YoFramePointInMultipleFrames yoFramePointInMultipleFrames = new YoFramePointInMultipleFrames("blop", registry, new ReferenceFrame[]{worldFrame, frameA});
   yoFramePointInMultipleFrames.switchCurrentReferenceFrame(worldFrame);
   
   FramePoint3D framePoint = EuclidFrameRandomTools.nextFramePoint3D(random, frameA, -100.0, 100.0, -100.0, 100.0, -100.0, 100.0);
   
   yoFramePointInMultipleFrames.setIncludingFrame(framePoint);
   assertTrue(framePoint.epsilonEquals(yoFramePointInMultipleFrames, 1e-10));
   
   try
   {
     yoFramePointInMultipleFrames.setIncludingFrame(new FramePoint3D(frameC));
     fail("Should have thrown an exception");
   }
   catch (Exception e)
   {
     // Good
   }
  }
}

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

List<YoFramePoint> exitCMPs = referenceCMPsCalculator.getExitCMPs();
switchCornerPointsToWorldFrame();
singleSupportInitialICP.switchCurrentReferenceFrame(worldFrame);
singleSupportFinalICP.switchCurrentReferenceFrame(worldFrame);

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

@ContinuousIntegrationTest(estimatedDuration = 0.0)
@Test(timeout=300000)
public void testChangeToRegisteredFrame()
{
 YoVariableRegistry registry = new YoVariableRegistry("youhou");
 YoFramePointInMultipleFrames yoFramePointInMultipleFrames = new YoFramePointInMultipleFrames("blop", registry, new ReferenceFrame[]{worldFrame, frameA});
 yoFramePointInMultipleFrames.switchCurrentReferenceFrame(worldFrame);
 
 FramePoint3D framePoint = new FramePoint3D(worldFrame);
 Point3D point = RandomGeometry.nextPoint3D(random, 100.0, 100.0, 100.0);
 
 yoFramePointInMultipleFrames.set(point);
 framePoint.set(point);
 
 yoFramePointInMultipleFrames.changeFrame(frameA);
 framePoint.changeFrame(frameA);
 
 assertTrue(framePoint.epsilonEquals(yoFramePointInMultipleFrames, 1e-10));
 
 try
 {
   yoFramePointInMultipleFrames.changeFrame(frameB);
   fail("Should have thrown an exception");
 }
 catch (Exception e)
 {
   // Good
 }
}

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