gpt4 book ai didi

us.ihmc.robotics.math.trajectories.waypoints.YoFrameSO3TrajectoryPoint类的使用及代码示例

转载 作者:知者 更新时间:2024-03-16 07:41:31 28 4
gpt4 key购买 nike

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

YoFrameSO3TrajectoryPoint介绍

暂无

代码示例

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

public void setTrajectoryParameters(YoFrameSO3TrajectoryPoint initialYoFrameSO3Waypoint, YoFrameSO3TrajectoryPoint finalYoFrameSO3Waypoint)
{
 setTrajectoryTime(finalYoFrameSO3Waypoint.getTime() - initialYoFrameSO3Waypoint.getTime());
 initialOrientation.set(initialYoFrameSO3Waypoint.getOrientation());
 initialAngularVelocity.set(initialYoFrameSO3Waypoint.getAngularVelocity());
 finalOrientation.set(finalYoFrameSO3Waypoint.getOrientation());
 finalAngularVelocity.set(finalYoFrameSO3Waypoint.getAngularVelocity());
}

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

public void set(SO3TrajectoryPointInterface<?> so3TrajectoryPoint)
{
 frameWaypoint.setToZero(getReferenceFrame());
 frameWaypoint.set(so3TrajectoryPoint);
 getYoValuesFromFrameWaypoint();
}

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

private void appendWaypointUnsafe(double timeAtWaypoint, FrameQuaternionReadOnly orientation, FrameVector3DReadOnly angularVelocity)
{
 waypoints.get(numberOfWaypoints.getIntegerValue()).set(timeAtWaypoint, orientation, angularVelocity);
 numberOfWaypoints.increment();
}

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

@Override
public void setToNaN()
{
 super.setToNaN();
 setTimeToNaN();
 setOrientationToNaN();
 setAngularVelocityToNaN();
}

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

YoFrameSO3TrajectoryPoint yoFrameSO3TrajectoryPoint = new YoFrameSO3TrajectoryPoint(namePrefix, nameSuffix, registry, worldFrame);
yoFrameSO3TrajectoryPoint.checkReferenceFrameMatch(ReferenceFrame.getWorldFrame());
yoFrameSO3TrajectoryPoint.setIncludingFrame(worldFrame, simpleTrajectoryPoint);
yoFrameSO3TrajectoryPoint.getOrientation(quaternionForVerification);
yoFrameSO3TrajectoryPoint.getAngularVelocity(angularVelocityForVerification);
assertEquals(time, yoFrameSO3TrajectoryPoint.getTime(), 1e-10);
assertTrue(quaternionForVerification.epsilonEquals(orientation, 1e-10));
assertTrue(angularVelocityForVerification.epsilonEquals(angularVelocity, 1e-10));
assertFalse(yoFrameSO3TrajectoryPoint.containsNaN());
yoFrameSO3TrajectoryPoint.setOrientationToNaN();
assertTrue(yoFrameSO3TrajectoryPoint.containsNaN());
yoFrameSO3TrajectoryPoint.setOrientationToZero();
assertFalse(yoFrameSO3TrajectoryPoint.containsNaN());
yoFrameSO3TrajectoryPoint.setAngularVelocityToNaN();
assertTrue(yoFrameSO3TrajectoryPoint.containsNaN());
yoFrameSO3TrajectoryPoint.setAngularVelocityToZero();
assertFalse(yoFrameSO3TrajectoryPoint.containsNaN());
yoFrameSO3TrajectoryPoint.getOrientation(orientation);
yoFrameSO3TrajectoryPoint.getAngularVelocity(angularVelocity);
assertFalse(Math.abs(yoFrameSO3TrajectoryPoint.getTime() - time) < 1e-7);
assertFalse(quaternionForVerification.epsilonEquals(orientation, 1e-7));
assertFalse(angularVelocityForVerification.epsilonEquals(angularVelocity, 1e-7));

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

String expectedNamePrefix = "test";
String expectedNameSuffix = "blop";
YoFrameSO3TrajectoryPoint testedYoFrameSO3TrajectoryPoint = new YoFrameSO3TrajectoryPoint(expectedNamePrefix, expectedNameSuffix,
                                             new YoVariableRegistry("schnoop"), expectedFrame);
testedYoFrameSO3TrajectoryPoint.set(expectedTime, expectedOrientation, expectedAngularVelocity);
testedYoFrameSO3TrajectoryPoint.setToNaN();
assertTrue(Double.isNaN(testedYoFrameSO3TrajectoryPoint.getTime()));
assertTrue(testedYoFrameSO3TrajectoryPoint.getOrientation().containsNaN());
assertTrue(testedYoFrameSO3TrajectoryPoint.getAngularVelocity().containsNaN());
testedYoFrameSO3TrajectoryPoint.registerReferenceFrame(expectedFrame);
expectedTime = RandomNumbers.nextDouble(random, 0.0, 1000.0);
expectedOrientation = EuclidFrameRandomTools.nextFrameQuaternion(random, worldFrame);
expectedAngularVelocity = EuclidFrameRandomTools.nextFrameVector3D(random, worldFrame);
testedYoFrameSO3TrajectoryPoint.switchCurrentReferenceFrame(worldFrame);
testedYoFrameSO3TrajectoryPoint.registerReferenceFrame(worldFrame);
testedYoFrameSO3TrajectoryPoint.set(expectedTime, expectedOrientation, expectedAngularVelocity);
testedYoFrameSO3TrajectoryPoint.setToNaN(expectedFrame);
assertTrue(expectedFrame == testedYoFrameSO3TrajectoryPoint.getReferenceFrame());
assertTrue(Double.isNaN(testedYoFrameSO3TrajectoryPoint.getTime()));
assertTrue(testedYoFrameSO3TrajectoryPoint.getOrientation().containsNaN());
assertTrue(testedYoFrameSO3TrajectoryPoint.getAngularVelocity().containsNaN());

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

YoFrameSO3TrajectoryPoint testedYoFrameSO3TrajectoryPoint = new YoFrameSO3TrajectoryPoint(expectedNamePrefix, expectedNameSuffix,
                                             new YoVariableRegistry("schnoop"), expectedFrame);
expectedAngularVelocity = EuclidFrameRandomTools.nextFrameVector3D(random, expectedFrame);
testedYoFrameSO3TrajectoryPoint.set(expectedTime, expectedOrientation, expectedAngularVelocity);
expectedAngularVelocity = EuclidFrameRandomTools.nextFrameVector3D(random, expectedFrame);
testedYoFrameSO3TrajectoryPoint.set(expectedTime, expectedOrientation, expectedAngularVelocity);
expectedAngularVelocity = EuclidFrameRandomTools.nextFrameVector3D(random, expectedFrame);
YoFrameSO3TrajectoryPoint expectedYoFrameSO3TrajectoryPoint = new YoFrameSO3TrajectoryPoint("sdfsd", "asd", new YoVariableRegistry("asawe"),
                                              expectedFrame);
testedYoFrameSO3TrajectoryPoint.set(expectedYoFrameSO3TrajectoryPoint);
assertTrue(expectedYoFrameSO3TrajectoryPoint.epsilonEquals(testedYoFrameSO3TrajectoryPoint, epsilon));
assertWaypointContainsExpectedData(expectedNamePrefix, expectedNameSuffix, testedYoFrameSO3TrajectoryPoint.getReferenceFrame(),
                  testedYoFrameSO3TrajectoryPoint.getTime(), testedYoFrameSO3TrajectoryPoint.getOrientation(),
                  testedYoFrameSO3TrajectoryPoint.getAngularVelocity(), testedYoFrameSO3TrajectoryPoint, epsilon);

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

YoFrameSO3TrajectoryPoint testedYoFrameSO3TrajectoryPoint, double epsilon)
assertTrue(expectedFrame == testedYoFrameSO3TrajectoryPoint.getReferenceFrame());
assertEquals(expectedTime, testedYoFrameSO3TrajectoryPoint.getTime(), epsilon);
assertEquals(expectedNamePrefix, testedYoFrameSO3TrajectoryPoint.getNamePrefix());
assertEquals(expectedNameSuffix, testedYoFrameSO3TrajectoryPoint.getNameSuffix());
assertTrue(expectedOrientation.geometricallyEquals(testedYoFrameSO3TrajectoryPoint.getOrientation(), epsilon));
assertTrue(expectedAngularVelocity.epsilonEquals(testedYoFrameSO3TrajectoryPoint.getAngularVelocity(), epsilon));
testedYoFrameSO3TrajectoryPoint.getIncludingFrame(actualFrameSO3TrajectoryPoint);
FrameSO3TrajectoryPointTest.assertTrajectoryPointContainsExpectedData(expectedFrame, expectedTime, expectedOrientation, expectedAngularVelocity,
                                   actualFrameSO3TrajectoryPoint, epsilon);
actualFrameSO3TrajectoryPoint = new FrameSO3TrajectoryPoint(expectedFrame);
testedYoFrameSO3TrajectoryPoint.get(actualFrameSO3TrajectoryPoint);
FrameSO3TrajectoryPointTest.assertTrajectoryPointContainsExpectedData(expectedFrame, expectedTime, expectedOrientation, expectedAngularVelocity,
                                   actualFrameSO3TrajectoryPoint, epsilon);
Vector3D actualAngularVelocity = new Vector3D();
testedYoFrameSO3TrajectoryPoint.getOrientation(actualOrientation);
testedYoFrameSO3TrajectoryPoint.getAngularVelocity(actualAngularVelocity);
testedYoFrameSO3TrajectoryPoint.getOrientation(actualFrameOrientation);
testedYoFrameSO3TrajectoryPoint.getAngularVelocity(actualFrameAngularVelocity);
testedYoFrameSO3TrajectoryPoint.getOrientationIncludingFrame(actualFrameOrientation);
testedYoFrameSO3TrajectoryPoint.getAngularVelocityIncludingFrame(actualFrameAngularVelocity);

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

YoFrameSO3TrajectoryPoint yoFrameSO3TrajectoryPoint = new YoFrameSO3TrajectoryPoint(namePrefix, nameSuffix, registry, worldFrame);
yoFrameSO3TrajectoryPoint.checkReferenceFrameMatch(ReferenceFrame.getWorldFrame());
yoFrameSO3TrajectoryPoint.setTime(time);
yoFrameSO3TrajectoryPoint.setOrientation(orientation);
yoFrameSO3TrajectoryPoint.setAngularVelocity(angularVelocity);
poseFrame.setOrientationAndUpdate(poseOrientation);
yoFrameSO3TrajectoryPoint.registerReferenceFrame(poseFrame);
yoFrameSO3TrajectoryPoint.changeFrame(poseFrame);
assertFalse(orientation.epsilonEquals(yoFrameSO3TrajectoryPoint.getOrientation(), 1e-10));
assertFalse(angularVelocity.epsilonEquals(yoFrameSO3TrajectoryPoint.getAngularVelocity(), 1e-10));
assertTrue(orientation.epsilonEquals(yoFrameSO3TrajectoryPoint.getOrientation(), 1e-10));
assertTrue(angularVelocity.epsilonEquals(yoFrameSO3TrajectoryPoint.getAngularVelocity(), 1e-10));
YoFrameSO3TrajectoryPoint yoFrameSO3TrajectoryPointTwo = new YoFrameSO3TrajectoryPoint(namePrefix, nameSuffix + "Two", registry, poseFrame);
yoFrameSO3TrajectoryPointTwo.setTime(time);
yoFrameSO3TrajectoryPointTwo.setOrientation(orientation);
yoFrameSO3TrajectoryPointTwo.setAngularVelocity(angularVelocity);
assertTrue(yoFrameSO3TrajectoryPointTwo.epsilonEquals(yoFrameSO3TrajectoryPointTwo, 1e-10));

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

poseFrame.setOrientationAndUpdate(poseOrientation);
YoFrameSO3TrajectoryPoint yoFrameSO3TrajectoryPoint = new YoFrameSO3TrajectoryPoint(namePrefix, nameSuffix, registry, worldFrame, poseFrame);
SimpleSO3TrajectoryPoint simpleTrajectoryPoint = new SimpleSO3TrajectoryPoint();
yoFrameSO3TrajectoryPoint.setIncludingFrame(worldFrame, simpleTrajectoryPoint);
yoFrameSO3TrajectoryPoint.changeFrame(poseFrame);
YoFrameSO3TrajectoryPoint expectedYoFrameSO3TrajectoryPoint = new YoFrameSO3TrajectoryPoint(namePrefix, nameSuffix, registry, poseFrame);
expectedYoFrameSO3TrajectoryPoint.setTime(time);
expectedYoFrameSO3TrajectoryPoint.setOrientation(orientation);
expectedYoFrameSO3TrajectoryPoint.setAngularVelocity(angularVelocity);
assertEquals(3.4, yoFrameSO3TrajectoryPoint.getTime(), 1e-7);
assertEquals(3.4, expectedYoFrameSO3TrajectoryPoint.getTime(), 1e-7);
assertTrue(expectedYoFrameSO3TrajectoryPoint.epsilonEquals(yoFrameSO3TrajectoryPoint, 1e-10));

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

String expectedNamePrefix = "test";
String expectedNameSuffix = "blop";
YoFrameSO3TrajectoryPoint testedYoFrameSO3TrajectoryPoint = new YoFrameSO3TrajectoryPoint(expectedNamePrefix, expectedNameSuffix,
                                             new YoVariableRegistry("schnoop"), expectedFrame);
testedYoFrameSO3TrajectoryPoint.set(expectedTime, expectedOrientation, expectedAngularVelocity);
testedYoFrameSO3TrajectoryPoint.setToZero();
testedYoFrameSO3TrajectoryPoint.registerReferenceFrame(expectedFrame);
testedYoFrameSO3TrajectoryPoint.switchCurrentReferenceFrame(worldFrame);
testedYoFrameSO3TrajectoryPoint.registerReferenceFrame(worldFrame);
testedYoFrameSO3TrajectoryPoint.set(expectedTime, expectedOrientation, expectedAngularVelocity);
testedYoFrameSO3TrajectoryPoint.switchCurrentReferenceFrame(expectedFrame);

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

String expectedNamePrefix = "test";
String expectedNameSuffix = "blop";
YoFrameSO3TrajectoryPoint testedYoFrameSO3TrajectoryPoint = new YoFrameSO3TrajectoryPoint(expectedNamePrefix, expectedNameSuffix,
                                             new YoVariableRegistry("schnoop"), expectedFrame);
testedYoFrameSO3TrajectoryPoint.set(expectedTime, expectedOrientation, expectedAngularVelocity);
  testedYoFrameSO3TrajectoryPoint.registerReferenceFrame(expectedFrame);
  testedYoFrameSO3TrajectoryPoint.changeFrame(expectedFrame);

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

@Override
public void setToNaN(ReferenceFrame referenceFrame)
{
 super.setToNaN(referenceFrame);
 setToNaN();
}

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

public double getLastWaypointTime()
{
 return waypoints.get(numberOfWaypoints.getIntegerValue() - 1).getTime();
}

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

public MultipleWaypointsOrientationTrajectoryGenerator(String namePrefix, int maximumNumberOfWaypoints, boolean allowMultipleFrames,
   ReferenceFrame referenceFrame, YoVariableRegistry parentRegistry)
{
 super(allowMultipleFrames, referenceFrame);
 this.namePrefix = namePrefix;
 this.maximumNumberOfWaypoints = maximumNumberOfWaypoints;
 registry = new YoVariableRegistry(namePrefix + getClass().getSimpleName());
 numberOfWaypoints = new IntegerYoVariable(namePrefix + "NumberOfWaypoints", registry);
 numberOfWaypoints.set(0);
 waypoints = new ArrayList<>(maximumNumberOfWaypoints);
 currentTrajectoryTime = new DoubleYoVariable(namePrefix + "CurrentTrajectoryTime", registry);
 currentWaypointIndex = new IntegerYoVariable(namePrefix + "CurrentWaypointIndex", registry);
 subTrajectory = new HermiteCurveBasedOrientationTrajectoryGenerator(namePrefix + "SubTrajectory", allowMultipleFrames, referenceFrame, registry);
 registerTrajectoryGeneratorsInMultipleFrames(subTrajectory);
 for (int i = 0; i < maximumNumberOfWaypoints; i++)
 {
   YoFrameSO3TrajectoryPoint waypoint = new YoFrameSO3TrajectoryPoint(namePrefix, "AtWaypoint" + i, registry, referenceFrame);
   if (allowMultipleFrames)
    registerMultipleFramesHolders(waypoint);
   waypoints.add(waypoint);
 }
 clear();
 parentRegistry.addChild(registry);
}

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

@Override
protected void putYoValuesIntoFrameWaypoint()
{
 frameWaypoint.setToZero(getReferenceFrame());
 frameWaypoint.setTime(time.getDoubleValue());
 frameWaypoint.setOrientation(orientation);
 frameWaypoint.setAngularVelocity(angularVelocity);
}

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

@Override
public void setToNaN()
{
 super.setToNaN();
 setTimeToNaN();
 setOrientationToNaN();
 setAngularVelocityToNaN();
}

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

@Override
public void setToNaN(ReferenceFrame referenceFrame)
{
 super.setToNaN(referenceFrame);
 setToNaN();
}

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

public double getLastWaypointTime()
{
 return waypoints.get(numberOfWaypoints.getIntegerValue() - 1).getTime();
}

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

public MultipleWaypointsOrientationTrajectoryGenerator(String namePrefix, int maximumNumberOfWaypoints, boolean allowMultipleFrames,
                           ReferenceFrame referenceFrame, YoVariableRegistry parentRegistry)
{
 super(allowMultipleFrames, referenceFrame);
 this.namePrefix = namePrefix;
 this.maximumNumberOfWaypoints = maximumNumberOfWaypoints;
 registry = new YoVariableRegistry(namePrefix + getClass().getSimpleName());
 numberOfWaypoints = new YoInteger(namePrefix + "NumberOfWaypoints", registry);
 numberOfWaypoints.set(0);
 waypoints = new ArrayList<>(maximumNumberOfWaypoints);
 currentTrajectoryTime = new YoDouble(namePrefix + "CurrentTrajectoryTime", registry);
 currentWaypointIndex = new YoInteger(namePrefix + "CurrentWaypointIndex", registry);
 subTrajectory = new HermiteCurveBasedOrientationTrajectoryGenerator(namePrefix + "SubTrajectory", allowMultipleFrames, referenceFrame, registry);
 registerTrajectoryGeneratorsInMultipleFrames(subTrajectory);
 for (int i = 0; i < maximumNumberOfWaypoints; i++)
 {
   YoFrameSO3TrajectoryPoint waypoint = new YoFrameSO3TrajectoryPoint(namePrefix, "AtWaypoint" + i, registry, referenceFrame);
   if (allowMultipleFrames)
    registerMultipleFramesHolders(waypoint);
   waypoints.add(waypoint);
 }
 clear();
 parentRegistry.addChild(registry);
}

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