gpt4 book ai didi

us.ihmc.yoVariables.variable.YoFrameQuaternion.interpolate()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 07:34:49 28 4
gpt4 key购买 nike

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

YoFrameQuaternion.interpolate介绍

暂无

代码示例

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

public void compute(double time)
{
 if (continuouslyUpdateFinalOrientation.getBooleanValue())
   updateFinalOrientation();
 this.currentTime.set(time);
 time = MathTools.clamp(time, 0.0, trajectoryTime.getDoubleValue());
 parameterPolynomial.compute(time);
 
 double parameter = isDone() ? 1.0 : parameterPolynomial.getPosition();
 desiredOrientation.interpolate(initialOrientation, finalOrientation, parameter);
 double parameterd = isDone() ? 0.0 : parameterPolynomial.getVelocity();
 orientationInterpolationCalculator.computeAngularVelocity(desiredAngularVelocity, initialOrientation, finalOrientation, parameterd);
 double parameterdd = isDone() ? 0.0 : parameterPolynomial.getAcceleration();
 orientationInterpolationCalculator.computeAngularAcceleration(desiredAngularAcceleration, initialOrientation, finalOrientation, parameterdd);
}

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

@ContinuousIntegrationTest(estimatedDuration = 0.0)
  @Test(timeout=300000)
  public void testInterpolate()
  {
   Random random = new Random(1776L);

   YoVariableRegistry registry = new YoVariableRegistry("blop");

   FrameQuaternion initialFrameOrientation = EuclidFrameRandomTools.nextFrameQuaternion(random, worldFrame);
   FrameQuaternion finalFrameOrientation = EuclidFrameRandomTools.nextFrameQuaternion(random, worldFrame);
   FrameQuaternion interpolatedFrameOrientation = new FrameQuaternion(worldFrame);

   YoFrameQuaternion initialYoFrameQuaternion = new YoFrameQuaternion("init", worldFrame, registry);
   initialYoFrameQuaternion.set(initialFrameOrientation);
   YoFrameQuaternion finalYoFrameQuaternion = new YoFrameQuaternion("final", worldFrame, registry);
   finalYoFrameQuaternion.set(finalFrameOrientation);
   YoFrameQuaternion interpolatedYoFrameQuaternion = new YoFrameQuaternion("interpolated", worldFrame, registry);

   FrameQuaternion temp = new FrameQuaternion();
   for (double alpha = -0.1; alpha <= 1.1; alpha += 0.05)
   {
     interpolatedFrameOrientation.interpolate(initialFrameOrientation, finalFrameOrientation, alpha);
     interpolatedYoFrameQuaternion.interpolate(initialYoFrameQuaternion, finalYoFrameQuaternion, alpha);
     temp.setIncludingFrame(interpolatedYoFrameQuaternion);

     assertTrue(interpolatedFrameOrientation.epsilonEquals(temp, EPS));
   }
  }
}

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

@Override
public void compute(double time)
{
 currentTime.set(time);
 time = MathTools.clamp(time, 0.0, trajectoryTime.getDoubleValue());
 parameterPolynomial.compute(time);
 boolean shouldBeZero = isDone() || currentTime.getDoubleValue() < 0.0;
 double alphaDot = shouldBeZero ? 0.0 : parameterPolynomial.getVelocity();
 double alphaDDot = shouldBeZero ? 0.0 : parameterPolynomial.getAcceleration();
 if (!isDone())
 {
   currentOrientation.interpolate(initialOrientation, finalOrientation, parameterPolynomial.getPosition());
   orientationInterpolationCalculator.computeAngularVelocity(currentAngularVelocity, initialOrientation, finalOrientation, alphaDot);
   orientationInterpolationCalculator.computeAngularAcceleration(currentAngularAcceleration, initialOrientation, finalOrientation, alphaDDot);
 }
 else
 {
   currentOrientation.set(finalOrientation);
   currentAngularVelocity.setToZero();
   currentAngularAcceleration.setToZero();
 }
}

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