本文整理了Java中us.ihmc.yoVariables.variable.YoFramePoint3D.getX()
方法的一些代码示例,展示了YoFramePoint3D.getX()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YoFramePoint3D.getX()
方法的具体详情如下:
包路径:us.ihmc.yoVariables.variable.YoFramePoint3D
类名称:YoFramePoint3D
方法名:getX
暂无
代码示例来源:origin: us.ihmc/ihmc-yovariables
public double getX()
{
return getPosition().getX();
}
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
public void getProjectedOntoXYPlane(YoFramePoint2D positionToPack)
{
positionToPack.set(currentPosition.getX(), currentPosition.getY());
}
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces
private void setupSlidersForSupportBaseControl()
{
int sliderChannel = 1;
for (int i = 0; i < baseControlPoints.length; i++)
{
YoFramePoint3D baseControlPoint = baseControlPoints[i];
sliderBoard.setSlider(sliderChannel++, baseControlPoint.getYoX(), baseControlPoint.getX() - 2, baseControlPoint.getX() + 2);
sliderBoard.setSlider(sliderChannel++, baseControlPoint.getYoY(), baseControlPoint.getY() - 2, baseControlPoint.getY() + 2);
}
}
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces
private void setupSlidersForSupportBaseTargetControl()
{
int sliderChannel = 1;
for (int i = 0; i < baseControlTargetPoints.length; i++)
{
YoFramePoint3D baseControlTargetPoint = baseControlTargetPoints[i];
sliderBoard.setSlider(sliderChannel++, baseControlTargetPoint.getYoX(), baseControlTargetPoint.getX() - 2, baseControlTargetPoint.getX() + 2);
sliderBoard.setSlider(sliderChannel++, baseControlTargetPoint.getYoY(), baseControlTargetPoint.getY() - 2, baseControlTargetPoint.getY() + 2);
}
}
代码示例来源:origin: us.ihmc/simulation-construction-set-tools
public void handleClick(Point3D intersectionPosition, Point3D cameraPosition)
{
LaunchedBall nextBall = poolOfBalls.get(nextBallIndex);
final double ballVelocityMagnitude = directedPerturbance.getBallVelocityMagnitude();
tempPoint.set(ballTarget.getX(), ballTarget.getY(), ballTarget.getZ());
Point3D initialPosition = computeInitialPosition(intersectionPosition, ballTarget.getZ());
final Point3D finalPosition = computeFinalPosition(initialPosition, ballVelocityMagnitude);
nextBall.launch(initialPosition, finalPosition, directedPerturbance.getBallMass(), ballVelocityMagnitude);
nextBallIndex++;
if (nextBallIndex >= poolOfBalls.size())
{
nextBallIndex = 0;
}
}
代码示例来源:origin: us.ihmc/simulation-construction-set-tools
private Point3D computeFinalPosition(Point3D initialPosition, double ballVelocityMagnitude)
{
tempPoint.set(ballTarget.getX(), ballTarget.getY(), ballTarget.getZ());
double distance = initialPosition.distance(tempPoint);
double estimatedCollisionTime = distance / ballVelocityMagnitude;
Point3D ret = new Point3D(ballTargetVelocity);
ret.scale(estimatedCollisionTime);
ret.add(tempPoint);
return ret;
}
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
@Override
protected void updateTransformToParent(RigidBodyTransform transformToParent)
{
yoFramePose.getOrientation().getQuaternion(rotation);
transformToParent.setRotation(rotation);
YoFramePoint3D yoFramePoint = yoFramePose.getPosition();
transformToParent.setTranslation(yoFramePoint.getX(), yoFramePoint.getY(), yoFramePoint.getZ());
}
代码示例来源:origin: us.ihmc/simulation-construction-set-tools
@Override
public double[] getMessageValues()
{
return new double[]
{
force.getX(), force.getY(), force.getZ(), position.getX(), position.getY(), position.getZ(),
groundContactPoint.getYoFootSwitch().getDoubleValue()
};
}
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
private void initializePolynomials()
{
xPolynomial.setInitialPositionVelocityZeroFinalHighOrderDerivatives(0.0, trajectoryTime.getDoubleValue(), initialPosition.getX(), initialVelocity.getX(), finalPosition.getX(), finalVelocity.getX());
yPolynomial.setInitialPositionVelocityZeroFinalHighOrderDerivatives(0.0, trajectoryTime.getDoubleValue(), initialPosition.getY(), initialVelocity.getY(), finalPosition.getY(), finalVelocity.getY());
zPolynomial.setInitialPositionVelocityZeroFinalHighOrderDerivatives(0.0, trajectoryTime.getDoubleValue(), initialPosition.getZ(), initialVelocity.getZ(), finalPosition.getZ(), finalVelocity.getZ());
}
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
@Override
public void initialize()
{
currentTime.set(0.0);
double tIntermediate = trajectoryTime.getDoubleValue() / 2.0;
xPolynomial.setQuadraticWithFinalVelocityConstraint(0.0,trajectoryTime.getDoubleValue(), initialPosition.getX(), finalPosition.getX(), finalVelocity.getX());
yPolynomial.setQuadraticWithFinalVelocityConstraint(0.0,trajectoryTime.getDoubleValue(), initialPosition.getY(), finalPosition.getY(), finalVelocity.getY());
zPolynomial.setCubicWithIntermediatePositionAndFinalVelocityConstraint(0.0, tIntermediate, trajectoryTime.getDoubleValue(), initialPosition.getZ(), intermediateZPosition.getDoubleValue(), finalPosition.getZ(), finalVelocity.getZ());
currentPosition.set(initialPosition);
currentAcceleration.setToZero();
}
代码示例来源:origin: us.ihmc/ihmc-humanoid-behaviors
endPose.setPosition(new FramePoint2D(worldFrame, targetLocation.getX(), targetLocation.getY()));
endPose.setOrientation(new FrameOrientation2D(worldFrame, targetOrientation.getYaw().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-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-graphics-description
@Override
public Artifact createArtifact()
{
MutableColor color3f = appearance.getColor();
YoDouble endPointX = new YoDouble(getName() + "ArtifactEndPointX", base.getYoX().getYoVariableRegistry());
YoDouble endPointY = new YoDouble(getName() + "ArtifactEndPointY", base.getYoY().getYoVariableRegistry());
base.getYoX().addVariableChangedListener(v -> endPointX.set(base.getX() + vector.getX()));
base.getYoY().addVariableChangedListener(v -> endPointY.set(base.getY() + vector.getY()));
vector.getYoX().addVariableChangedListener(v -> endPointX.set(base.getX() + vector.getX()));
vector.getYoY().addVariableChangedListener(v -> endPointY.set(base.getY() + vector.getY()));
return new YoArtifactLineSegment2d(getName(),
new YoFrameLineSegment2D(base.getYoX(), base.getYoY(), endPointX, endPointY, ReferenceFrame.getWorldFrame()),
color3f.get());
}
代码示例来源:origin: us.ihmc/ihmc-common-walking-control-modules-test
Assert.assertEquals(integratedCoMPosition.getX(), desiredCoMPosition.getX(), epsilon);
Assert.assertEquals(integratedCoMPosition.getY(), desiredCoMPosition.getY(), epsilon);
Assert.assertEquals(integratedCoMPosition.getX(), finalCoM.getX(), epsilon);
Assert.assertEquals(integratedCoMPosition.getY(), finalCoM.getY(), epsilon);
代码示例来源:origin: us.ihmc/ihmc-common-walking-control-modules-test
Assert.assertEquals(integratedCoMPosition.getX(), desiredCoMPosition.getX(), epsilon);
Assert.assertEquals(integratedCoMPosition.getY(), desiredCoMPosition.getY(), epsilon);
Assert.assertEquals(integratedCoMPosition.getX(), finalCoM.getX(), epsilon);
Assert.assertEquals(integratedCoMPosition.getY(), finalCoM.getY(), epsilon);
代码示例来源:origin: us.ihmc/ihmc-common-walking-control-modules-test
Assert.assertEquals(integratedCoMPosition.getX(), desiredCoMPosition.getX(), epsilon);
Assert.assertEquals(integratedCoMPosition.getY(), desiredCoMPosition.getY(), epsilon);
Assert.assertEquals(integratedCoMPosition.getX(), finalCoM.getX(), epsilon);
Assert.assertEquals(integratedCoMPosition.getY(), finalCoM.getY(), epsilon);
内容来源于网络,如有侵权,请联系作者删除!