gpt4 book ai didi

us.ihmc.yoVariables.variable.YoFrameVector2D.set()方法的使用及代码示例

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

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

YoFrameVector2D.set介绍

暂无

代码示例

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

public void update(Tuple2DReadOnly currentPosition)
  {
   if (!hasBeenCalled.getBooleanValue())
   {
     hasBeenCalled.set(true);
     lastPosition.set(currentPosition);
     setToZero();
   }

   currentRawDerivative.sub(currentPosition, lastPosition);
   currentRawDerivative.scale(1.0 / dt);

   interpolate(currentRawDerivative, this, alphaProvider.getValue());

   lastPosition.set(currentPosition);
  }
}

代码示例来源:origin: us.ihmc/ihmc-footstep-planning

private void setXYVectorFromPoseToPoseNormalize(YoFrameVector2D vectorToPack, FramePose3D fromPose, FramePose3D toPose)
{
 if (fromPose.getPosition().epsilonEquals(toPose.getPosition(), 1e-7))
 {
   vectorToPack.set(fromPose.getReferenceFrame(), 0.0, 0.0);
 }
 else
 {
   FrameVector2D frameTuple2d = new FrameVector2D(vectorToPack);
   frameTuple2d.set(toPose.getPosition());
   fromPose.checkReferenceFrameMatch(vectorToPack);
   frameTuple2d.sub(fromPose.getX(), fromPose.getY());
   frameTuple2d.normalize();
   vectorToPack.set((Tuple2DReadOnly) frameTuple2d);
 }
}

代码示例来源:origin: us.ihmc/simulation-construction-set-tools

@Override
public void doControl()
{
 if (time.getDoubleValue() > timeToDoPerturbance.getDoubleValue())
 {
   computeForcePerturbance();
   perturbable.setForcePerturbance(perturbanceForce, perturbanceDuration.getDoubleValue());
   perturbanceApplicationPoint.set(perturbable.getForcePerturbanceApplicationPoint());
 }
 
 if (time.getDoubleValue() > timeToDoPerturbance.getDoubleValue() + perturbanceDuration.getDoubleValue())
 {
   perturbable.resetPerturbanceForceIfNecessary();
   perturbanceUnitVector.set(0.0, 0.0);
 }
}

代码示例来源:origin: us.ihmc/ihmc-footstep-planning

@Override
public double calculateCost(FramePose3D stanceFoot, FramePose3D swingStartFoot, FramePose3D idealFootstep, FramePose3D 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/ihmc-simulation-toolkit

@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();
 linearMomentumRate.set(momentumChange);
 // 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);
 comAcceleration.scale(1.0 / totalMass);
 // CMP = COMxy - (z/Fz)*Fxy
 cmp.set(comAcceleration);
 double z = comPosition.getZ();
 double normalizedFz = -gravity + comAcceleration.getZ();
 cmp.scale(-z / normalizedFz);
 cmp.add(comPosition2d);
 yoCmp.set(cmp);
}

代码示例来源:origin: us.ihmc/simulation-construction-set-test

YoFrameVector2D radii = new YoFrameVector2D("radii", ReferenceFrame.getWorldFrame(), registry);
center.set(-1.0, -1.0);
radii.set(1.0, 0.7);

代码示例来源:origin: us.ihmc/ihmc-humanoid-behaviors

pelvisShiftScaleFactor.set(0.4, 0.7);

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