本文整理了Java中us.ihmc.yoVariables.variable.YoFrameVector3D.scale()
方法的一些代码示例,展示了YoFrameVector3D.scale()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YoFrameVector3D.scale()
方法的具体详情如下:
包路径:us.ihmc.yoVariables.variable.YoFrameVector3D
类名称:YoFrameVector3D
方法名:scale
暂无
代码示例来源:origin: us.ihmc/simulation-construction-set-tools
public void computeCurrentDisturbanceForce()
{
currentDisturbanceForce.setX(random.nextDouble());
currentDisturbanceForce.setY(random.nextDouble());
currentDisturbanceForce.setZ(random.nextDouble());
currentDisturbanceForce.normalize();
currentDisturbanceForce.scale(maximalDisturbanceMagnitude.getDoubleValue());
}
代码示例来源:origin: us.ihmc/ihmc-common-walking-control-modules-test
@ContinuousIntegrationTest(estimatedDuration = 0.0)
@Test(timeout = 30000)
public void testComputeDesiredCapturePointAcceleration()
{
YoFramePoint3D initialCapturePointPosition = new YoFramePoint3D("", ReferenceFrame.getWorldFrame(), registry);
YoFramePoint3D initialCenterOfPressure = new YoFramePoint3D("3", ReferenceFrame.getWorldFrame(), registry);
YoFrameVector3D computedCapturePointVelocity = new YoFrameVector3D("5", ReferenceFrame.getWorldFrame(), registry);
YoFrameVector3D desiredCapturePointAcceleration = new YoFrameVector3D("6", ReferenceFrame.getWorldFrame(), registry);
for (int i = 0; i < nTests; i++)
{
initialCapturePointPosition.set(random.nextDouble(), random.nextDouble(), 0);
initialCenterOfPressure.set(initialCapturePointPosition.getX() + 0.02, initialCapturePointPosition.getY() + 0.01, 0);
double time = random.nextDouble() * 0.1 + 0.05;
double omega0 = 0.5;
CapturePointTools.computeDesiredCapturePointVelocity(omega0, time, initialCapturePointPosition, initialCenterOfPressure, computedCapturePointVelocity);
CapturePointTools.computeDesiredCapturePointAcceleration(omega0, time, initialCapturePointPosition, initialCenterOfPressure,
desiredCapturePointAcceleration);
computedCapturePointVelocity.scale(omega0);
EuclidCoreTestTools.assertTuple3DEquals("", computedCapturePointVelocity, desiredCapturePointAcceleration, 1e-10);
computedCapturePointVelocity.scale(1 / omega0);
CapturePointTools.computeDesiredCapturePointAcceleration(omega0, computedCapturePointVelocity, desiredCapturePointAcceleration);
computedCapturePointVelocity.scale(omega0);
EuclidCoreTestTools.assertTuple3DEquals("", computedCapturePointVelocity, desiredCapturePointAcceleration, 1e-10);
}
}
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
@Override
public void compute(double time)
{
if (continuouslyUpdateFinalPosition.getBooleanValue())
{
updateFinalPosition();
}
this.currentTime.set(time);
time = MathTools.clamp(time, 0.0, trajectoryTime.getDoubleValue());
parameterPolynomial.compute(time);
differenceVector.sub(finalPosition, initialPosition);
double parameter = isDone() ? 1.0 : parameterPolynomial.getPosition();
double parameterd = isDone() ? 0.0 : parameterPolynomial.getVelocity();
double parameterdd = isDone() ? 0.0 : parameterPolynomial.getAcceleration();
currentPosition.interpolate(initialPosition, finalPosition, parameter);
currentVelocity.set(differenceVector);
currentVelocity.scale(parameterd);
currentAcceleration.set(differenceVector);
currentAcceleration.scale(parameterdd);
}
代码示例来源:origin: us.ihmc/ihmc-simulation-toolkit
private void applyForce()
{
double length = pushDirection.length();
if (length > 1e-5)
{
pushForce.set(pushDirection);
pushForce.normalize();
pushForce.scale(pushForceMagnitude.getDoubleValue());
if (pushCondition == null)
{
pushTimeSwitch.set(yoTime.getDoubleValue());
}
}
else
{
pushForce.setToZero();
pushTimeSwitch.set(Double.NEGATIVE_INFINITY);
}
pushNumber.increment();
}
代码示例来源:origin: us.ihmc/ihmc-common-walking-control-modules-test
@ContinuousIntegrationTest(estimatedDuration = 0.0)
@Test(timeout = 30000)
public void testComputeDesiredCapturePointVelocity()
{
YoFramePoint3D initialCapturePointPosition = new YoFramePoint3D("", ReferenceFrame.getWorldFrame(), registry);
YoFramePoint3D computedCapturePoint1 = new YoFramePoint3D("1", ReferenceFrame.getWorldFrame(), registry);
YoFramePoint3D computedCapturePoint2 = new YoFramePoint3D("2", ReferenceFrame.getWorldFrame(), registry);
YoFramePoint3D initialCenterOfPressure = new YoFramePoint3D("3", ReferenceFrame.getWorldFrame(), registry);
YoFrameVector3D differentiatedCapturePointPosition = new YoFrameVector3D("4", ReferenceFrame.getWorldFrame(), registry);
YoFrameVector3D computedCapturePointVelocity = new YoFrameVector3D("5", ReferenceFrame.getWorldFrame(), registry);
for (int i = 0; i < nTests; i++)
{
initialCapturePointPosition.set(random.nextDouble(), random.nextDouble(), 0);
initialCenterOfPressure.set(initialCapturePointPosition.getX() + 0.02, initialCapturePointPosition.getY() + 0.01, 0);
double deltaT = 0.001;
double time = random.nextDouble() * 0.1 + 0.05;
double omega0 = 0.5;
CapturePointTools.computeDesiredCapturePointPosition(omega0, time, initialCapturePointPosition, initialCenterOfPressure, computedCapturePoint1);
CapturePointTools.computeDesiredCapturePointPosition(omega0, time + deltaT, initialCapturePointPosition, initialCenterOfPressure,
computedCapturePoint2);
differentiatedCapturePointPosition.set(computedCapturePoint2);
differentiatedCapturePointPosition.sub(computedCapturePoint1);
differentiatedCapturePointPosition.scale(1 / deltaT);
CapturePointTools.computeDesiredCapturePointVelocity(omega0, time + deltaT, initialCapturePointPosition, initialCenterOfPressure,
computedCapturePointVelocity);
EuclidCoreTestTools.assertTuple3DEquals("", computedCapturePointVelocity, differentiatedCapturePointPosition, 1e-3);
}
}
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
private void computeIntegralTerm()
{
if (gains.getMaximumIntegralError() < 1e-5)
{
integralTerm.setToZero(bodyFrame);
return;
}
double errorIntegratedX = positionError.getX() * dt;
double errorIntegratedY = positionError.getY() * dt;
double errorIntegratedZ = positionError.getZ() * dt;
positionErrorCumulated.add(errorIntegratedX, errorIntegratedY, errorIntegratedZ);
double errorMagnitude = positionErrorCumulated.length();
if (errorMagnitude > gains.getMaximumIntegralError())
{
positionErrorCumulated.scale(gains.getMaximumIntegralError() / errorMagnitude);
}
integralTerm.set(positionErrorCumulated);
gains.getIntegralGainMatrix(tempGainMatrix);
tempGainMatrix.transform(integralTerm);
}
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit-test
actualOrientation.inverseTransform(zUp);
inputLinearAcceleration.set(zUp);
inputLinearAcceleration.scale(20.0);
inputMagneticVector.scale(0.5);
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit-test
actualOrientation.inverseTransform(zUp);
inputLinearAcceleration.set(zUp);
inputLinearAcceleration.scale(20.0);
inputMagneticVector.scale(0.5);
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit-test
actualOrientation.inverseTransform(zUp);
inputLinearAcceleration.set(zUp);
inputLinearAcceleration.scale(20.0);
inputMagneticVector.scale(0.5);
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
private void computeIntegralTerm()
{
if (gains.getMaximumIntegralError() < 1e-5)
{
integralTerm.setToZero(bodyFrame);
return;
}
double integratedErrorAngle = errorAngleAxis.getAngle() * dt;
double errorIntegratedX = errorAngleAxis.getX() * integratedErrorAngle;
double errorIntegratedY = errorAngleAxis.getY() * integratedErrorAngle;
double errorIntegratedZ = errorAngleAxis.getZ() * integratedErrorAngle;
rotationErrorCumulated.add(errorIntegratedX, errorIntegratedY, errorIntegratedZ);
double errorMagnitude = rotationErrorCumulated.length();
if (errorMagnitude > gains.getMaximumIntegralError())
{
rotationErrorCumulated.scale(gains.getMaximumIntegralError() / errorMagnitude);
}
integralTerm.set(rotationErrorCumulated);
gains.getIntegralGainMatrix(tempGainMatrix);
tempGainMatrix.transform(integralTerm);
}
代码示例来源:origin: us.ihmc/ihmc-common-walking-control-modules-test
public void applyForce(Vector3D direction, double magnitude, double duration)
{
PrintTools.info("\nPushing " + jointName + " direction: " + direction + " magnitude: " + magnitude + "(N) for " + duration + "(s)");
pushDuration.set(duration);
pushDelay.set(0.0);
pushDirection.set(direction);
pushMagnitude.set(magnitude);
if (pushDirection.length() > 1e-5)
{
pushForce.set(pushDirection);
pushForce.normalize();
pushForce.scale(pushMagnitude.getDoubleValue());
pushTimeSwitch.set(yoTime.getDoubleValue());
}
else
{
pushForce.setToZero();
pushTimeSwitch.set(Double.NEGATIVE_INFINITY);
}
pushNumber.increment();
}
}
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
public void initialize(FramePoint3D initialPosition, FramePoint3D intermediatePosition, FramePoint3D finalPosition, double intermediateParameter)
{
initialPosition.changeFrame(referenceFrame);
intermediatePosition.changeFrame(referenceFrame);
finalPosition.changeFrame(referenceFrame);
final double q = intermediateParameter;
MathTools.checkIntervalContains(q, 0.0, 1.0);
c0.set(initialPosition);
c2.set(intermediatePosition);
c2.sub(initialPosition);
tempInitialize.set(finalPosition);
tempInitialize.sub(initialPosition);
tempInitialize.scale(q);
c2.sub(tempInitialize);
c2.scale(1.0 / (MathTools.square(q) - q));
c1.set(finalPosition);
c1.sub(initialPosition);
c1.sub(c2);
}
代码示例来源:origin: us.ihmc/ihmc-common-walking-control-modules-test
desiredCoMVelocity.scale(omega0.getDoubleValue());
代码示例来源:origin: us.ihmc/ihmc-common-walking-control-modules-test
desiredCoMVelocity.scale(omega0.getDoubleValue());
代码示例来源:origin: us.ihmc/ihmc-common-walking-control-modules-test
desiredCoMVelocity.scale(omega0.getDoubleValue());
内容来源于网络,如有侵权,请联系作者删除!