gpt4 book ai didi

us.ihmc.robotics.math.frames.YoFrameVector.scale()方法的使用及代码示例

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

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

YoFrameVector.scale介绍

暂无

代码示例

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

public void scaleAngularPart(double scaleFactor)
{
 angularPart.scale(scaleFactor);
}

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

public void scaleLinearPart(double scaleFactor)
{
 linearPart.scale(scaleFactor);
}

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

public void setWeight(double weight)
{
 yoAngularWeight.set(1.0, 1.0, 1.0);
 yoAngularWeight.scale(weight);
 yoLinearWeight.set(1.0, 1.0, 1.0);
 yoLinearWeight.scale(weight);
}

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

public void setWeight(double weight)
{
 angularWeight.set(1.0, 1.0, 1.0);
 angularWeight.scale(weight);
 linearWeight.set(1.0, 1.0, 1.0);
 linearWeight.scale(weight);
}

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

public void setDesiredTorqueOfHandOntoExternalEnvironment(Vector3d desiredTorque)
{
 if (desiredTorque == null)
 {
   this.desiredTorque.setToZero();
 }
 else
 {
   this.desiredTorque.set(desiredTorque);
   this.desiredTorque.scale(-1.0);
 }
}

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

public void setDesiredForceOfHandOntoExternalEnvironment(Vector3d desiredForce)
{
 if (desiredForce == null)
 {
   this.desiredForce.setToZero();
 }
 else
 {
   this.desiredForce.set(desiredForce);
   this.desiredForce.scale(-1.0);
 }
}

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

/**
* Compute the desired capture point acceleration given the desired capture
* point velocity
*
* @param omega0 the natural frequency &omega; = &radic;<span style="text-decoration:overline;">&nbsp; g / z0&nbsp;</span> of the biped.
* @param desiredCapturePointVelocity
* @param desiredCapturePointAccelerationToPack
*/
public static void computeDesiredCapturePointAcceleration(double omega0, YoFrameVector desiredCapturePointVelocity,
                             YoFrameVector desiredCapturePointAccelerationToPack)
{
 desiredCapturePointAccelerationToPack.setAndMatchFrame(desiredCapturePointVelocity.getFrameTuple());
 desiredCapturePointAccelerationToPack.scale(omega0);
}

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

public void progressivelyCancelOutCorrection(FramePoint desiredPosition, FrameOrientation desiredOrientation)
{
 yoCompliantControlLinearDisplacement.scale(compliantControlResetLeakRatio.getDoubleValue());
 yoCompliantControlAngularDisplacement.scale(compliantControlResetLeakRatio.getDoubleValue());
 yoCompliantControlLinearDisplacement.getFrameTupleIncludingFrame(totalLinearCorrection);
 yoCompliantControlAngularDisplacement.getFrameTupleIncludingFrame(totalAngularCorrection);
 totalLinearCorrection.changeFrame(controlFrame);
 totalAngularCorrection.changeFrame(controlFrame);
 applyCorrection(desiredPosition, desiredOrientation);
}

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

private void decayDesiredVelocityIfNeeded(double timeInCurrentState)
{
 if (velocityDecayDurationWhenDone.isNaN() || isStanding.getBooleanValue())
 {
   velocityReductionFactor.set(Double.NaN);
   return;
 }
 double hasBeenDoneForDuration = timeInCurrentState;
 if (isDoubleSupport.getBooleanValue())
   hasBeenDoneForDuration -= transferTimes.get(0).getDoubleValue();
 else
   hasBeenDoneForDuration -= swingTimes.get(0).getDoubleValue();
 if (hasBeenDoneForDuration <= 0.0)
 {
   velocityReductionFactor.set(Double.NaN);
 }
 else
 {
   velocityReductionFactor.set(MathTools.clipToMinMax(1.0 - hasBeenDoneForDuration / velocityDecayDurationWhenDone.getDoubleValue(), 0.0, 1.0));
   desiredCapturePointVelocity.scale(velocityReductionFactor.getDoubleValue());
 }
}

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

private void updateAngularVelocity()
{
 firstIMU.getAngularVelocityMeasurement(firstVector);
 secondIMU.getAngularVelocityMeasurement(secondVector);
 firstFrameVector.setIncludingFrame(firstIMU.getMeasurementFrame(), firstVector);
 secondFrameVector.setIncludingFrame(secondIMU.getMeasurementFrame(), secondVector);
 firstFrameVector.changeFrame(fusedMeasurementFrame);
 secondFrameVector.changeFrame(fusedMeasurementFrame);
 angularVelocity.add(firstFrameVector, secondFrameVector);
 angularVelocity.scale(0.5);
}

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

private void updateLinearAcceleration()
{
 firstIMU.getLinearAccelerationMeasurement(firstVector);
 secondIMU.getLinearAccelerationMeasurement(secondVector);
 firstFrameVector.setIncludingFrame(firstIMU.getMeasurementFrame(), firstVector);
 secondFrameVector.setIncludingFrame(secondIMU.getMeasurementFrame(), secondVector);
 firstFrameVector.changeFrame(fusedMeasurementFrame);
 secondFrameVector.changeFrame(fusedMeasurementFrame);
 linearAcceleration.add(firstFrameVector, secondFrameVector);
 linearAcceleration.scale(0.5);
}

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

@Override
public void compute(double time)
{
 if (continuouslyUpdateFinalPosition.getBooleanValue())
 {
   updateFinalPosition();
 }
 this.currentTime.set(time);
 time = MathTools.clipToMinMax(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/CommonWalkingControlModules

private void updateOrientationVisualization()
{
 desiredSpatialAcceleration.getAngularPart(desiredAngularAcceleration);
 yoDesiredAngularAcceleration.setAndMatchFrame(desiredAngularAcceleration);
 tempOrientation.setToZero(accelerationControlModule.getTrackingFrame());
 yoCurrentOrientation.setAndMatchFrame(tempOrientation);
 accelerationControlModule.getEndEffectorCurrentAngularVelocity(tempAngularVelocity);
 yoCurrentAngularVelocity.setAndMatchFrame(tempAngularVelocity);
 yoDesiredOrientation.get(tempAxisAngle);
 yoDesiredRotationVector.set(tempAxisAngle.getX(), tempAxisAngle.getY(), tempAxisAngle.getZ());
 yoDesiredRotationVector.scale(tempAxisAngle.getAngle());
 yoCurrentOrientation.get(tempAxisAngle);
 yoCurrentRotationVector.set(tempAxisAngle.getX(), tempAxisAngle.getY(), tempAxisAngle.getZ());
 yoCurrentRotationVector.scale(tempAxisAngle.getAngle());
}

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

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/CommonWalkingControlModules

@Override
public void compute()
{
 if (!isEnabled())
   return;
 yoDesiredOrientation.getFrameOrientationIncludingFrame(tempOrientation);
 yoDesiredAngularVelocity.getFrameTupleIncludingFrame(tempAngularVelocity);
 yoFeedForwardAngularAcceleration.getFrameTupleIncludingFrame(feedForwardAngularAcceleration);
 accelerationControlModule.compute(desiredAngularAcceleration, tempOrientation, tempAngularVelocity, feedForwardAngularAcceleration, base);
 yoDesiredAngularAcceleration.setAndMatchFrame(desiredAngularAcceleration);
 tempOrientation.setToZero(endEffectorFrame);
 yoCurrentOrientation.setAndMatchFrame(tempOrientation);
 accelerationControlModule.getEndEffectorCurrentAngularVelocity(tempAngularVelocity);
 yoCurrentAngularVelocity.setAndMatchFrame(tempAngularVelocity);
 yoDesiredOrientation.get(tempAxisAngle);
 yoDesiredRotationVector.set(tempAxisAngle.getX(), tempAxisAngle.getY(), tempAxisAngle.getZ());
 yoDesiredRotationVector.scale(tempAxisAngle.getAngle());
 yoCurrentOrientation.get(tempAxisAngle);
 yoCurrentRotationVector.set(tempAxisAngle.getX(), tempAxisAngle.getY(), tempAxisAngle.getZ());
 yoCurrentRotationVector.scale(tempAxisAngle.getAngle());
 output.setAngularAcceleration(endEffectorFrame, baseFrame, desiredAngularAcceleration);
}

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

public void updateIMUAndRootJointLinearVelocity(FrameVector rootJointVelocityToPack)
{
 updateLinearAccelerationMeasurement();
 yoLinearAccelerationMeasurementInWorld.getFrameTupleIncludingFrame(linearAccelerationMeasurement);
 linearAccelerationMeasurement.scale(estimatorDT);
 yoMeasurementFrameLinearVelocityInWorld.add(linearAccelerationMeasurement);
 yoMeasurementFrameLinearVelocityInWorld.getFrameTupleIncludingFrame(rootJointVelocityToPack);
 getCorrectionVelocityForMeasurementFrameOffset(correctionVelocityForMeasurementFrameOffset);
 correctionVelocityForMeasurementFrameOffset.changeFrame(worldFrame);
 rootJointVelocityToPack.sub(correctionVelocityForMeasurementFrameOffset);
 yoRootJointIMUBasedLinearVelocityInWorld.set(rootJointVelocityToPack);
 imuLinearVelocityIMUOnly.add(linearAccelerationMeasurement);
 imuLinearVelocityIMUOnly.scale(alphaLeakIMUOnly.getDoubleValue());
 rootJointLinearVelocityIMUOnly.set(imuLinearVelocityIMUOnly);
 rootJointLinearVelocityIMUOnly.sub(correctionVelocityForMeasurementFrameOffset);
}

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

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);
 }
 positionErrorCumulated.getFrameTuple(integralTerm);
 integralGainMatrix.transform(integralTerm.getVector());
}

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

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);
 }
 rotationErrorCumulated.getFrameTuple(integralTerm);
 integralGainMatrix.transform(integralTerm.getVector());
}

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

private void computeIntegralTerm(ReferenceFrame baseFrame)
{
 if (gains.getMaximumIntegralError() < 1e-5)
 {
   integralTerm.setToZero(baseFrame);
   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);
 }
 positionErrorCumulated.getFrameTupleIncludingFrame(integralTerm);
 integralTerm.changeFrame(baseFrame);
 integralGainMatrix.transform(integralTerm.getVector());
}

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

public void initialize(FramePoint initialPosition, FramePoint intermediatePosition, FramePoint finalPosition, double intermediateParameter)
{
 initialPosition.changeFrame(referenceFrame);
 intermediatePosition.changeFrame(referenceFrame);
 finalPosition.changeFrame(referenceFrame);
 final double q = intermediateParameter;
 MathTools.checkIfInRange(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);
}

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