Classes | Typedefs | Enumerations | Functions
Transformation Support

Functions for supporting easy transformation between different frames. More...

Classes

struct  TangoSupport_DoubleMatrixTransformData
 Struct to hold transformation double matrix and its metadata. More...
struct  TangoSupport_MatrixTransformData
 Struct to hold transformation float matrix and its metadata. More...

Typedefs

typedef struct
TangoSupport_DoubleMatrixTransformData 
TangoSupport_DoubleMatrixTransformData
 Struct to hold transformation double matrix and its metadata.
typedef struct
TangoSupport_MatrixTransformData 
TangoSupport_MatrixTransformData
 Struct to hold transformation float matrix and its metadata.

Enumerations

enum  TangoSupport_EngineType { TANGO_SUPPORT_ENGINE_TANGO, TANGO_SUPPORT_ENGINE_OPENGL, TANGO_SUPPORT_ENGINE_UNITY, TANGO_SUPPORT_ENGINE_UNREAL }

Functions

TangoErrorType TangoSupport_calculateRelativePose (double base_timestamp, TangoCoordinateFrameType base_frame, double target_timestamp, TangoCoordinateFrameType target_frame, TangoPoseData *base_frame_T_target_frame)
 Calculates the relative pose of the target frame at time target_timestamp with respect to the base frame at time base_timestamp.
TangoErrorType TangoSupport_createPointCloudManager (size_t max_points, TangoSupport_PointCloudManager **manager)
 Create an object for maintaining a set of point clouds for a specified size.
TangoErrorType TangoSupport_freePointCloudManager (TangoSupport_PointCloudManager *manager)
 Delete the point cloud manager object.
TangoErrorType TangoSupport_getDoubleMatrixTransformAtTime (double timestamp, TangoCoordinateFrameType base_frame, TangoCoordinateFrameType target_frame, TangoSupport_EngineType base_engine, TangoSupport_EngineType target_engine, TangoSupport_Rotation display_rotation, TangoSupport_DoubleMatrixTransformData *matrix_transform)
 Calculate the tranformation matrix between specified frames and engine types. The output matrix uses doubles and is in column-major order.
TangoErrorType TangoSupport_getLatestPointCloud (TangoSupport_PointCloudManager *manager, TangoPointCloud **latest_point_cloud)
 Check if updated point cloud data is available. If so, swap new data to the front buffer and set latest_point_cloud to point to the front buffer. Multiple calls to this function must be made from the same thread.
TangoErrorType TangoSupport_getLatestPointCloudAndNewDataFlag (TangoSupport_PointCloudManager *manager, TangoPointCloud **latest_point_cloud, bool *new_data)
 Check if updated point cloud data is available. If so, swap new data to the front buffer and set latest_point_cloud to point to the front buffer. Multiple calls to this function must be made from the same thread. Set new_data to true if latest_point_cloud points to new point cloud.
TangoErrorType TangoSupport_getLatestPointCloudWithPose (TangoSupport_PointCloudManager *manager, TangoCoordinateFrameType base_frame, TangoSupport_EngineType base_engine, TangoSupport_EngineType target_engine, TangoSupport_Rotation display_rotation, TangoPointCloud **latest_point_cloud, TangoPoseData *pose)
 Returns the latest point cloud that has a pose. There is no target frame parameter because only FRAME_CAMERA_DEPTH has meaningful semantics for point clouds. Assumes the same base_engine and target_engine will be passed in each time.
TangoErrorType TangoSupport_getMatrixTransformAtTime (double timestamp, TangoCoordinateFrameType base_frame, TangoCoordinateFrameType target_frame, TangoSupport_EngineType base_engine, TangoSupport_EngineType target_engine, TangoSupport_Rotation display_rotation, TangoSupport_MatrixTransformData *matrix_transform)
 Calculate the tranformation matrix between specified frames and engine types. The output matrix uses floats and is in column-major order.
TangoErrorType TangoSupport_getPoseAtTime (double timestamp, TangoCoordinateFrameType base_frame, TangoCoordinateFrameType target_frame, TangoSupport_EngineType base_engine, TangoSupport_EngineType target_engine, TangoSupport_Rotation display_rotation, TangoPoseData *pose)
 Get a pose at a given timestamp from the base to the target frame using the specified target and base engine's coordinate system conventions. The base and target engine must either both be right-handed systems or both be left-handed systems.
TangoErrorType TangoSupport_updatePointCloud (TangoSupport_PointCloudManager *manager, const TangoPointCloud *point_cloud)
 Updates the back buffer of the manager. Can be safely called from the callback thread. Update is skipped if point cloud is empty.

Detailed Description

Functions for supporting easy transformation between different frames.


Typedef Documentation

Struct to hold transformation double matrix and its metadata.

Struct to hold transformation float matrix and its metadata.


Enumeration Type Documentation

Enumeration of support engines. Every engine conversion corresponds to an axis swap from the Tango-native frame

Enumerator:
TANGO_SUPPORT_ENGINE_TANGO 

Tango native frame, has a different convention for forward, right, and up for each reference frame. Right-handed coordinate system.

TANGO_SUPPORT_ENGINE_OPENGL 

OpenGL frame, -Z forward, X right, Y up. Right-handed coordinate system.

TANGO_SUPPORT_ENGINE_UNITY 

Unity frame, +Z forward, X, right, Y up. Left-handed coordinate system.

TANGO_SUPPORT_ENGINE_UNREAL 

UnrealEngine frame, X forward, Y right, Z up. Left-handed coordinate system.

Definition at line 252 of file tango_support.h.


Function Documentation

TangoErrorType TangoSupport_calculateRelativePose ( double  base_timestamp,
TangoCoordinateFrameType  base_frame,
double  target_timestamp,
TangoCoordinateFrameType  target_frame,
TangoPoseData base_frame_T_target_frame 
)

Calculates the relative pose of the target frame at time target_timestamp with respect to the base frame at time base_timestamp.

Parameters:
base_timestampThe timestamp for base frame position. Must be non-negative. If set to 0.0, the most recent pose estimate is used.
base_framethe coordinate frame type of target frame. Must be TANGO_COORDINATE_FRAME_CAMERA_*.
target_timestampThe timestamp for target frame position. Must be non-negative. If set to 0.0, the most recent pose estimate is used.
target_frameThe coordinate frame type of base frame. Must be TANGO_COORDINATE_FRAME_CAMERA_*.
base_frame_T_target_frameA TangoPoseData object with the calculated orientation and translation. The output represents the transform from target frame to base frame.
Returns:
A TangoErrorType value of TANGO_SUCCESS on successful calculation, TANGO_INVALID if inputs are not supported, or TANGO_ERROR if an internal transform cannot be calculated.
TangoErrorType TangoSupport_createPointCloudManager ( size_t  max_points,
TangoSupport_PointCloudManager **  manager 
)

Create an object for maintaining a set of point clouds for a specified size.

Parameters:
max_pointsMaximum number of points in TangoPointCloud. Get value from config.
managerA handle to the manager object.
Returns:
TANGO_SUCCESS on successful creation, TANGO_INVALID if max_points <= 0.
TangoErrorType TangoSupport_freePointCloudManager ( TangoSupport_PointCloudManager *  manager)

Delete the point cloud manager object.

Parameters:
managerA handle to the manager to delete.
Returns:
A TangoErrorType value of TANGO_SUCCESS on free.

Calculate the tranformation matrix between specified frames and engine types. The output matrix uses doubles and is in column-major order.

When using engine OpenGL, Unity or Unreal, this function applies the corresponding rotation to base and target frames based on the display rotation. When using engine Tango no rotation is applied to that frame.

Parameters:
timestampThe timestamp of the transformation matrix of interest.
base_frameThe frame of reference the matrix converts to.
target_frameThe frame of reference the matrix converts from.
base_engineSpecifies the final orientation convention the matrix converts to.
target_engineSpecifies the original orientation convention the matrix converts from.
display_rotationThe index of the display rotation between display's default (natural) orientation and current orientation.
matrix_transformThe final matrix output with metadata.
Returns:
TANGO_INVALID on invalid input. TANGO_ERROR if the pose calculation returns error. TANGO_SUCCESS otherwise.
TangoErrorType TangoSupport_getLatestPointCloud ( TangoSupport_PointCloudManager *  manager,
TangoPointCloud **  latest_point_cloud 
)

Check if updated point cloud data is available. If so, swap new data to the front buffer and set latest_point_cloud to point to the front buffer. Multiple calls to this function must be made from the same thread.

Parameters:
managerA handle to the point cloud manager.
point_cloudAfter the call contains a pointer to the most recent depth camera buffer.
Returns:
TANGO_SUCCESS on successful assignment, TANGO_INVALID if manager is NULL.
TangoErrorType TangoSupport_getLatestPointCloudAndNewDataFlag ( TangoSupport_PointCloudManager *  manager,
TangoPointCloud **  latest_point_cloud,
bool *  new_data 
)

Check if updated point cloud data is available. If so, swap new data to the front buffer and set latest_point_cloud to point to the front buffer. Multiple calls to this function must be made from the same thread. Set new_data to true if latest_point_cloud points to new point cloud.

Parameters:
managerA handle to the point cloud manager.
point_cloudAfter the call contains a pointer to the most recent depth camera buffer.
new_dataTrue if latest_point_cloud points to new data. False otherwise.
Returns:
TANGO_SUCCESS on successful assignment, TANGO_INVALID if manager is NULL.
TangoErrorType TangoSupport_getLatestPointCloudWithPose ( TangoSupport_PointCloudManager *  manager,
TangoCoordinateFrameType  base_frame,
TangoSupport_EngineType  base_engine,
TangoSupport_EngineType  target_engine,
TangoSupport_Rotation  display_rotation,
TangoPointCloud **  latest_point_cloud,
TangoPoseData pose 
)

Returns the latest point cloud that has a pose. There is no target frame parameter because only FRAME_CAMERA_DEPTH has meaningful semantics for point clouds. Assumes the same base_engine and target_engine will be passed in each time.

Parameters:
managerA handle to the point cloud manager.
base_frameThe base frame of reference to use in the query.
base_engineThe coordinate system convention of the base_frame. Can be OpenGL, Unity, Unreal or Tango but the handed-ness (either left-handed or right-handed) must match the handed-ness of the target_engine.
target_engineThe coordinate system convention of the target_frame. Can be OpenGL, Unity, Unreal or Tango but the handed-ness (either left-handed or right-handed) must match the handed-ness of the base_engine.
display_rotationThe index of the display rotation between display's default (natural) orientation and current orientation.
point_cloudAfter the call contains a pointer to the most recent point cloud with a pose, accounting for the specified engine and display
poseThe pose of target with respect to base frame of reference, accounting for the specified engine and display rotation.
latest_point_cloudReplaced with the latest point cloud that has a pose, or nullptr on failure. This point cloud is not transformed at all.
poseRepalced with the pose associated with latest_point_cloud, or
Returns:
TANGO_SUCCESS on success, TANGO_INVALID on invalid input, including mismatched handed-ness of the base_engine and target_engine, and TANGO_ERROR on failure.
TangoErrorType TangoSupport_getMatrixTransformAtTime ( double  timestamp,
TangoCoordinateFrameType  base_frame,
TangoCoordinateFrameType  target_frame,
TangoSupport_EngineType  base_engine,
TangoSupport_EngineType  target_engine,
TangoSupport_Rotation  display_rotation,
TangoSupport_MatrixTransformData matrix_transform 
)

Calculate the tranformation matrix between specified frames and engine types. The output matrix uses floats and is in column-major order.

When using engine OpenGL, Unity or Unreal, this function applies the corresponding rotation to base and target frames based on the display rotation. When using engine Tango no rotation is applied to that frame.

Parameters:
timestampThe timestamp of the transformation matrix of interest.
base_frameThe frame of reference the matrix converts to.
target_frameThe frame of reference the matrix converts from.
base_engineSpecifies the final orientation convention the matrix converts to.
target_engineSpecifies the original orientation convention the matrix converts from.
display_rotationThe index of the display rotation between display's default (natural) orientation and current orientation.
matrix_transformThe final matrix output with metadata.
Returns:
TANGO_INVALID on invalid input. TANGO_ERROR if the pose calculation returns error. TANGO_SUCCESS otherwise.
TangoErrorType TangoSupport_getPoseAtTime ( double  timestamp,
TangoCoordinateFrameType  base_frame,
TangoCoordinateFrameType  target_frame,
TangoSupport_EngineType  base_engine,
TangoSupport_EngineType  target_engine,
TangoSupport_Rotation  display_rotation,
TangoPoseData pose 
)

Get a pose at a given timestamp from the base to the target frame using the specified target and base engine's coordinate system conventions. The base and target engine must either both be right-handed systems or both be left-handed systems.

When using engine OpenGL, Unity or Unreal, this function applies the corresponding rotation to base and target frames based on the display rotation. When using engine Tango no rotation is applied to that frame.

Parameters:
timestampTime specified in seconds. This behaves the same as the timestamp parameter in TangoService_getPoseAtTime.
base_frameThe base frame of reference to use in the query.
target_frameThe target frame of reference to use in the query.
base_engineThe coordinate system convention of the base_frame. Can be OpenGL, Unity, Unreal or Tango but the handed-ness (either left-handed or right-handed) must match the handed-ness of the target_engine.
target_engineThe coordinate system convention of the target_frame. Can be OpenGL, Unity, Unreal or Tango but the handed-ness (either left-handed or right-handed) must match the handed-ness of the base_engine.
display_rotationThe index of the display rotation between display's default (natural) orientation and current orientation.
poseThe pose of target with respect to base frame of reference, accounting for the specified engine and display rotation.
Returns:
TANGO_SUCCESS on success, TANGO_INVALID on invalid input, including mismatched handed-ness of the base_engine and target_engine, and TANGO_ERROR on failure.

The engine types should be set to TANGO_SUPPORT_ENGINE_OPENGL when the target (color camera or device) is used to control a virtual camera for rendering purposes. Typically this is done by using the matrix derived from the result pose as the view matrix of the virtual camera. The target frame engine type should be set to TANGO_SUPPORT_ENGINE_TANGO when computing a transformation for parameters used for calling other Tango support routines.

TangoErrorType TangoSupport_updatePointCloud ( TangoSupport_PointCloudManager *  manager,
const TangoPointCloud point_cloud 
)

Updates the back buffer of the manager. Can be safely called from the callback thread. Update is skipped if point cloud is empty.

Parameters:
managerA handle to the point cloud manager.
point_cloudNew point cloud data from the camera callback thread.
Returns:
A TangoErrorType value of TANGO_INVALID if manager or point_cloud are NULL. Returns TANGO_SUCCESS if update is successful.


tango_support
Author(s):
autogenerated on Thu Jun 6 2019 19:49:51