热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

us.ihmc.robotics.geometry.RigidBodyTransform.get()方法的使用及代码示例

本文整理了Java中us.ihmc.robotics.geometry.RigidBodyTransform.get方法的一些代码示例,展示了RigidBo

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

RigidBodyTransform.get介绍

[英]Pack rotation part into Matrix3d and translation part into Tuple3d
[中]将旋转部分打包到Matrix3d中,将平移部分打包到Tuple3d中

代码示例

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

private boolean isTransformationInPlane(RigidBodyTransform transform)
{
// arguably not a sufficient condition. Reference frames could just happen to be aligned (not likely though). ReferenceFrame2d needed!
double[] transformArray = new double[16];
transform.get(transformArray);
if (((transformArray[2] == 0.0) && (transformArray[6] == 0.0) && (transformArray[8] == 0.0) && (transformArray[9] == 0.0) && (transformArray[10] == 1.0)))
{
return true;
}
else
{
return false;
}
}

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

public static double getMaxLInfiniteDistance(RigidBodyTransform t1, RigidBodyTransform t2)
{
double[] t1Matrix = new double[16];
t1.get(t1Matrix);
double[] t2Matrix = new double[16];
t2.get(t2Matrix);
double maxDifference = 0.0;
for (int i = 0; i <16; i++)
{
double difference = t1Matrix[i] - t2Matrix[i];
if (Math.abs(difference) > maxDifference)
maxDifference = Math.abs(difference);
}
return maxDifference;
}

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

public void setAndUpdate(RigidBodyTransform transform)
{
transform.get(rotation, translation);
setAndUpdate(rotation, translation);
}

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

public void setLidarPose(RigidBodyTransform lidarTransformToWorld)
{
Point3d position = new Point3d();
Quat4d orientation = new Quat4d();
lidarTransformToWorld.get(orientation, position);
lidarPosePacketToSend.set(new LidarPosePacket(position, orientation));
}

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

public static void setGeoregressionTransformFromVecmath(RigidBodyTransform vecmathTransform, Se3_F64 georegressionTransform)
{
double[] m1 = new double[16];
vecmathTransform.get(m1);
double[][] rot = new double[][]
{
{m1[0], m1[1], m1[2]}, {m1[4], m1[5], m1[6]}, {m1[8], m1[9], m1[10]}
};
DenseMatrix64F denseMatrix64F = new DenseMatrix64F(rot);
georegressionTransform.setRotation(denseMatrix64F);
georegressionTransform.setTranslation(m1[3], m1[7], m1[11]);
}

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

/**
* Computes the interpolation between the two transforms using the alpha parameter to control the blend.
* Note that the transforms must have a proper rotation matrix, meaning it satisfies: R'R = I and det(R) = 1
* @param transform1
* @param transform2
* @param alpha Ranges from [0, 1], where return = (1- alpha) * tansform1 + (alpha) * transform2
* @return return = (1- alpha) * tansform1 + alpha * transform2
*/
public void computeInterpolation(RigidBodyTransform transform1, RigidBodyTransform transform2, RigidBodyTransform result, double alpha)
{
alpha = MathTools.clipToMinMax(alpha, 0.0, 1.0);

transform1.get(transform1Quaternion, transform1Translation);
transform2.get(transform2Quaternion, transform2Translation);

interpolatedTranslation.interpolate(transform1Translation, transform2Translation, alpha);
interpolatedQuaternion.interpolate(transform1Quaternion, transform2Quaternion, alpha);

result.setRotationAndZeroTranslation(interpolatedQuaternion);
result.setTranslation(interpolatedTranslation);
}

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

public void transform(RigidBodyTransform transform)
{
Matrix3d rotation = new Matrix3d();
Vector3d translation = new Vector3d();
transform.get(rotation, translation);
translate(translation);
rotate(rotation);
}

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

public void transform(RigidBodyTransform transform)
{
Matrix3d rotation = new Matrix3d();
Vector3d translation = new Vector3d();
transform.get(rotation, translation);
translate(translation);
rotate(rotation);
}

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

public void updateCamera()
{
if (cameraController != null)
{
cameraController.computeTransform(cameraTransform);
cameraTransform.get(cameraRotation, cameraPosition);
setLocationInZUpCoordinates(cameraPosition);
setRotationInZUpcoordinates(cameraRotation);
setHorizontalFoVInRadians((float) cameraController.getHorizontalFieldOfViewInRadians());
setClipDistanceNear((float) cameraController.getClipNear());
setClipDistanceFar((float) cameraController.getClipFar());
}
updateFrustrum();
}

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

@Override
public void adjustFootstepWithoutHeightmap(Footstep footstep, double height, Vector3d planeNormal)
{
Vector3d position = new Vector3d();
Quat4d orientation = new Quat4d();
RigidBodyTransform solePose = new RigidBodyTransform();
footstep.getSolePose(solePose);
solePose.get(orientation, position);
double yaw = RotationTools.computeYaw(orientation);
RotationTools.computeQuaternionFromYawAndZNormal(yaw, planeNormal, orientation);
position.setZ(height);
footstep.setSolePose(new FramePose(ReferenceFrame.getWorldFrame(), new Point3d(position), orientation));
}

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

@Override
public Footstep.FootstepType snapFootstep(Footstep footstep, HeightMapWithPoints heightMap){
FootstepDataMessage originalFootstep = new FootstepDataMessage(footstep);
//set to the sole pose
Vector3d position = new Vector3d();
Quat4d orientation = new Quat4d();
RigidBodyTransform solePose = new RigidBodyTransform();
footstep.getSolePose(solePose);
solePose.get(orientation, position);
originalFootstep.setLocation(new Point3d(position));
originalFootstep.setOrientation(orientation);
//get the footstep
Footstep.FootstepType type = snapFootstep(originalFootstep, heightMap);
if (type == Footstep.FootstepType.FULL_FOOTSTEP && originalFootstep.getPredictedContactPoints() != null){
throw new RuntimeException(this.getClass().getSimpleName() + "Full Footstep should have null contact points");
}
footstep.setPredictedContactPointsFromPoint2ds(originalFootstep.getPredictedContactPoints());
footstep.setFootstepType(type);
FramePose solePoseInWorld = new FramePose(ReferenceFrame.getWorldFrame(), originalFootstep.getLocation(), originalFootstep.getOrientation());
footstep.setSolePose(solePoseInWorld);
footstep.setSwingHeight(originalFootstep.getSwingHeight());
footstep.setTrajectoryType(originalFootstep.getTrajectoryType());
return type;
}

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

private static Transform j3dTransform3DToJMETransform(RigidBodyTransform transform3D)
{
javax.vecmath.Quat4f quat = new javax.vecmath.Quat4f();
javax.vecmath.Vector3f vector = new javax.vecmath.Vector3f();
transform3D.get(quat, vector);
Vector3f jmeVector = new Vector3f(vector.getX(), vector.getY(), vector.getZ());
Quaternion jmeQuat = new Quaternion(quat.getX(), quat.getY(), quat.getZ(), quat.getW());
Transform ret = new Transform(jmeVector, jmeQuat, new Vector3f(1.0f, 1.0f, 1.0f));
return ret;
}

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

@Override
public void update(float tpf)
{
synchronized (lidarTransform)
{
lidarTransform.get(j3dOrientation, j3dPosition);
lidarDistortionProcessor.setTransform(lidarTransform, time);
}
JMEDataTypeUtils.packVecMathTuple3dInJMEVector3f(j3dPosition, jmePosition);
JMEDataTypeUtils.packVectMathQuat4dInJMEQuaternion(j3dOrientation, jmeOrientation);
JMEGeometryUtils.transformFromZupToJMECoordinates(jmePosition);
jmeOrientation.multLocal(scsToJMECameraRotation);
JMEGeometryUtils.transformFromZupToJMECoordinates(jmeOrientation);
for (int i = 0; i {
lidarSceneViewPort[i].setLocation(jmePosition);
if (cameraRotations[i] == null)
{
lidarSceneViewPort[i].setRotation(jmeOrientation);
}
else
{
jmeOrientation.mult(cameraRotations[i], jmeCameraOrientation);
lidarSceneViewPort[i].setRotation(jmeCameraOrientation);
}
}
}

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

public static Transform j3dTransform3DToJMETransform(RigidBodyTransform transform3D)
{
Quat4f quat = new Quat4f();
javax.vecmath.Vector3f vector = new javax.vecmath.Vector3f();
transform3D.get(quat, vector);
Vector3f jmeVector = new Vector3f(vector.getX(), vector.getY(), vector.getZ());
Quaternion jmeQuat = new Quaternion(quat.getX(), quat.getY(), quat.getZ(), quat.getW());
Transform ret = new Transform(jmeVector, jmeQuat, new Vector3f(1.0f, 1.0f, 1.0f));
return ret;
}

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

/**
* Precomputes Ad^{T} * I since it is used twice in Adot*v and once in computing A.
*/
private void precomputeAdjointTimesInertia()
{
tempAdjoint.zero();
for(int i = 0; i {
rigidBodies[i].getInertia().getExpressedInFrame().getTransformToDesiredFrame(tempTransform, centerOfMassFrame);
tempTransform.get(tempMatrix3d,tempVector);
set3By3MatrixBlock(tempAdjoint, 0, 0, tempMatrix3d);
set3By3MatrixBlock(tempAdjoint, 3, 3, tempMatrix3d);
MatrixTools.toTildeForm(tempPTilde, tempVector);
tempPTilde.mul(tempMatrix3d);
set3By3MatrixBlock(tempAdjoint, 0, 3, tempPTilde);
rigidBodies[i].getInertia().getMatrix(tempInertiaMatrix);
CommonOps.mult(tempAdjoint, tempInertiaMatrix, denseAdjTimesI[i]);
}
}

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

public void update(long timestamp)
{
fullRobot.updateFrames();

if(rootJoint != null)
{
RigidBodyTransform rootTransform = rootJoint.getJointTransform3D();
rootTransform.get(tempOrientation, tempPosition);
robot.setOrientation(tempOrientation);
robot.setPositionInWorld(tempPosition);
}

for (ImmutablePair jointPair : revoluteJoints)
{
OneDegreeOfFreedomJoint pinJoint = jointPair.getLeft();
OneDoFJoint revoluteJoint = jointPair.getRight();
pinJoint.setQ(revoluteJoint.getQ());
pinJoint.setQd(revoluteJoint.getQd());
pinJoint.setTau(revoluteJoint.getTau());
}
robot.setTime(robot.getTime() + updateDT);
if (scs != null)
{
scs.tickAndUpdate();
}
}

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

@Override
public Footstep.FootstepType snapFootstep(Footstep footstep, HeightMapWithPoints heightMap){
FootstepDataMessage originalFootstep = new FootstepDataMessage(footstep);
//set to the sole pose
Vector3d position = new Vector3d();
Quat4d orientation = new Quat4d();
RigidBodyTransform solePose = new RigidBodyTransform();
footstep.getSolePose(solePose);
solePose.get(orientation, position);
originalFootstep.setLocation(new Point3d(position));
originalFootstep.setOrientation(orientation);
//get the footstep
Footstep.FootstepType type = snapFootstep(originalFootstep, heightMap);
footstep.setPredictedContactPointsFromPoint2ds(originalFootstep.getPredictedContactPoints());
footstep.setFootstepType(type);
FramePose solePoseInWorld = new FramePose(ReferenceFrame.getWorldFrame(), originalFootstep.getLocation(), originalFootstep.getOrientation());
footstep.setSolePose(solePoseInWorld);
footstep.setSwingHeight(originalFootstep.getSwingHeight());
footstep.setTrajectoryType(originalFootstep.getTrajectoryType());
return type;
}

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

private Transform getRosTransform(RigidBodyTransform transform3d)
{
Transform transform = topicMessageFactory.newFromType(Transform._TYPE);
Quaternion rot = topicMessageFactory.newFromType(Quaternion._TYPE);
Vector3 trans = topicMessageFactory.newFromType(Vector3._TYPE);

Quat4d quat4d = new Quat4d();
Vector3d vector3d = new Vector3d();
transform3d.get(quat4d, vector3d);

rot.setW(quat4d.getW());
rot.setX(quat4d.getX());
rot.setY(quat4d.getY());
rot.setZ(quat4d.getZ());

transform.setRotation(rot);

trans.setX(vector3d.getX());
trans.setY(vector3d.getY());
trans.setZ(vector3d.getZ());

transform.setTranslation(trans);

return transform;
}

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

private Transform getRosTransform(RigidBodyTransform transform3d)
{
Transform transform = topicMessageFactory.newFromType(Transform._TYPE);
Quaternion rot = topicMessageFactory.newFromType(Quaternion._TYPE);
Vector3 trans = topicMessageFactory.newFromType(Vector3._TYPE);

Quat4d quat4d = new Quat4d();
Vector3d vector3d = new Vector3d();
transform3d.get(quat4d, vector3d);

rot.setW(quat4d.getW());
rot.setX(quat4d.getX());
rot.setY(quat4d.getY());
rot.setZ(quat4d.getZ());

transform.setRotation(rot);

trans.setX(vector3d.getX());
trans.setY(vector3d.getY());
trans.setZ(vector3d.getZ());

transform.setTranslation(trans);

return transform;
}

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

public Footstep.FootstepType snapFootstep(Footstep footstep, List pointList, double defaultHeight)
{
FootstepDataMessage originalFootstep = new FootstepDataMessage(footstep);
//set to the sole pose
Vector3d position = new Vector3d();
Quat4d orientation = new Quat4d();
RigidBodyTransform solePose = new RigidBodyTransform();
footstep.getSolePose(solePose);
solePose.get(orientation, position);
originalFootstep.setLocation(new Point3d(position));
originalFootstep.setOrientation(orientation);
//get the footstep
Footstep.FootstepType type = snapFootstep(originalFootstep, pointList, defaultHeight);
footstep.setFootstepType(type);
footstep.setPredictedContactPointsFromPoint2ds(originalFootstep.getPredictedContactPoints());
FramePose solePoseInWorld = new FramePose(ReferenceFrame.getWorldFrame(), originalFootstep.getLocation(), originalFootstep.getOrientation());
footstep.setSolePose(solePoseInWorld);
footstep.setSwingHeight(originalFootstep.getSwingHeight());
footstep.setTrajectoryType(originalFootstep.getTrajectoryType());
return type;
}

推荐阅读
  • 深入解析 Android 中 EditText 的 getLayoutParams 方法及其代码应用实例 ... [详细]
  • Java中不同类型的常量池(字符串常量池、Class常量池和运行时常量池)的对比与关联分析
    在研究Java虚拟机的过程中,笔者发现存在多种类型的常量池,包括字符串常量池、Class常量池和运行时常量池。通过查阅CSDN、博客园等相关资料,对这些常量池的特性、用途及其相互关系进行了详细探讨。本文将深入分析这三种常量池的差异与联系,帮助读者更好地理解Java虚拟机的内部机制。 ... [详细]
  • 本文探讨了 Java 中 Pair 类的历史与现状。虽然 Java 标准库中没有内置的 Pair 类,但社区和第三方库提供了多种实现方式,如 Apache Commons 的 Pair 类和 JavaFX 的 javafx.util.Pair 类。这些实现为需要处理成对数据的开发者提供了便利。此外,文章还讨论了为何标准库未包含 Pair 类的原因,以及在现代 Java 开发中使用 Pair 类的最佳实践。 ... [详细]
  • 普通树(每个节点可以有任意数量的子节点)级序遍历 ... [详细]
  • 本文介绍了 Go 语言中的高性能、可扩展、轻量级 Web 框架 Echo。Echo 框架简单易用,仅需几行代码即可启动一个高性能 HTTP 服务。 ... [详细]
  • 如果应用程序经常播放密集、急促而又短暂的音效(如游戏音效)那么使用MediaPlayer显得有些不太适合了。因为MediaPlayer存在如下缺点:1)延时时间较长,且资源占用率高 ... [详细]
  • JUC(三):深入解析AQS
    本文详细介绍了Java并发工具包中的核心类AQS(AbstractQueuedSynchronizer),包括其基本概念、数据结构、源码分析及核心方法的实现。 ... [详细]
  • 【问题】在Android开发中,当为EditText添加TextWatcher并实现onTextChanged方法时,会遇到一个问题:即使只对EditText进行一次修改(例如使用删除键删除一个字符),该方法也会被频繁触发。这不仅影响性能,还可能导致逻辑错误。本文将探讨这一问题的原因,并提供有效的解决方案,包括使用Handler或计时器来限制方法的调用频率,以及通过自定义TextWatcher来优化事件处理,从而提高应用的稳定性和用户体验。 ... [详细]
  • 尽管我们尽最大努力,任何软件开发过程中都难免会出现缺陷。为了更有效地提升对支持部门的协助与支撑,本文探讨了多种策略和最佳实践,旨在通过改进沟通、增强培训和支持流程来减少这些缺陷的影响,并提高整体服务质量和客户满意度。 ... [详细]
  • AIX编程挑战赛:AIX正方形问题的算法解析与Java代码实现
    在昨晚的阅读中,我注意到了CSDN博主西部阿呆-小草屋发表的一篇文章《AIX程序设计大赛——AIX正方形问题》。该文详细阐述了AIX正方形问题的背景,并提供了一种基于Java语言的解决方案。本文将深入解析这一算法的核心思想,并展示具体的Java代码实现,旨在为参赛者和编程爱好者提供有价值的参考。 ... [详细]
  • 本文详细探讨了Zebra路由软件中的线程机制及其实际应用。通过对Zebra线程模型的深入分析,揭示了其在高效处理网络路由任务中的关键作用。文章还介绍了线程同步与通信机制,以及如何通过优化线程管理提升系统性能。此外,结合具体应用场景,展示了Zebra线程机制在复杂网络环境下的优势和灵活性。 ... [详细]
  • 2020年9月15日,Oracle正式发布了最新的JDK 15版本。本次更新带来了许多新特性,包括隐藏类、EdDSA签名算法、模式匹配、记录类、封闭类和文本块等。 ... [详细]
  • JVM钩子函数的应用场景详解
    本文详细介绍了JVM钩子函数的多种应用场景,包括正常关闭、异常关闭和强制关闭。通过具体示例和代码演示,帮助读者更好地理解和应用这一机制。适合对Java编程和JVM有一定基础的开发者阅读。 ... [详细]
  • Android 自定义 RecycleView 左滑上下分层示例代码
    为了满足项目需求,需要在多个场景中实现左滑删除功能,并且后续可能在列表项中增加其他功能。虽然网络上有很多左滑删除的示例,但大多数封装不够完善。因此,我们尝试自己封装一个更加灵活和通用的解决方案。 ... [详细]
  • 本文详细探讨了使用纯JavaScript开发经典贪吃蛇游戏的技术细节和实现方法。通过具体的代码示例,深入解析了游戏逻辑、动画效果及用户交互的实现过程,为开发者提供了宝贵的参考和实践经验。 ... [详细]
author-avatar
倩倩
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有