本文整理汇总了Java中com.google.atap.tangoservice.TangoPoseData.POSE_VALID属性的典型用法代码示例。如果您正苦于以下问题:Java TangoPoseData.POSE_VALID属性的具体用法?Java TangoPoseData.POSE_VALID怎么用?Java TangoPoseData.POSE_VALID使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.google.atap.tangoservice.TangoPoseData
的用法示例。
在下文中一共展示了TangoPoseData.POSE_VALID属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateMeasurements
/**
* Updates every saved measurement. It re-queries the device pose at the time the measurement
* was taken.
*/
public void updateMeasurements() {
for (WallMeasurement wallMeasurement : mWallMeasurementList) {
// We need to re query the depth transform when the measurements were taken.
TangoSupport.TangoMatrixTransformData transform =
TangoSupport.getMatrixTransformAtTime(wallMeasurement
.getDepthTransformTimeStamp(),
TangoPoseData.COORDINATE_FRAME_AREA_DESCRIPTION,
TangoPoseData.COORDINATE_FRAME_CAMERA_DEPTH,
TangoSupport.TANGO_SUPPORT_ENGINE_OPENGL,
TangoSupport.TANGO_SUPPORT_ENGINE_TANGO);
if (transform.statusCode == TangoPoseData.POSE_VALID) {
wallMeasurement.update(transform.matrix);
mRenderer.addWallMeasurement(wallMeasurement);
} else {
Log.d(TAG, "Could not get a valid transform from depth to area description at time "
+ wallMeasurement
.getDepthTransformTimeStamp());
}
}
}
示例2: getStatusString
/**
* Get the status of the Pose as a string.
*
* @param pose Pose from which status string is constructed.
* @return
*/
public static String getStatusString(TangoPoseData pose) {
String poseStatus;
switch (pose.statusCode) {
case TangoPoseData.POSE_UNKNOWN:
poseStatus = "unknown";
break;
case TangoPoseData.POSE_INVALID:
poseStatus = "invalid";
break;
case TangoPoseData.POSE_INITIALIZING:
poseStatus = "initializing";
break;
case TangoPoseData.POSE_VALID:
poseStatus = "valid";
break;
default:
poseStatus = "unknown";
}
return poseStatus;
}
示例3: getStatusString
/**
* Get the status of the Pose as a string.
* @param pose: Pose from which status string is constructed.
* @return
*/
public static String getStatusString(TangoPoseData pose){
String poseStatus = "unknown";
switch (pose.statusCode){
case TangoPoseData.POSE_UNKNOWN:
poseStatus = "unknown";
break;
case TangoPoseData.POSE_INVALID:
poseStatus = "invalid";
break;
case TangoPoseData.POSE_INITIALIZING:
poseStatus = "initializing";
break;
case TangoPoseData.POSE_VALID:
poseStatus = "valid";
break;
default:
poseStatus = "unknown";
}
return poseStatus;
}
示例4: getPoseStatus
private String getPoseStatus(TangoPoseData pose) {
switch (pose.statusCode) {
case TangoPoseData.POSE_INITIALIZING:
return getString(R.string.pose_initializing);
case TangoPoseData.POSE_INVALID:
return getString(R.string.pose_invalid);
case TangoPoseData.POSE_VALID:
return getString(R.string.pose_valid);
default:
return getString(R.string.pose_unknown);
}
}
示例5: getQuaternionString
private String getQuaternionString(TangoPoseData pose) {
final String eulerAngleString = (pose.statusCode == TangoPoseData.POSE_VALID) ? getEulerAngleString(
pose) : "";
return "[" + threeDec.format(
pose.rotation[TangoPoseData.INDEX_ROTATION_X]) + "," + threeDec.format(
pose.rotation[TangoPoseData.INDEX_ROTATION_Y])
+ "," + threeDec.format(
pose.rotation[TangoPoseData.INDEX_ROTATION_Z]) + "," + threeDec.format(
pose.rotation[TangoPoseData.INDEX_ROTATION_W])
+ "] " + eulerAngleString;
}
示例6: getPoseStatus
private String getPoseStatus(TangoPoseData pose) {
switch (pose.statusCode) {
case TangoPoseData.POSE_INITIALIZING:
return getString(R.string.pose_initializing);
case TangoPoseData.POSE_INVALID:
return getString(R.string.pose_invalid);
case TangoPoseData.POSE_VALID:
return getString(R.string.pose_valid);
default:
return getString(R.string.pose_unknown);
}
}
示例7: doWallMeasurement
/**
* Use the TangoSupport library and point cloud data to calculate the plane at the specified
* location in the color camera frame.
* It returns the pose of the fitted plane in a TangoPoseData structure.
*/
private WallMeasurement doWallMeasurement(float u, float v, double rgbTimestamp) {
TangoXyzIjData xyzIj = mPointCloudManager.getLatestXyzIj();
if (xyzIj == null) {
return null;
}
// We need to calculate the transform between the color camera at the
// time the user clicked and the depth camera at the time the depth
// cloud was acquired.
TangoPoseData colorTdepthPose = TangoSupport.calculateRelativePose(
rgbTimestamp, TangoPoseData.COORDINATE_FRAME_CAMERA_COLOR,
xyzIj.timestamp, TangoPoseData.COORDINATE_FRAME_CAMERA_DEPTH);
// Perform plane fitting with the latest available point cloud data.
try {
IntersectionPointPlaneModelPair intersectionPointPlaneModelPair =
TangoSupport.fitPlaneModelNearClick(xyzIj, mIntrinsics,
colorTdepthPose, u, v);
// Get the depth camera transform at the time the plane data was acquired.
TangoSupport.TangoMatrixTransformData transform =
TangoSupport.getMatrixTransformAtTime(xyzIj.timestamp,
TangoPoseData.COORDINATE_FRAME_AREA_DESCRIPTION,
TangoPoseData.COORDINATE_FRAME_CAMERA_DEPTH,
TangoSupport.TANGO_SUPPORT_ENGINE_OPENGL,
TangoSupport.TANGO_SUPPORT_ENGINE_TANGO);
if (transform.statusCode == TangoPoseData.POSE_VALID) {
// Update the AR object location.
float[] planeFitTransform = calculatePlaneTransform(
intersectionPointPlaneModelPair.intersectionPoint,
intersectionPointPlaneModelPair.planeModel, transform.matrix);
return new WallMeasurement(planeFitTransform, transform.matrix, xyzIj.timestamp);
} else {
Log.d(TAG, "Could not get a valid transform from depth to area description at time "
+ xyzIj.timestamp);
}
} catch (TangoException e) {
Log.d(TAG, "Failed to fit plane");
}
return null;
}