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. More... | |
typedef struct TangoSupport_MatrixTransformData | TangoSupport_MatrixTransformData |
Struct to hold transformation float matrix and its metadata. More... | |
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. More... | |
TangoErrorType | TangoSupport_createPointCloudManager (size_t max_points, TangoSupport_PointCloudManager **manager) |
Create an object for maintaining a set of point clouds for a specified size. More... | |
TangoErrorType | TangoSupport_freePointCloudManager (TangoSupport_PointCloudManager *manager) |
Delete the point cloud manager object. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
Functions for supporting easy transformation between different frames.
Struct to hold transformation double matrix and its metadata.
typedef struct TangoSupport_MatrixTransformData TangoSupport_MatrixTransformData |
Struct to hold transformation float matrix and its metadata.
Enumeration of support engines. Every engine conversion corresponds to an axis swap from the Tango-native frame
Definition at line 252 of file tango_support.h.
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.
base_timestamp | The timestamp for base frame position. Must be non-negative. If set to 0.0, the most recent pose estimate is used. |
base_frame | the coordinate frame type of target frame. Must be TANGO_COORDINATE_FRAME_CAMERA_*. |
target_timestamp | The timestamp for target frame position. Must be non-negative. If set to 0.0, the most recent pose estimate is used. |
target_frame | The coordinate frame type of base frame. Must be TANGO_COORDINATE_FRAME_CAMERA_*. |
base_frame_T_target_frame | A TangoPoseData object with the calculated orientation and translation. The output represents the transform from target frame to base frame. |
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.
max_points | Maximum number of points in TangoPointCloud. Get value from config. |
manager | A handle to the manager object. |
TANGO_SUCCESS
on successful creation, TANGO_INVALID
if max_points
<= 0. TangoErrorType TangoSupport_freePointCloudManager | ( | TangoSupport_PointCloudManager * | manager | ) |
Delete the point cloud manager object.
manager | A handle to the manager to delete. |
TANGO_SUCCESS
on free. 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.
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.
timestamp | The timestamp of the transformation matrix of interest. |
base_frame | The frame of reference the matrix converts to. |
target_frame | The frame of reference the matrix converts from. |
base_engine | Specifies the final orientation convention the matrix converts to. |
target_engine | Specifies the original orientation convention the matrix converts from. |
display_rotation | The index of the display rotation between display's default (natural) orientation and current orientation. |
matrix_transform | The final matrix output with metadata. |
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.
manager | A handle to the point cloud manager. |
point_cloud | After the call contains a pointer to the most recent depth camera buffer. |
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.
manager | A handle to the point cloud manager. |
point_cloud | After the call contains a pointer to the most recent depth camera buffer. |
new_data | True if latest_point_cloud points to new data. False otherwise. |
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.
manager | A handle to the point cloud manager. |
base_frame | The base frame of reference to use in the query. |
base_engine | The 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_engine | The 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_rotation | The index of the display rotation between display's default (natural) orientation and current orientation. |
point_cloud | After the call contains a pointer to the most recent point cloud with a pose, accounting for the specified engine and display |
pose | The pose of target with respect to base frame of reference, accounting for the specified engine and display rotation. |
latest_point_cloud | Replaced with the latest point cloud that has a pose, or nullptr on failure. This point cloud is not transformed at all. |
pose | Repalced with the pose associated with latest_point_cloud, or |
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.
timestamp | The timestamp of the transformation matrix of interest. |
base_frame | The frame of reference the matrix converts to. |
target_frame | The frame of reference the matrix converts from. |
base_engine | Specifies the final orientation convention the matrix converts to. |
target_engine | Specifies the original orientation convention the matrix converts from. |
display_rotation | The index of the display rotation between display's default (natural) orientation and current orientation. |
matrix_transform | The final matrix output with metadata. |
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.
timestamp | Time specified in seconds. This behaves the same as the timestamp parameter in TangoService_getPoseAtTime . |
base_frame | The base frame of reference to use in the query. |
target_frame | The target frame of reference to use in the query. |
base_engine | The 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_engine | The 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_rotation | The index of the display rotation between display's default (natural) orientation and current orientation. |
pose | The pose of target with respect to base frame of reference, accounting for the specified engine and display rotation. |
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.
manager | A handle to the point cloud manager. |
point_cloud | New point cloud data from the camera callback thread. |
TANGO_INVALID
if manager or point_cloud are NULL. Returns TANGO_SUCCESS
if update is successful.