gpt4 book ai didi

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

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

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

YoFrameVector2D.getX介绍

暂无

代码示例

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

public void computeForcePerturbance()
{
 if (perturbanceUnitVector.getX() > 0.0)
 {
   perturbanceForce.setX(perturbanceUnitVector.getX() * xPosForce);
 }
 else
 {
   perturbanceForce.setX(perturbanceUnitVector.getX() * xNegForce);
 }
 
 if (perturbanceUnitVector.getY() > 0.0)
 {
   perturbanceForce.setY(perturbanceUnitVector.getY() * yPosForce);
 }
 else
 {
   perturbanceForce.setY(perturbanceUnitVector.getY() * yNegForce);
 }
}

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

private void sequenceShiftWeight()
{
 FramePoint2D center = new FramePoint2D(midFeetZUpFrame);
 FrameConvexPolygon2D supportPolygon = new FrameConvexPolygon2D(yoSupportPolygon);
 supportPolygon.changeFrameAndProjectToXYPlane(midFeetZUpFrame);
 FramePoint2D desiredPelvisOffset = new FramePoint2D(midFeetZUpFrame);
 for (int i = 0; i < supportPolygon.getNumberOfVertices(); i++)
 {
   desiredPelvisOffset.setIncludingFrame(supportPolygon.getVertex(i));
   desiredPelvisOffset.sub(center);
   submitDesiredPelvisPositionOffset(false, pelvisShiftScaleFactor.getX() * desiredPelvisOffset.getX(),
                    pelvisShiftScaleFactor.getY() * desiredPelvisOffset.getY(), 0.0);
 }
 // Get back to the first vertex again
 desiredPelvisOffset.setIncludingFrame(supportPolygon.getVertex(0));
 desiredPelvisOffset.sub(center);
 submitDesiredPelvisPositionOffset(false, pelvisShiftScaleFactor.getX() * desiredPelvisOffset.getX(),
                  pelvisShiftScaleFactor.getY() * desiredPelvisOffset.getY(), 0.0);
 submitPelvisHomeCommand(false);
}

代码示例来源: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-humanoid-behaviors

private void sequenceMediumWarmup()
{
 FramePoint2D center = new FramePoint2D(midFeetZUpFrame);
 FrameVector2D shiftScaleVector = new FrameVector2D(midFeetZUpFrame, 0.1, 0.7);
 FrameConvexPolygon2D supportPolygon = new FrameConvexPolygon2D(yoSupportPolygon);
 supportPolygon.changeFrameAndProjectToXYPlane(midFeetZUpFrame);
 FramePoint2D desiredPelvisOffset = new FramePoint2D(midFeetZUpFrame);
 for (int i = 0; i < supportPolygon.getNumberOfVertices(); i++)
 {
   desiredPelvisOffset.setIncludingFrame(supportPolygon.getVertex(i));
   desiredPelvisOffset.sub(center);
   submitDesiredPelvisPositionOffset(false, shiftScaleVector.getX() * desiredPelvisOffset.getX(), shiftScaleVector.getY() * desiredPelvisOffset.getY(),
                    0.0);
   sequenceSquats();
   sequenceChestRotations(0.55); //TODO increase/decrease limit?
   sequencePelvisRotations(0.3); //TODO increase/decrease limit?
 }
 // Get back to the first vertex again
 desiredPelvisOffset.setIncludingFrame(supportPolygon.getVertex(0));
 desiredPelvisOffset.sub(center);
 submitDesiredPelvisPositionOffset(false, pelvisShiftScaleFactor.getX() * desiredPelvisOffset.getX(),
                  pelvisShiftScaleFactor.getY() * desiredPelvisOffset.getY(), 0.0);
 submitChestHomeCommand(false);
 submitPelvisHomeCommand(false);
}

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