- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中us.ihmc.robotics.math.trajectories.YoPolynomial
类的一些代码示例,展示了YoPolynomial
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YoPolynomial
类的具体详情如下:
包路径:us.ihmc.robotics.math.trajectories.YoPolynomial
类名称:YoPolynomial
暂无
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces
private void setupPolynomialSpline(double time, double duration)
{
yoPolynomial.setCubic(time, time + duration, 0.0, 0.0, 1.0, 0.0);
}
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
public void compute(double t)
{
xPolynomial.compute(t);
yPolynomial.compute(t);
zPolynomial.compute(t);
}
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
@Override
public double getY()
{
return yPolynomial.getPosition();
}
代码示例来源:origin: us.ihmc/IHMCRoboticsToolkit
public void compute(double t)
{
for (Direction direction : Direction.values)
{
polynomials.get(direction).compute(t);
}
for (Direction direction : Direction.values)
{
position.set(direction, polynomials.get(direction).getPosition());
}
for (Direction direction : Direction.values)
{
velocity.set(direction, polynomials.get(direction).getVelocity());
}
for (Direction direction : Direction.values)
{
acceleration.set(direction, polynomials.get(direction).getAcceleration());
}
}
代码示例来源: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-footstep-planning
public FootstepPlanningResult planWaypoints()
{
waypoints.clear();
double yaw = bodyStartPose.getYaw();
xPoly.setQuadratic(0.0, 1.0, bodyStartPose.getX(), Math.cos(yaw) * 0.2, bodyGoalPose.getX());
yPoly.setQuadratic(0.0, 1.0, bodyStartPose.getY(), Math.sin(yaw) * 0.2, bodyGoalPose.getY());
zPoly.setQuadratic(0.0, 1.0, bodyStartPose.getZ(), Math.sin(yaw) * 0.2, bodyGoalPose.getZ());
for (int i = 0; i < numberOfPoints; i++)
{
double percent = i / (double) (numberOfPoints - 1);
xPoly.compute(percent);
yPoly.compute(percent);
zPoly.compute(percent);
Point3D point = new Point3D(xPoly.getPosition(), yPoly.getPosition(), zPoly.getPosition());
waypoints.add(point);
}
yoResult.set(FootstepPlanningResult.OPTIMAL_SOLUTION);
return yoResult.getEnumValue();
}
代码示例来源:origin: us.ihmc/ihmc-footstep-planning
public SplinePathPlanner(FootstepPlannerParameters parameters, YoVariableRegistry parentRegistry)
{
super(parameters, parentRegistry);
xPoly = new YoPolynomial("xPoly", 4, parentRegistry);
yPoly = new YoPolynomial("yPoly", 4, parentRegistry);
zPoly = new YoPolynomial("zPoly", 4, parentRegistry);
}
代码示例来源:origin: us.ihmc/CommonWalkingControlModules
public void computePositionsForVis(double time)
{
nominalTrajectoryGenerator.compute(time);
xPolynomial.compute(time);
yPolynomial.compute(time);
nominalTrajectoryGenerator.getPosition(nominalTrajectoryPosition);
nominalTrajectoryGenerator.getVelocity(nominalTrajectoryVelocity);
nominalTrajectoryGenerator.getAcceleration(nominalTrajectoryAcceleration);
desiredPosition.setX(xPolynomial.getPosition());
desiredPosition.setY(yPolynomial.getPosition());
desiredPosition.setZ(nominalTrajectoryPosition.getZ());
}
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit-test
@ContinuousIntegrationTest(estimatedDuration = 0.0)
@Test(timeout = 30000)
public void testCubicDerivativePointAutomated()
{
//cubic polynomial: y(x) = a0 + a1*x + a2*x^2 + a3*x^3
YoVariableRegistry registry = new YoVariableRegistry(namePrefix);
int numberOfCoefficients = 4;
YoPolynomial cubic = new YoPolynomial(namePrefix + "Cubic", numberOfCoefficients, registry);
double x0 = 1.0, xf = 2.0;
double y0 = 0.5, yf = 1.5;
double dy0 = -0.5, dyf = 2.0;
cubic.setCubic(x0, xf, y0, dy0, yf, dyf);
double x = 2.0/3.0 * (xf - x0);
compareDerivativesPoint(cubic, x);
}
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit-test
@ContinuousIntegrationTest(estimatedDuration = 0.0)
@Test(timeout = 30000)
public void testLinearDerivativePointManual()
{
//linear polynomial: y(x) = a0 + a1*x
YoVariableRegistry registry = new YoVariableRegistry(namePrefix);
int numberOfCoefficients = 2;
YoPolynomial linear = new YoPolynomial(namePrefix + "Linear", numberOfCoefficients, registry);
double x0 = 1.0, xf = 2.0;
double y0 = 0.5, yf = 1.5;
linear.setLinear(x0, xf, y0, yf);
double x = 2.0/3.0 * (xf - x0);
double a0 = linear.getCoefficient(0);
double a1 = linear.getCoefficient(1);
double yLinear = linear.getDerivative(0, x);
double yManual = a0 + a1*x;
assertEquals(yLinear, yManual, EPSILON);
double dyLinear = linear.getDerivative(1, x);
double dyManual = a1;
assertEquals(dyLinear, dyManual, EPSILON);
double ddyLinear = linear.getDerivative(2, x);
double ddyManual = 0.0;
assertEquals(ddyLinear, ddyManual, EPSILON);
}
代码示例来源:origin: us.ihmc/IHMCRoboticsToolkit
/**
* Desired joint angles and velocities come from reading the joints, this method can override them those position and velocity values.
* @param currentDesiredPosition Sets the desired joint position.
* @param currentDesiredVelocity Sets the desired joint velocity.
*/
@Override
public void initialize(double initialPosition, double initialVelocity)
{
currentTime.set(0.0);
currentTimeOffset.set(0.0);
currentPolynomialIndex.set(0);
trajectoryTime.set(trajectoryTimeProvider.getValue());
subTrajectoryTime.set(trajectoryTime.getDoubleValue() / (currentNumberOfWaypoints.getIntegerValue() + 1));
startMotionPolynomial.setCubicThreeInitialConditionsFinalPosition(0.0, subTrajectoryTime.getDoubleValue(), initialPosition, initialVelocity, 0.0,
intermediatePositions.get(0).getDoubleValue());
startMotionPolynomial.compute(subTrajectoryTime.getDoubleValue());
for (int i = 0; i < currentNumberOfWaypoints.getIntegerValue() - 1; i++)
{
YoPolynomial connectingPolynomial = connectingPolynomials.get(i);
double z0 = intermediatePositions.get(i).getDoubleValue();
double zFinal = intermediatePositions.get(i + 1).getDoubleValue();
connectingPolynomial.setLinear(0.0, subTrajectoryTime.getDoubleValue(), z0, zFinal);
connectingPolynomial.compute(subTrajectoryTime.getDoubleValue());
}
double z0 = intermediatePositions.get(currentNumberOfWaypoints.getIntegerValue() - 1).getDoubleValue();
double zFinal = finalPosition.getDoubleValue();
finalizeMotionPolynomial.setCubicInitialPositionThreeFinalConditions(0.0, subTrajectoryTime.getDoubleValue(), z0, zFinal, 0.0, 0.0);
}
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
@Override
public double getX()
{
return xPolynomial.getVelocity();
}
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
@Override
protected void setPolynomial()
{
if (Precision.equals(0.0, trajectoryTime.getDoubleValue()))
{
polynomial.setLinear(0.0, initialPositionProvider.getValue(), initialVelocityProvider.getValue());
}
else
{
polynomial.setCubic(0.0, trajectoryTime.getDoubleValue(), initialPositionProvider.getValue(), initialVelocityProvider.getValue(),
finalPositionProvider.getValue(), finalVelocityProvider.getValue());
}
}
}
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit-test
@ContinuousIntegrationTest(estimatedDuration = 0.0)
@Test(timeout = 30000)
public void testLinearDerivativePointAutomated()
{
//linear polynomial: y(x) = a0 + a1*x
YoVariableRegistry registry = new YoVariableRegistry(namePrefix);
int numberOfCoefficients = 2;
YoPolynomial linear = new YoPolynomial(namePrefix + "Linear", numberOfCoefficients, registry);
double x0 = 1.0, xf = 2.0;
double y0 = 0.5, yf = 1.5;
linear.setLinear(x0, xf, y0, yf);
double x = 2.0/3.0 * (xf - x0);
compareDerivativesPoint(linear, x);
}
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
@Override
public double getZ()
{
return zPolynomial.getAcceleration();
}
};
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
public void setLinear(double t0, double tFinal, double z0, double zf)
{
setTime(t0, tFinal);
polynomial.setLinear(t0, tFinal, z0, zf);
}
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
public void setQuadratic(double t0, double tFinal, double z0, double zd0, double zFinal)
{
setTime(t0, tFinal);
polynomial.setQuadratic(t0, tFinal, z0, zd0, zFinal);
}
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
@Override
protected void setPolynomial()
{
if (Precision.equals(0.0, trajectoryTime.getDoubleValue()))
{
polynomial.setLinear(0.0, initialPositionProvider.getValue(), initialVelocityProvider.getValue());
}
else
{
polynomial.setQuintic(0.0, trajectoryTime.getDoubleValue(), initialPositionProvider.getValue(), initialVelocityProvider.getValue(), 0.0,
finalPositionProvider.getValue(), finalVelocityProvider.getValue(), 0.0);
}
}
}
代码示例来源:origin: us.ihmc/IHMCRoboticsToolkit
public void compute(double time)
{
this.currentTime.set(time);
time = MathTools.clipToMinMax(time, 0.0, trajectoryTime.getDoubleValue());
polynomial.compute(time);
currentValue.set(polynomial.getPosition());
currentVelocity.set(polynomial.getVelocity());
currentAcceleration.set(polynomial.getAcceleration());
}
代码示例来源:origin: us.ihmc/ihmc-footstep-planning-test
xPoly.setQuadratic(0.0, 1.0, 0.0, 0.2, x.getDoubleValue());
yPoly.setQuadratic(0.0, 1.0, 0.0, 0.0, y.getDoubleValue());
for (int i = 0; i < numberOfPoints; i++)
xPoly.compute(percent);
yPoly.compute(percent);
Point3D point2d = new Point3D(xPoly.getPosition(), yPoly.getPosition(), 0.0);
waypoints.add(point2d);
本文整理了Java中us.ihmc.robotDataLogger.YoVariableServer类的一些代码示例,展示了YoVariableServer类的具体用法。这些代码示例主要来源于Gith
本文整理了Java中us.ihmc.robotDataLogger.YoVariableClient类的一些代码示例,展示了YoVariableClient类的具体用法。这些代码示例主要来源于Gith
本文整理了Java中us.ihmc.kalman.YoKalmanFilter类的一些代码示例,展示了YoKalmanFilter类的具体用法。这些代码示例主要来源于Github/Stackoverf
本文整理了Java中us.ihmc.robotDataLogger.YoVariablesUpdatedListener类的一些代码示例,展示了YoVariablesUpdatedListener类的
本文整理了Java中us.ihmc.robotics.screwTheory.Wrench类的一些代码示例,展示了Wrench类的具体用法。这些代码示例主要来源于Github/Stackoverflo
本文整理了Java中us.ihmc.mecano.spatial.Wrench类的一些代码示例,展示了Wrench类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Mave
本文整理了Java中us.ihmc.yoVariables.variable.YoVariable类的一些代码示例,展示了YoVariable类的具体用法。这些代码示例主要来源于Github/Stac
本文整理了Java中us.ihmc.yoVariables.variable.YoLong类的一些代码示例,展示了YoLong类的具体用法。这些代码示例主要来源于Github/Stackoverflo
本文整理了Java中us.ihmc.yoVariables.variable.YoFrameVector3D类的一些代码示例,展示了YoFrameVector3D类的具体用法。这些代码示例主要来源于G
本文整理了Java中us.ihmc.yoVariables.variable.YoEnum类的一些代码示例,展示了YoEnum类的具体用法。这些代码示例主要来源于Github/Stackoverflo
本文整理了Java中us.ihmc.yoVariables.variable.YoFramePoint3D类的一些代码示例,展示了YoFramePoint3D类的具体用法。这些代码示例主要来源于Git
本文整理了Java中us.ihmc.graphicsDescription.yoGraphics.YoGraphicsList类的一些代码示例,展示了YoGraphicsList类的具体用法。这些代码
本文整理了Java中us.ihmc.yoVariables.variable.YoBoolean类的一些代码示例,展示了YoBoolean类的具体用法。这些代码示例主要来源于Github/Stacko
本文整理了Java中us.ihmc.yoVariables.variable.YoInteger类的一些代码示例,展示了YoInteger类的具体用法。这些代码示例主要来源于Github/Stacko
本文整理了Java中us.ihmc.graphicsDescription.yoGraphics.YoGraphicPosition类的一些代码示例,展示了YoGraphicPosition类的具体用
本文整理了Java中us.ihmc.graphicsDescription.appearance.YoAppearance类的一些代码示例,展示了YoAppearance类的具体用法。这些代码示例主要
本文整理了Java中us.ihmc.graphicsDescription.yoGraphics.YoGraphicsListRegistry类的一些代码示例,展示了YoGraphicsListReg
本文整理了Java中us.ihmc.yoVariables.variable.YoDouble类的一些代码示例,展示了YoDouble类的具体用法。这些代码示例主要来源于Github/Stackove
本文整理了Java中us.ihmc.yoVariables.variable.YoFrameVector2D类的一些代码示例,展示了YoFrameVector2D类的具体用法。这些代码示例主要来源于G
本文整理了Java中us.ihmc.codecs.yuv.YUVPictureConverter类的一些代码示例,展示了YUVPictureConverter类的具体用法。这些代码示例主要来源于Git
我是一名优秀的程序员,十分优秀!