gpt4 book ai didi

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

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

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

YoFrameVector2d.set介绍

暂无

代码示例

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

public void reset()
{
 icpErrorIntegrated.set(0.0, 0.0);
}

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

private void setXYVectorFromPoseToPoseNormalize(YoFrameVector2d vectorToPack, FramePose fromPose, FramePose toPose)
{
 if (fromPose.epsilonEquals(toPose, 1e-7, Double.MAX_VALUE))
 {
   vectorToPack.set(fromPose.getReferenceFrame(), 0.0, 0.0);
 }
 else
 {
   FrameVector2d frameTuple2d = vectorToPack.getFrameTuple2d();
   frameTuple2d.setByProjectionOntoXYPlane(toPose.getFramePointCopy());
   fromPose.checkReferenceFrameMatch(vectorToPack);
   frameTuple2d.sub(fromPose.getX(), fromPose.getY());
   frameTuple2d.normalize();
   vectorToPack.setWithoutChecks(frameTuple2d);
 }
}

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

yoCoPError.get(robotSide).set(copError);
yoCoPErrorMagnitude.get(robotSide).set(copError.length());

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

public void setDesiredVelocity(FrameVector2d newDesiredVelocity)
{
 newDesiredVelocity.changeFrame(desiredVelocity.getReferenceFrame());
 desiredVelocity.set(newDesiredVelocity);
}

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

public void setValuesForFeedbackOnly(FramePoint2d desiredICP, FrameVector2d desiredICPVelocity, double omega0)
{
 CapturePointTools.computeDesiredCentroidalMomentumPivot(desiredICP, desiredICPVelocity, omega0, tmpCMP);
 controllerReferenceICP.set(desiredICP);
 controllerReferenceICPVelocity.set(desiredICPVelocity);
 controllerReferenceCMP.set(tmpCMP);
 nominalReferenceICP.set(desiredICP);
 nominalReferenceICPVelocity.set(desiredICPVelocity);
 nominalReferenceCMP.set(tmpCMP);
}

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

private void computeDesiredICPOffset()
{
 pelvisPositionError.set(desiredPelvisPosition);
 tempPosition2d.setToZero(pelvisZUpFrame);
 tempPosition2d.changeFrame(worldFrame);
 pelvisPositionError.sub(tempPosition2d);
 pelvisPositionError.getFrameTuple2dIncludingFrame(tempError2d);
 tempError2d.scale(controlDT);
 pelvisPositionCumulatedError.add(tempError2d);
 double cumulativeErrorMagnitude = pelvisPositionCumulatedError.length();
 if (cumulativeErrorMagnitude > maximumIntegralError.getDoubleValue())
 {
   pelvisPositionCumulatedError.scale(maximumIntegralError.getDoubleValue() / cumulativeErrorMagnitude);
 }
 proportionalTerm.set(pelvisPositionError);
 proportionalTerm.scale(proportionalGain.getDoubleValue());
 integralTerm.set(pelvisPositionCumulatedError);
 integralTerm.scale(integralGain.getDoubleValue());
 desiredICPOffset.set(proportionalTerm);
 desiredICPOffset.add(integralTerm);
}

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

public void computeReferenceFromSolutions(ArrayList<YoFramePoint2d> footstepSolutions, ArrayList<FrameVector2d> entryOffsets, ArrayList<FrameVector2d> exitOffsets,
   FramePoint2d previousStanceExitCMP, FramePoint2d stanceEntryCMP, FramePoint2d stanceExitCMP, FramePoint finalICP, YoFramePoint2d beginningOfStateICP,
   double omega0, int numberOfFootstepsToConsider)
{
 finalICP.getFrameTuple2d(finalICP2d);
 footstepRecursionMultiplierCalculator.computeICPPoints(finalICP2d, footstepSolutions, entryOffsets, exitOffsets, previousStanceExitCMP, stanceEntryCMP,
    stanceExitCMP, beginningOfStateICP.getFrameTuple2d(), numberOfFootstepsToConsider, tmpEndPoint, tmpReferencePoint, tmpReferenceVelocity);
 CapturePointTools.computeDesiredCentroidalMomentumPivot(tmpReferencePoint, tmpReferenceVelocity, omega0, tmpCMP);
 actualEndOfStateICP.set(tmpEndPoint);
 controllerReferenceICP.set(tmpReferencePoint);
 controllerReferenceICPVelocity.set(tmpReferenceVelocity);
 controllerReferenceCMP.set(tmpCMP);
}

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

public void computeNominalValues(ArrayList<YoFramePoint2d> upcomingFootstepLocations, ArrayList<FrameVector2d> entryOffsets, ArrayList<FrameVector2d> exitOffsets,
   FramePoint2d previousStanceExitCMP, FramePoint2d stanceEntryCMP, FramePoint2d stanceExitCMP, FramePoint finalICP, YoFramePoint2d beginningOfStateICP,
   double omega0, int numberOfFootstepsToConsider)
{
 finalICP.getFrameTuple2d(finalICP2d);
 footstepRecursionMultiplierCalculator.computeICPPoints(finalICP2d, upcomingFootstepLocations, entryOffsets, exitOffsets,
    previousStanceExitCMP, stanceEntryCMP, stanceExitCMP, beginningOfStateICP.getFrameTuple2d(), numberOfFootstepsToConsider, tmpEndPoint,
    tmpReferencePoint, tmpReferenceVelocity);
 CapturePointTools.computeDesiredCentroidalMomentumPivot(tmpReferencePoint, tmpReferenceVelocity, omega0, tmpCMP);
 nominalEndOfStateICP.set(tmpEndPoint);
 nominalReferenceICP.set(tmpReferencePoint);
 nominalReferenceICPVelocity.set(tmpReferenceVelocity);
 nominalReferenceCMP.set(tmpCMP);
}

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

rhoRateDefaultWeight.set(momentumOptimizationSettings.getRhoRateDefaultWeight());
rhoRateHighWeight.set(momentumOptimizationSettings.getRhoRateHighWeight());
desiredCoPWeight.set(momentumOptimizationSettings.getCoPWeight());
copRateDefaultWeight.set(momentumOptimizationSettings.getCoPRateDefaultWeight());
copRateHighWeight.set(momentumOptimizationSettings.getCoPRateHighWeight());

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

public boolean isRotating(FramePoint2d cop,
     FramePoint2d desiredCop,
     FrameLine2d lineOfRotation)
  {
   cop.checkReferenceFrameMatch(soleFrame);
   desiredCop.checkReferenceFrameMatch(soleFrame);
   lineOfRotation.checkReferenceFrameMatch(soleFrame);

   if (!lineOfRotation.isPointOnLine(cop)) return false;

   copError2d.setToZero(soleFrame);
   copError2d.sub(desiredCop, cop);
   yoCopError.set(copError2d);

   perpendicularCopError.set(lineOfRotation.distance(desiredCop));
   boolean errorAboveThreshold = perpendicularCopError.getDoubleValue() >= perpendicluarCopErrorThreshold.getDoubleValue();
   perpendicularCopErrorAboveThreshold.set(errorAboveThreshold);

   double acos = perpendicularCopError.getDoubleValue() / copError2d.length();
   angleBetweenCopErrorAndLine.set(Math.acos(Math.abs(acos)));
   boolean angleInBounds = angleBetweenCopErrorAndLine.getDoubleValue() <= angleThreshold.getDoubleValue();
   angleOkay.set(angleInBounds);

   boolean correctSide = lineOfRotation.isPointOnRightSideOfLine(desiredCop);
   desiredCopOnCorrectSide.set(correctSide);

   return errorAboveThreshold && angleInBounds && correctSide;
  }
}

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

@Override
public void doControl()
{
 // update the linear momentum rate by numerical differentiation of the robot momentum
 simulatedRobot.getRootJoint().physics.recursiveComputeLinearMomentum(linearMomentum);
 yoLinearMomentum.set(linearMomentum);
 momentumChange.update();
 momentumChange.get(linearMomentumRate);
 // get mass and COM position from the robot
 double totalMass = simulatedRobot.computeCenterOfMass(comPosition);
 comPosition2d.set(comPosition.getX(), comPosition.getY());
 // now compute the COM acceleration
 comAcceleration.set(linearMomentumRate.getX(), linearMomentumRate.getY());
 comAcceleration.scale(1.0 / totalMass);
 // CMP = COM - 1/omega^2 * COMAcc
 double omega0 = Math.sqrt(-gravity / comPosition.getZ());
 cmp.set(comAcceleration);
 cmp.scale(- 1.0 / (omega0 * omega0));
 cmp.add(comPosition2d);
 yoCmp.set(cmp);
}

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

@Override
public void doControl()
{
 // update the linear momentum rate by numerical differentiation of the robot momentum
 simulatedRobot.getRootJoint().physics.recursiveComputeLinearMomentum(linearMomentum);
 yoLinearMomentum.set(linearMomentum);
 momentumChange.update();
 momentumChange.get(linearMomentumRate);
 // get mass and COM position from the robot
 double totalMass = simulatedRobot.computeCenterOfMass(comPosition);
 comPosition2d.set(comPosition.getX(), comPosition.getY());
 // now compute the COM acceleration
 comAcceleration.set(linearMomentumRate.getX(), linearMomentumRate.getY());
 comAcceleration.scale(1.0 / totalMass);
 // CMP = COM - 1/omega^2 * COMAcc
 double omega0 = Math.sqrt(-gravity / comPosition.getZ());
 cmp.set(comAcceleration);
 cmp.scale(- 1.0 / (omega0 * omega0));
 cmp.add(comPosition2d);
 yoCmp.set(cmp);
}

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

@Override
public double calculateCost(FramePose stanceFoot, FramePose swingStartFoot, FramePose idealFootstep, FramePose candidateFootstep, double percentageOfFoothold)
{
 double cost = footstepBaseCost.getDoubleValue();
 setXYVectorFromPoseToPoseNormalize(forwardCostVector, swingStartFoot, idealFootstep);
 setXYVectorFromPoseToPoseNormalize(backwardCostVector, idealFootstep, swingStartFoot);
 inwardCostVector.set(forwardCostVector.getY(), -forwardCostVector.getX());
 outwardCostVector.set(-forwardCostVector.getY(), forwardCostVector.getX());
 upwardCostVector.set(0.0, 0.0, 1.0);
 downwardVector.set(0.0, 0.0, -1.0);
 setVectorFromPoseToPose(idealToCandidateVector, idealFootstep, candidateFootstep);
 setOrientationFromPoseToPose(idealToCandidateOrientation, idealFootstep, candidateFootstep);
 double downwardPenalizationWeightConsideringStancePitch = downwardCostScalar.getDoubleValue();
 if (stanceFoot.getPitch() < 0)
 {
   downwardPenalizationWeightConsideringStancePitch += -stanceFoot.getPitch() * stancePitchDownwardCostScalar.getDoubleValue();
 }
 cost += penalizeCandidateFootstep(forwardCostVector, forwardCostScalar.getDoubleValue());
 cost += penalizeCandidateFootstep(backwardCostVector, backwardCostScalar.getDoubleValue());
 cost += penalizeCandidateFootstep(inwardCostVector, inwardCostScalar.getDoubleValue());
 cost += penalizeCandidateFootstep(outwardCostVector, outwardCostScalar.getDoubleValue());
 cost += penalizeCandidateFootstep(upwardCostVector, upwardCostScalar.getDoubleValue());
 cost += penalizeCandidateFootstep(downwardVector, downwardPenalizationWeightConsideringStancePitch);
 cost += angularCostScalar.getDoubleValue() * Math.abs(idealToCandidateOrientation.getYaw().getDoubleValue());
 cost += angularCostScalar.getDoubleValue() * Math.abs(idealToCandidateOrientation.getPitch().getDoubleValue());
 cost += angularCostScalar.getDoubleValue() * Math.abs(idealToCandidateOrientation.getRoll().getDoubleValue());
 cost += (1.0 - percentageOfFoothold) * negativeFootholdLinearCostScalar.getDoubleValue();
 return cost;
}

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

icpError.set(currentICP);
icpError.sub(solutionHandler.getControllerReferenceICP());
controllerFeedbackCMPDelta.set(desiredCMPDelta);

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

icpError.set(capturePoint);
icpError.sub(desiredCapturePoint);
  icpErrorIntegrated.set(0.0, 0.0);
tempControl.add(icpIntegral);
feedbackPart.set(tempControl);
desiredCMP.add(tempControl);

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

copCommandWeightVector.set(copCommandWeight.getDoubleValue(), copCommandWeight.getDoubleValue());

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

yoDesiredICPVelocity.set(desiredCapturePointVelocity2d);

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

copCommandWeightVector.set(copCommandWeight.getDoubleValue(), copCommandWeight.getDoubleValue());
copCommandWeightVector.get(tempVector2d);
centerOfPressureCommand.setWeight(tempVector2d);

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

pelvisShiftScaleFactor.set(0.4, 0.7);

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