gpt4 book ai didi

us.ihmc.robotics.math.trajectories.YoSpline3D.setQuintic()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-14 15:47:31 26 4
gpt4 key购买 nike

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

YoSpline3D.setQuintic介绍

暂无

代码示例

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

private YoSpline3D generateRandomQuintic(Random random)
{
 YoVariableRegistry registry = new YoVariableRegistry("Spline3DTest");
  YoSpline3D spline = new YoSpline3D(6, 4, worldFrame, registry, "");
    double t0 = random.nextDouble() - 1;
  double tf = random.nextDouble();
  FramePoint3D p0 = new FramePoint3D(worldFrame, 2 * (random.nextDouble() - 1), 2 * (random.nextDouble() - 1), 2 * (random.nextDouble() - 1));
  FrameVector3D pd0 = new FrameVector3D(worldFrame, 2 * (random.nextDouble() - 1), 2 * (random.nextDouble() - 1), 2 * (random.nextDouble() - 1));
  FrameVector3D pdd0 = new FrameVector3D(worldFrame, 2 * (random.nextDouble() - 1), 2 * (random.nextDouble() - 1), 2 * (random.nextDouble() - 1));   
  FramePoint3D pf = new FramePoint3D(worldFrame, 2 * (random.nextDouble() - 1), 2 * (random.nextDouble() - 1), 2 * (random.nextDouble() - 1));
  FrameVector3D pdf = new FrameVector3D(worldFrame, 2 * (random.nextDouble() - 1), 2 * (random.nextDouble() - 1), 2 * (random.nextDouble() - 1));
  FrameVector3D pddf = new FrameVector3D(worldFrame, 2 * (random.nextDouble() - 1), 2 * (random.nextDouble() - 1), 2 * (random.nextDouble() - 1)); 	   
  spline.setQuintic(t0, tf, p0, pd0, pdd0, pf, pdf, pddf);
    assertEquals(t0, spline.getT0(), 1e-7);
  assertEquals(tf, spline.getTf(), 1e-7);
  assertEquals(Math.abs(tf - t0), spline.getTotalTime(), 1e-7);
  assertEquals(spline.getArcLength(), spline.getArcLength(t0, tf), 1e-7);
  return spline;
}

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

splines.get(2).compute(tf);
FrameVector3D pddf = splines.get(2).getAccelerationCopy();
spline.setQuintic(t0, tf, p0, pd0, pdd0, pf, pdf, pddf);

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

public void setQuintics(double[] times, FramePoint3D[] positions, FrameVector3D[] velocities, FrameVector3D[] accelerations)
{
 MathTools.checkEquals(times.length, rangeList.size() + 1);
 MathTools.checkEquals(positions.length, times.length);
 MathTools.checkEquals(velocities.length, times.length);
 MathTools.checkEquals(accelerations.length, times.length);
 for (int i = 0; i < times.length - 1; i++)
 {
   YoSpline3D spline = splines.get(i);
   double t0 = times[i];
   double tf = times[i + 1];
   FramePoint3D p0 = positions[i];
   FramePoint3D pf = positions[i + 1];
   FrameVector3D pd0 = velocities[i];
   FrameVector3D pdf = velocities[i + 1];
   FrameVector3D pdd0 = accelerations[i];
   FrameVector3D pddf = accelerations[i + 1];
   spline.setQuintic(t0, tf, p0, pd0, pdd0, pf, pdf, pddf);
   rangeList.get(i).getLeft().set(t0);
   rangeList.get(i).getRight().set(tf);
 }
 setArcLength();
}

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

splines.get(2).compute(tf);
FrameVector pddf = splines.get(2).getAccelerationCopy();
spline.setQuintic(t0, tf, p0, pd0, pdd0, pf, pdf, pddf);

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

public void setQuintics(double[] times, FramePoint[] positions, FrameVector[] velocities, FrameVector[] accelerations)
{
 MathTools.checkIfEqual(times.length, rangeList.size() + 1);
 MathTools.checkIfEqual(positions.length, times.length);
 MathTools.checkIfEqual(velocities.length, times.length);
 MathTools.checkIfEqual(accelerations.length, times.length);
 for (int i = 0; i < times.length - 1; i++)
 {
   YoSpline3D spline = splines.get(i);
   double t0 = times[i];
   double tf = times[i + 1];
   FramePoint p0 = positions[i];
   FramePoint pf = positions[i + 1];
   FrameVector pd0 = velocities[i];
   FrameVector pdf = velocities[i + 1];
   FrameVector pdd0 = accelerations[i];
   FrameVector pddf = accelerations[i + 1];
   spline.setQuintic(t0, tf, p0, pd0, pdd0, pf, pdf, pddf);
   rangeList.get(i).getLeft().set(t0);
   rangeList.get(i).getRight().set(tf);
 }
 setArcLength();
}

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

FrameVector pdf = splines.get(2).getVelocityCopy();
FrameVector pddf = splines.get(2).getAccelerationCopy();
spline.setQuintic(t0, tf, p0, pd0, pdd0, pf, pdf, pddf);
splines.get(1).compute(splines.get(1).getT0());

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

splines.get(3).compute(tf);
FrameVector pddf = splines.get(3).getAccelerationCopy();
spline.setQuintic(t0, tf, p0, pd0, pdd0, pf, pdf, pddf);

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

splines.get(2).compute(tf);
FrameVector pddf = splines.get(2).getAccelerationCopy();
spline.setQuintic(t0, tf, p0, pd0, pdd0, pf, pdf, pddf);

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

splines.get(2).compute(tf);
FrameVector3D pddf = splines.get(2).getAccelerationCopy();
spline.setQuintic(t0, tf, p0, pd0, pdd0, pf, pdf, pddf);

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

FrameVector3D pdf = splines.get(2).getVelocityCopy();
FrameVector3D pddf = splines.get(2).getAccelerationCopy();
spline.setQuintic(t0, tf, p0, pd0, pdd0, pf, pdf, pddf);
splines.get(1).compute(splines.get(1).getT0());

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

splines.get(2).compute(tf);
FrameVector3D pddf = splines.get(2).getAccelerationCopy();
spline.setQuintic(t0, tf, p0, pd0, pdd0, pf, pdf, pddf);

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

splines.get(3).compute(tf);
FrameVector3D pddf = splines.get(3).getAccelerationCopy();
spline.setQuintic(t0, tf, p0, pd0, pdd0, pf, pdf, pddf);

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

splines.get(3).compute(tf);
FrameVector3D pddf = splines.get(3).getAccelerationCopy();
spline.setQuintic(t0, tf, p0, pd0, pdd0, pf, pdf, pddf);

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

splines.get(3).compute(tf);
FrameVector pddf = splines.get(3).getAccelerationCopy();
spline.setQuintic(t0, tf, p0, pd0, pdd0, pf, pdf, pddf);

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

splines.get(2).compute(tf);
FrameVector pddf = splines.get(2).getAccelerationCopy();
spline.setQuintic(t0, tf, p0, pd0, pdd0, pf, pdf, pddf);

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

public void setQuintics(YoConcatenatedSplines oldSplines, double[] oldTimes, double[] newTimes)
{
 MathTools.checkEquals(oldTimes.length, newTimes.length);
 MathTools.checkEquals(oldTimes.length, rangeList.size() + 1);
 for (int i = 0; i < oldTimes.length - 1; i++)
 {
   YoSpline3D spline = splines.get(i);
   oldSplines.compute(oldTimes[i]);
   double t0 = newTimes[i];
   FramePoint3D p0 = oldSplines.getPosition();
   FrameVector3D pd0 = oldSplines.getVelocity();
   FrameVector3D pdd0 = oldSplines.getAcceleration();
   oldSplines.compute(oldTimes[i + 1]);
   double tf = newTimes[i + 1];
   FramePoint3D pf = oldSplines.getPosition();
   FrameVector3D pdf = oldSplines.getVelocity();
   FrameVector3D pddf = oldSplines.getAcceleration();
   spline.setQuintic(t0, tf, p0, pd0, pdd0, pf, pdf, pddf);
   rangeList.get(i).getLeft().set(t0);
   rangeList.get(i).getRight().set(tf);
 }
 setArcLength();
}

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

public void setQuintics(YoConcatenatedSplines oldSplines, double[] oldTimes, double[] newTimes)
{
 MathTools.checkIfEqual(oldTimes.length, newTimes.length);
 MathTools.checkIfEqual(oldTimes.length, rangeList.size() + 1);
 for (int i = 0; i < oldTimes.length - 1; i++)
 {
   YoSpline3D spline = splines.get(i);
   oldSplines.compute(oldTimes[i]);
   double t0 = newTimes[i];
   FramePoint p0 = oldSplines.getPosition();
   FrameVector pd0 = oldSplines.getVelocity();
   FrameVector pdd0 = oldSplines.getAcceleration();
   oldSplines.compute(oldTimes[i + 1]);
   double tf = newTimes[i + 1];
   FramePoint pf = oldSplines.getPosition();
   FrameVector pdf = oldSplines.getVelocity();
   FrameVector pddf = oldSplines.getAcceleration();
   spline.setQuintic(t0, tf, p0, pd0, pdd0, pf, pdf, pddf);
   rangeList.get(i).getLeft().set(t0);
   rangeList.get(i).getRight().set(tf);
 }
 setArcLength();
}

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

splines.get(2).compute(tf);
FrameVector pddf = splines.get(2).getAccelerationCopy();
spline.setQuintic(t0, tf, p0, pd0, pdd0, pf, pdf, pddf);

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

splines.get(2).compute(tf);
FrameVector3D pddf = splines.get(2).getAccelerationCopy();
spline.setQuintic(t0, tf, p0, pd0, pdd0, pf, pdf, pddf);

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

@ContinuousIntegrationTest(estimatedDuration = 0.0)
@Test(timeout = 30000)
public void testQuintic()
{
 YoVariableRegistry registry = new YoVariableRegistry("Spline3DTest");
  YoSpline3D quintic = new YoSpline3D(6, 4, worldFrame, registry, "");
  // quintic is constructed such that x(t) = t^5 - t^3 + t - 1, y(t) = 2t^5 - 4, z(t) = t^5 + 2t^4
  double t0 = 0.0;
  double tf = 1.0;
  FramePoint3D p0 = new FramePoint3D(worldFrame, -1.0, -4.0, 0.0);
  FrameVector3D pd0 = new FrameVector3D(worldFrame, 1.0, 0.0, 0.0);
  FrameVector3D pdd0 = new FrameVector3D(worldFrame, 0.0, 0.0, 0.0);   
  FramePoint3D pf = new FramePoint3D(worldFrame, 0.0, -2.0, 3.0);
  FrameVector3D pdf = new FrameVector3D(worldFrame, 3.0, 10.0, 13.0);
  FrameVector3D pddf = new FrameVector3D(worldFrame, 14.0, 40.0, 44.0);
  quintic.setQuintic(t0, tf, p0, pd0, pdd0, pf, pdf, pddf);
    FramePoint3D expected = new FramePoint3D(worldFrame, -0.59375, -3.9375, 0.15625);
  quintic.compute(0.5);
  FramePoint3D actual = quintic.getPositionCopy();
   
  for (Axis axis : Axis.values())
  {
   assertEquals(expected.getElement(axis.ordinal()), actual.getElement(axis.ordinal()), EPSILON);
  }   
}

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