![](/img/trans.png)
[英]How to get PointCloud and Pose using ARCore on android?
[英]How to get Rotation Quaternion of my android device in ARcore?
我正在從事 AR 項目,並正在開發 ARCorea 應用程序。
我想使用當前幀並獲得旋轉和平移。
當前的實現和我的環境如下;
private Session session;
Frame frame = session.update();
Pose pose = frame.getAndroidSensorPose();
float[] t = new float[3];
float[] r = new float[4];
Pose rhspose = new Pose(t,r);
Pose thispose;
thispose = pose.compose(rhspose);
float translation[] = thispose.getTranslation();
float orientation[] = thispose.getRotationQuaternion();
- - 環境
Android Studio:Ver.4.0.1
ARCore SDK:Ver.1.18.1
設備:ASUS_A002
在下一頁之后,我可以收集平移向量,但不能收集旋轉向量。
旋轉矢量值始終為 0。
https://developers.google.com/ar/reference/java/com/google/ar/core/Pose
如何將 getRotationQuaternion() 用於幀?
謝謝你的幫助。
我解決了我的問題。
thispose = pose.extractTranslation();
float translation[] = thispose.getTranslation();
thispose = pose.extractRotation();
float orientation[] = thispose.getRotationQuaternion();
謝謝。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.