gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-13 21:36:03 27 4
gpt4 key购买 nike

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

YoMinimumJerkTrajectory.<init>介绍

暂无

代码示例

代码示例来源:origin: us.ihmc/ihmc-whole-body-controller

private void createTransitionSplines()
{
 for (int i = 0; i < oneDoFJoints.size(); i++)
 {
   OneDoFJointBasics oneDoFJoint = oneDoFJoints.get(i);
   YoMinimumJerkTrajectory spline = new YoMinimumJerkTrajectory(oneDoFJoint.getName() + "TransitionSpline", registry);
   transitionSplines.put(oneDoFJoint, spline);
   //       spline.setParams(initialPositions.get(oneDoFJoint), 0.0, 0.0, finalPositions.get(oneDoFJoint), 0.0, 0.0, 0.0, 3.0);
   YoDouble desiredPosition = new YoDouble("q_d_" + oneDoFJoint.getName(), registry);
   YoDouble desiredVelocity = new YoDouble("qd_d_" + oneDoFJoint.getName(), registry);
   desiredPositions.put(oneDoFJoint, desiredPosition);
   desiredVelocities.put(oneDoFJoint, desiredVelocity);
 }
}

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

private void createTransitionSplines()
{
 for (int i = 0; i < oneDoFJoints.size(); i++)
 {
   OneDoFJoint oneDoFJoint = oneDoFJoints.get(i);
   YoMinimumJerkTrajectory spline = new YoMinimumJerkTrajectory(oneDoFJoint.getName() + "TransitionSpline", registry);
   transitionSplines.put(oneDoFJoint, spline);
   //       spline.setParams(initialPositions.get(oneDoFJoint), 0.0, 0.0, finalPositions.get(oneDoFJoint), 0.0, 0.0, 0.0, 3.0);
   DoubleYoVariable desiredPosition = new DoubleYoVariable("q_d_" + oneDoFJoint.getName(), registry);
   DoubleYoVariable desiredVelocity = new DoubleYoVariable("qd_d_" + oneDoFJoint.getName(), registry);
   desiredPositions.put(oneDoFJoint, desiredPosition);
   desiredVelocities.put(oneDoFJoint, desiredVelocity);
 }
}

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

@ContinuousIntegrationTest(estimatedDuration = 0.1)
@Test(timeout = 30000)
public void testTimeExtensionRuntime()
{
 YoVariableRegistry registry = new YoVariableRegistry("TestMinimumJerkTrajectory");
 YoMinimumJerkTrajectory minimumJerkTrajectory = new YoMinimumJerkTrajectory("tester", registry);
 
 long starttime, endtime;
 double t = 0.0;
 double maxV = 10;
 double maxA = 10;
 int runs = 10000;
 starttime = System.nanoTime();
 Random random = new Random(107L);
 for (int i = 0; i < runs * 6; i++)
 {
   minimumJerkTrajectory.setParams(0.0, 0.0, 0.0, random.nextDouble() * 0.5 + 0.75, 0.0, 0.0, 0.0, 0.5);
   minimumJerkTrajectory.timeExtension(t, maxV, maxA, true);
 }
 endtime = System.nanoTime();
 double runtime = (endtime - starttime) / runs * 1.0e-6;
 System.out.println("TestMinimumJerkTrajectory.testTimeExtensionRuntime: Execution Time = " + (runtime) + "ms per 6 calls");
}

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

@ContinuousIntegrationTest(estimatedDuration = 0.0)
@Test(timeout = 30000)
public void testZeroLength()
{
 YoVariableRegistry registry = new YoVariableRegistry("TestMinimumJerkTrajectory");
 YoMinimumJerkTrajectory minimumJerkTrajectory = new YoMinimumJerkTrajectory("tester", registry);
 
 double t = 0.5e-7;
 double[] vals = new double[3];
 minimumJerkTrajectory.setParams(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0);
 minimumJerkTrajectory.computeTrajectoryDoubles(t, vals);
 if (Double.isNaN(vals[0]) || Double.isNaN(vals[1]) || Double.isNaN(vals[2]))
 {
   throw new RuntimeException("TestMinimumJerkTrajectory.testZeroLength: failed on zero displacement");
 }
 minimumJerkTrajectory.setParams(0.0, 0.0, 0.0, 10.0, 0.0, 0.0, 0.0, 0.0);
 minimumJerkTrajectory.computeTrajectoryDoubles(t, vals);
 if (Double.isNaN(vals[0]) || Double.isNaN(vals[1]) || Double.isNaN(vals[2]))
 {
   throw new RuntimeException("TestMinimumJerkTrajectory.testZeroLength: failed on zero time difference");
 }
 minimumJerkTrajectory.setParams(0.0, 0.0, 0.0, 10.0, 0.0, 0.0, 0.0, 0.5);
 double Tf = minimumJerkTrajectory.timeExtension(t, 0.0, 0.0, true);
 System.out.println("TestMinimumJerkTrajectory.testZeroLength: Extending with maximums at 0.0: Tf = " + Tf);
 System.out.flush();
}

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

@ContinuousIntegrationTest(estimatedDuration = 0.0)
  @Test(timeout = 30000)
  public void testBadInitialParams()
  {
   YoVariableRegistry registry = new YoVariableRegistry("TestMinimumJerkTrajectory");
   YoMinimumJerkTrajectory minimumJerkTrajectory = new YoMinimumJerkTrajectory("tester", registry);
   
   double maxV = 10;
   double maxA = 50;
   minimumJerkTrajectory.setParams(0.0, maxV * 1.1, 0.0, 1.0, 0.0, 0.0, 0.0, 0.05);
   double newTime = minimumJerkTrajectory.timeExtension(1e-7, maxV, maxA, true);
   if (newTime > 100000)
   {
     throw new RuntimeException("TestMinimumJerkTrajectory.testBadInitialParams: cannot find suitable time");
   }
   else
   {
     System.out.println("TestMinimumJerkTrajectory.testBadInitialParams: Tf = " + newTime);
   }
  }
}

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

@ContinuousIntegrationTest(estimatedDuration = 0.0)
@Test(timeout = 30000)
public void testFindMaxVals()
{
 YoVariableRegistry registry = new YoVariableRegistry("TestMinimumJerkTrajectory");
 YoMinimumJerkTrajectory minimumJerkTrajectory = new YoMinimumJerkTrajectory("tester", registry);
 
 double t = 0.0;
 double[] maximums = new double[2];
 double maxVexpected = 5.625;
 double maxAexpected = 34.641;
 double percent = 0.01;
 minimumJerkTrajectory.setParams(0.0, 0.0, 0.0, 1.5, 0.0, 0.0, 0.0, 0.5);
 minimumJerkTrajectory.findMaxVelocityAndAccel(t, maximums);
 if (!MathTools.percentEquals(maxVexpected, maximums[0], percent))
 {
   throw new RuntimeException("TestMinimumJerkTrajectory.testFindMaxVals: Max velocity is wrong: expected=" + maxVexpected + ", actual=" + maximums[0]);
 }
 if (!MathTools.percentEquals(maxAexpected, maximums[1], percent))
 {
   throw new RuntimeException("TestMinimumJerkTrajectory.testFindMaxVals: Max accel is wrong: expected=" + maxAexpected + ", actual=" + maximums[1]);
 }
}

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

@Ignore
@ContinuousIntegrationTest(estimatedDuration = 0.1, categoriesOverride = IntegrationCategory.EXCLUDE)
@Test(timeout=300000)
public void testTimeExtension()
{
 YoVariableRegistry registry = new YoVariableRegistry("TestMinimumJerkTrajectory");
 YoMinimumJerkTrajectory minimumJerkTrajectory = new YoMinimumJerkTrajectory("tester", registry);
 
 double t = 0.0;
 double maxV = 5.0;
 double maxA = 10.0;
 double expectedTime = 0.930605;
 minimumJerkTrajectory.setParams(0.0, 0.0, 0.0, 1.5, 0.0, 0.0, 0.0, 0.0);
 double newTime = minimumJerkTrajectory.timeExtension(t, maxV, maxA, true);
 if (!MathTools.percentEquals(expectedTime, newTime, 0.01))
 {
   throw new RuntimeException("TestMinimumJerkTrajectory.testTimeExtension: Returned desired time= " + newTime + ", expected= " + expectedTime);
 }
}

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

public ParabolicCartesianTrajectoryGenerator(String namePrefix, ReferenceFrame referenceFrame, DoubleProvider stepTimeProvider, double groundClearance,
    YoVariableRegistry parentRegistry)
{
 this.registry = new YoVariableRegistry(namePrefix + namePostFix);
 this.minimumJerkTrajectory = new YoMinimumJerkTrajectory(namePrefix, registry);
 this.parabolicTrajectoryGenerator = new YoParabolicTrajectoryGenerator(namePrefix, referenceFrame, registry);
 this.groundClearance = new DoubleYoVariable("groundClearance", registry);
 this.stepTime = new DoubleYoVariable("stepTime", registry);
 this.timeIntoStep = new DoubleYoVariable("timeIntoStep", registry);
 parentRegistry.addChild(registry);
 this.stepTimeProvider = stepTimeProvider;
 this.groundClearance.set(groundClearance);
}

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

public ParabolicCartesianTrajectoryGenerator(String namePrefix, ReferenceFrame referenceFrame, DoubleProvider stepTimeProvider, double groundClearance,
                      YoVariableRegistry parentRegistry)
{
 this.registry = new YoVariableRegistry(namePrefix + namePostFix);
 this.minimumJerkTrajectory = new YoMinimumJerkTrajectory(namePrefix, registry);
 this.parabolicTrajectoryGenerator = new YoParabolicTrajectoryGenerator(namePrefix, referenceFrame, registry);
 this.groundClearance = new YoDouble("groundClearance", registry);
 this.stepTime = new YoDouble("stepTime", registry);
 this.timeIntoStep = new YoDouble("timeIntoStep", registry);
 parentRegistry.addChild(registry);
 this.stepTimeProvider = stepTimeProvider;
 this.groundClearance.set(groundClearance);
}

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

public ParabolicPositionTrajectoryGenerator(String namePrefix, ReferenceFrame referenceFrame, DoubleProvider stepTimeProvider,
   PositionProvider initialPositionProvider, PositionProvider finalPositionProvider, double groundClearance, YoVariableRegistry parentRegistry)
{
 this.registry = new YoVariableRegistry(namePrefix + namePostFix);
 this.minimumJerkTrajectory = new YoMinimumJerkTrajectory(namePrefix, registry);
 this.parabolicTrajectoryGenerator = new YoParabolicTrajectoryGenerator(namePrefix, referenceFrame, registry);
 this.groundClearance = new DoubleYoVariable("groundClearance", registry);
 this.stepTime = new DoubleYoVariable("stepTime", registry);
 this.timeIntoStep = new DoubleYoVariable("timeIntoStep", registry);
 parentRegistry.addChild(registry);
 this.stepTimeProvider = stepTimeProvider;
 this.initialPositionProvider = initialPositionProvider;
 this.finalPositionProvider = finalPositionProvider;
 this.groundClearance.set(groundClearance);
}

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

public ParabolicPositionTrajectoryGenerator(String namePrefix, ReferenceFrame referenceFrame, DoubleProvider stepTimeProvider,
   PositionProvider initialPositionProvider, PositionProvider finalPositionProvider, double groundClearance, YoVariableRegistry parentRegistry)
{
 this.registry = new YoVariableRegistry(namePrefix + namePostFix);
 this.minimumJerkTrajectory = new YoMinimumJerkTrajectory(namePrefix, registry);
 this.parabolicTrajectoryGenerator = new YoParabolicTrajectoryGenerator(namePrefix, referenceFrame, registry);
 this.groundClearance = new YoDouble("groundClearance", registry);
 this.stepTime = new YoDouble("stepTime", registry);
 this.timeIntoStep = new YoDouble("timeIntoStep", registry);
 parentRegistry.addChild(registry);
 this.stepTimeProvider = stepTimeProvider;
 this.initialPositionProvider = initialPositionProvider;
 this.finalPositionProvider = finalPositionProvider;
 this.groundClearance.set(groundClearance);
}

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

YoMinimumJerkTrajectory minimumJerkTrajectory = new YoMinimumJerkTrajectory("test", registry);

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