gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-16 05:26:40 27 4
gpt4 key购买 nike

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

YoPolynomial.setDirectly介绍

[英]Set a specific coefficient of the polynomial. A sequence of calls to this function should typically be followed by a call to reshape(int) later.
[中]设置多项式的特定系数。对该函数的一系列调用之后,通常应该再调用整形(int)。

代码示例

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

public void setDirectly(DenseMatrix64F coefficients)
{
 polynomial.setDirectly(coefficients);
}

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

public void setDirectlyReverse(double[] coefficients)
{
 ArrayUtils.reverse(coefficients);
 setDirectly(coefficients);
}

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

public void setDirectlyReverse(double[] coefficients)
{
 ArrayUtils.reverse(coefficients);
 setDirectly(coefficients);
}

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

@ContinuousIntegrationTest(estimatedDuration = 0.0)
@Test(timeout = 30000)
public void testGetPosition()
{
 Random random = new Random(165L);
 int order = 5;
 YoPolynomial spline = new YoPolynomial("test", order, registry);
 double[] coefficients = getRandomCoefficients(order, random);
 spline.setDirectly(coefficients);
 double x = random.nextDouble();
 spline.compute(x);
 double y = spline.getPosition();
 double yCheck = coefficients[0] + coefficients[1] * x + coefficients[2] * x * x + coefficients[3] * x * x * x + coefficients[4] * x * x * x * x;
 assertEquals(yCheck, y, 1e-12);
}

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

@ContinuousIntegrationTest(estimatedDuration = 0.0)
@Test(timeout = 30000)
public void testGetIntegral()
{
 int order = 5;
 YoPolynomial spline = new YoPolynomial("test", order, registry);
 double[] coefficients = new double[]{2.0, 6.0, 9.0, 4.0, 10.0};
 spline.setDirectly(coefficients);
 
 double from = 1.0;
 double to = 2.0;
 double expected = 109.0;
 double actual = spline.getIntegral(from, to);
 assertEquals(expected, actual, 1e-12);
}

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

yoPolynomial.setDirectly(coefficients);
ParameterPolynomial parameterPolynomial = new ParameterPolynomial("Parameter", coefficients, registry);

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

@ContinuousIntegrationTest(estimatedDuration = 0.0)
@Test(timeout = 30000)
public void testGetAcceleration()
{
 Random random = new Random(1675L);
 int order = 5;
 YoPolynomial spline = new YoPolynomial("test", order, registry);
 double[] coefficients = getRandomCoefficients(order, random);
 spline.setDirectly(coefficients);
 double x = random.nextDouble();
 double dx = 1e-9;
 spline.compute(x);
 double d2ydx2 = spline.getAcceleration();
 double dydxx = spline.getVelocity();
 spline.compute(x + dx);
 double dydxxPlusdx = spline.getVelocity();
 double d2ydx2Numerical = (dydxxPlusdx - dydxx) / dx;
 assertEquals(d2ydx2Numerical, d2ydx2, 1e-6);
}

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

@ContinuousIntegrationTest(estimatedDuration = 0.0)
@Test(timeout = 30000)
public void testGetVelocity()
{
 Random random = new Random(1675L);
 int order = 5;
 YoPolynomial spline = new YoPolynomial("test", order, registry);
 double[] coefficients = getRandomCoefficients(order, random);
 spline.setDirectly(coefficients);
 double x = random.nextDouble();
 double dx = 1e-9;
 spline.compute(x);
 double yx = spline.getPosition();
 double dydx = spline.getVelocity();
 spline.compute(x + dx);
 double yxPlusdx = spline.getPosition();
 double dydxNumerical = (yxPlusdx - yx) / dx;
 assertEquals(dydxNumerical, dydx, 1e-6);
}

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

public void set(Trajectory trajectory)
  {
   reshape(trajectory.getNumberOfCoefficients());
   this.tInitial.set(trajectory.getInitialTime());
   this.tFinal.set(trajectory.getFinalTime());
   for(int i = 0; i < getNumberOfCoefficients(); i++)
     polynomial.setDirectly(i, trajectory.getCoefficient(i));
  }
}

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