Classes | Macros | Typedefs | Enumerations | Functions | Variables
tango_client_api.h File Reference

File containing Project Tango C API. More...

#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
Include dependency graph for tango_client_api.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  TangoCameraIntrinsics
 
struct  TangoCameraMetadata
 
struct  TangoCoordinateFrameId
 
struct  TangoCoordinateFramePair
 The TangoCoordinateFramePair struct contains a pair of coordinate frames of reference. More...
 
struct  TangoEvent
 The TangoEvent structure signals important sensor and tracking events. Each event comes with a timestamp, a type, and a key-value pair describing the event. The type is an enumeration which generally classifies the event type. The key is a text string describing the event. The description holds parameters specific to the event. More...
 
struct  TangoImage
 
struct  TangoImageBuffer
 
struct  TangoPointCloud
 TangoPointCloud contains information returned from the depth sensor. More...
 
struct  TangoPoseData
 
struct  TangoTransformation
 
struct  TangoXYZij
 

Macros

#define TANGO_COORDINATE_FRAME_ID_LEN   37
 
#define TANGO_LEVEL_ID_BYTE_MAX_LEN   19
 
#define TANGO_LEVEL_SHORT_NAME_BYTE_MAX_LEN   16
 
#define TANGO_MAX_IMAGE_PLANES   (4)
 
#define TANGO_UUID_LEN   37
 

Typedefs

typedef void * TangoAreaDescriptionMetadata
 
typedef int64_t TangoBufferId
 
typedef struct TangoCameraIntrinsics TangoCameraIntrinsics
 
typedef struct TangoCameraMetadata TangoCameraMetadata
 
typedef void * TangoConfig
 
typedef struct TangoCoordinateFrameId TangoCoordinateFrameId
 
typedef struct TangoEvent TangoEvent
 The TangoEvent structure signals important sensor and tracking events. Each event comes with a timestamp, a type, and a key-value pair describing the event. The type is an enumeration which generally classifies the event type. The key is a text string describing the event. The description holds parameters specific to the event. More...
 
typedef struct TangoImage TangoImage
 
typedef struct TangoImageBuffer TangoImageBuffer
 
typedef struct TangoPointCloud TangoPointCloud
 TangoPointCloud contains information returned from the depth sensor. More...
 
typedef struct TangoPoseData TangoPoseData
 
typedef void(* TangoService_OnTextureAvailable) (void *, TangoCameraId)
 Callback for when a new camera texture is available. More...
 
typedef struct TangoTransformation TangoTransformation
 
typedef char TangoUUID[TANGO_UUID_LEN]
 
typedef struct TangoXYZij TangoXYZij
 

Enumerations

enum  TangoCalibrationType {
  TANGO_CALIBRATION_UNKNOWN, TANGO_CALIBRATION_EQUIDISTANT, TANGO_CALIBRATION_POLYNOMIAL_2_PARAMETERS, TANGO_CALIBRATION_POLYNOMIAL_3_PARAMETERS,
  TANGO_CALIBRATION_POLYNOMIAL_5_PARAMETERS
}
 
enum  TangoCameraId {
  TANGO_CAMERA_COLOR = 0, TANGO_CAMERA_RGBIR, TANGO_CAMERA_FISHEYE, TANGO_CAMERA_DEPTH,
  TANGO_MAX_CAMERA_ID
}
 Tango Camera enumerations. More...
 
enum  TangoConfigType {
  TANGO_CONFIG_DEFAULT = 0, TANGO_CONFIG_CURRENT, TANGO_CONFIG_MOTION_TRACKING, TANGO_CONFIG_AREA_LEARNING,
  TANGO_CONFIG_RUNTIME, TANGO_MAX_CONFIG_TYPE
}
 Tango runtime configuration enumerations. More...
 
enum  TangoCoordinateFrameType {
  TANGO_COORDINATE_FRAME_GLOBAL_WGS84 = 0, TANGO_COORDINATE_FRAME_AREA_DESCRIPTION, TANGO_COORDINATE_FRAME_START_OF_SERVICE, TANGO_COORDINATE_FRAME_PREVIOUS_DEVICE_POSE,
  TANGO_COORDINATE_FRAME_DEVICE, TANGO_COORDINATE_FRAME_IMU, TANGO_COORDINATE_FRAME_DISPLAY, TANGO_COORDINATE_FRAME_CAMERA_COLOR,
  TANGO_COORDINATE_FRAME_CAMERA_DEPTH, TANGO_COORDINATE_FRAME_CAMERA_FISHEYE, TANGO_COORDINATE_FRAME_UUID, TANGO_COORDINATE_FRAME_INVALID,
  TANGO_MAX_COORDINATE_FRAME_TYPE
}
 Tango coordinate frame enumerations. More...
 
enum  TangoDepthMode { TANGO_POINTCLOUD_XYZIJ = -1, TANGO_POINTCLOUD_XYZC = 0 }
 Tango depth data formats. More...
 
enum  TangoErrorType {
  TANGO_NO_LOCATION_PERMISSION = -8, TANGO_NO_DATASET_PERMISSION = -7, TANGO_NO_IMPORT_EXPORT_PERMISSION = -6, TANGO_NO_CAMERA_PERMISSION = -5,
  TANGO_NO_ADF_PERMISSION = -4, TANGO_NO_MOTION_TRACKING_PERMISSION = -3, TANGO_INVALID = -2, TANGO_ERROR = -1,
  TANGO_SUCCESS = 0
}
 Tango Error types. Errors less than 0 should be dealt with by the program. Success is denoted by TANGO_SUCCESS = 0. More...
 
enum  TangoEventType {
  TANGO_EVENT_UNKNOWN = 0, TANGO_EVENT_GENERAL, TANGO_EVENT_FISHEYE_CAMERA, TANGO_EVENT_COLOR_CAMERA,
  TANGO_EVENT_IMU, TANGO_EVENT_FEATURE_TRACKING, TANGO_EVENT_AREA_LEARNING, TANGO_EVENT_CLOUD_ADF
}
 Tango Event types. More...
 
enum  TangoImageFormatType { TANGO_HAL_PIXEL_FORMAT_RGBA_8888 = 1, TANGO_HAL_PIXEL_FORMAT_YV12 = 0x32315659, TANGO_HAL_PIXEL_FORMAT_YCrCb_420_SP = 0x11 }
 
enum  TangoPoseStatusType { TANGO_POSE_INITIALIZING = 0, TANGO_POSE_VALID, TANGO_POSE_INVALID, TANGO_POSE_UNKNOWN }
 Tango pose status lifecycle enumerations. Every pose has a state denoted by this enum, which provides information about the internal status of the position estimate. The application may use the status to decide what actions or rendering should be taken. A change in the status between poses and subsequent timestamps can denote lifecycle state changes. The status affects the rotation and position estimates. Other fields are considered valid (i.e. version or timestamp). More...
 
enum  TangoRecordingMode_Experimental {
  TANGO_RECORDING_MODE_UNKNOWN = -1, TANGO_RECORDING_MODE_MOTION_TRACKING = 0, TANGO_RECORDING_MODE_SCENE_RECONSTRUCTION = 1, TANGO_RECORDING_MODE_MOTION_TRACKING_AND_FISHEYE = 2,
  TANGO_RECORDING_MODE_ALL = 3
}
 
enum  TangoRuntimeRecordingControl_Experimental { TANGO_RUNTIME_RECORDING_NO_CHANGE = 0, TANGO_RUNTIME_RECORDING_START = 1, TANGO_RUNTIME_RECORDING_STOP = 2 }
 

Functions

TangoErrorType TangoAreaDescriptionMetadata_free (TangoAreaDescriptionMetadata metadata)
 
TangoErrorType TangoAreaDescriptionMetadata_get (TangoAreaDescriptionMetadata metadata, const char *key, size_t *value_size, char **value)
 
TangoErrorType TangoAreaDescriptionMetadata_listKeys (TangoAreaDescriptionMetadata metadata, char **key_list)
 
TangoErrorType TangoAreaDescriptionMetadata_set (TangoAreaDescriptionMetadata metadata, const char *key, size_t value_size, const char *value)
 
void TangoConfig_free (TangoConfig config)
 
TangoErrorType TangoConfig_getBool (TangoConfig config, const char *key, bool *value)
 
TangoErrorType TangoConfig_getDouble (TangoConfig config, const char *key, double *value)
 
TangoErrorType TangoConfig_getInt32 (TangoConfig config, const char *key, int32_t *value)
 
TangoErrorType TangoConfig_getInt64 (TangoConfig config, const char *key, int64_t *value)
 
TangoErrorType TangoConfig_getString (TangoConfig config, const char *key, char *value, size_t size)
 
TangoErrorType TangoConfig_setBool (TangoConfig config, const char *key, bool value)
 
TangoErrorType TangoConfig_setDouble (TangoConfig config, const char *key, double value)
 
TangoErrorType TangoConfig_setInt32 (TangoConfig config, const char *key, int32_t value)
 
TangoErrorType TangoConfig_setInt64 (TangoConfig config, const char *key, int64_t value)
 
TangoErrorType TangoConfig_setString (TangoConfig config, const char *key, const char *value)
 
char * TangoConfig_toString (TangoConfig config)
 
TangoErrorType TangoService_connect (void *context, TangoConfig config)
 
TangoErrorType TangoService_connectOnFrameAvailable (TangoCameraId id, void *context, void(*onFrameAvailable)(void *context, TangoCameraId id, const TangoImageBuffer *buffer))
 
TangoErrorType TangoService_connectOnImageAvailable (TangoCameraId id, void *context, void(*onImageAvailable)(void *context, TangoCameraId id, const TangoImage *image, const TangoCameraMetadata *metadata))
 
TangoErrorType TangoService_connectOnPointCloudAvailable (void(*TangoService_onPointCloudAvailable)(void *context, const TangoPointCloud *cloud),...)
 
TangoErrorType TangoService_connectOnPoseAvailable (uint32_t count, const TangoCoordinateFramePair *frames, void(*TangoService_onPoseAvailable)(void *context, const TangoPoseData *pose),...)
 
TangoErrorType TangoService_connectOnTangoEvent (void(*TangoService_onTangoEvent)(void *context, const TangoEvent *event),...)
 
TangoErrorType TangoService_connectOnTextureAvailable (TangoCameraId id, void *context, TangoService_OnTextureAvailable callback)
 
TangoErrorType TangoService_connectOnXYZijAvailable (void(*TangoService_onXYZijAvailable)(void *context, const TangoXYZij *xyz_ij),...)
 
TangoErrorType TangoService_connectTextureId (TangoCameraId id, unsigned int tex, void *context, TangoService_OnTextureAvailable callback)
 
TangoErrorType TangoService_deleteAreaDescription (const TangoUUID uuid)
 
void TangoService_disconnect ()
 
TangoErrorType TangoService_disconnectCamera (TangoCameraId id)
 
TangoErrorType TangoService_Experimental_connectTextureIdUnity (TangoCameraId id, unsigned int texture_y, unsigned int texture_Cb, unsigned int texture_Cr, void *context, void(*callback)(void *, TangoCameraId))
 
TangoErrorType TangoService_Experimental_deleteDataset (const TangoUUID dataset_uuid)
 
TangoErrorType TangoService_Experimental_getCurrentDatasetUUID (TangoUUID *dataset_uuid)
 
TangoErrorType TangoService_Experimental_getDatasetUUIDs (TangoUUID **dataset_uuids, int *num_dataset_uuids)
 
TangoErrorType TangoService_Experimental_releaseDatasetUUIDs (TangoUUID **dataset_uuids)
 
TangoErrorType TangoService_exportAreaDescription (const TangoUUID uuid, const char *dst_file_dir)
 
TangoErrorType TangoService_getAreaDescriptionMetadata (const TangoUUID uuid, TangoAreaDescriptionMetadata *metadata)
 
TangoErrorType TangoService_getAreaDescriptionUUIDList (char **uuid_list)
 
TangoErrorType TangoService_getCameraIntrinsics (TangoCameraId camera_id, TangoCameraIntrinsics *intrinsics)
 
TangoConfig TangoService_getConfig (TangoConfigType config_type)
 
TangoErrorType TangoService_getPoseAtTime (double timestamp, TangoCoordinateFramePair frame, TangoPoseData *pose)
 
TangoErrorType TangoService_importAreaDescription (const char *src_file_path, TangoUUID *uuid)
 
TangoErrorType TangoService_initialize (void *jni_env, void *activity)
 
TangoErrorType TangoService_lockCameraBuffer (TangoCameraId id, double *timestamp, TangoBufferId *buffer)
 
void TangoService_resetMotionTracking ()
 
TangoErrorType TangoService_saveAreaDescription (TangoUUID *uuid)
 
TangoErrorType TangoService_saveAreaDescriptionMetadata (const TangoUUID uuid, TangoAreaDescriptionMetadata metadata)
 
TangoErrorType TangoService_setBinder (void *jni_env, void *iBinder)
 
TangoErrorType TangoService_setRuntimeConfig (TangoConfig tconfig)
 
void TangoService_unlockCameraBuffer (TangoCameraId id, TangoBufferId buffer)
 
TangoErrorType TangoService_updateTexture (TangoCameraId id, double *timestamp)
 
TangoErrorType TangoService_updateTextureExternalOes (TangoCameraId id, unsigned int tex, double *timestamp)
 
TangoErrorType TangoService_updateTextureExternalOesForBuffer (TangoCameraId id, unsigned int texture_id, TangoBufferId buffer)
 

Variables

const TangoCoordinateFrameId TANGO_COORDINATE_FRAME_ID_AREA_DESCRIPTION
 
const TangoCoordinateFrameId TANGO_COORDINATE_FRAME_ID_CAMERA_COLOR
 
const TangoCoordinateFrameId TANGO_COORDINATE_FRAME_ID_CAMERA_DEPTH
 
const TangoCoordinateFrameId TANGO_COORDINATE_FRAME_ID_CAMERA_FISHEYE
 
const TangoCoordinateFrameId TANGO_COORDINATE_FRAME_ID_DEVICE
 
const TangoCoordinateFrameId TANGO_COORDINATE_FRAME_ID_DISPLAY
 
const TangoCoordinateFrameId TANGO_COORDINATE_FRAME_ID_GLOBAL_WGS84
 
const TangoCoordinateFrameId TANGO_COORDINATE_FRAME_ID_IMU
 
const TangoCoordinateFrameId TANGO_COORDINATE_FRAME_ID_NONE
 
const TangoCoordinateFrameId TANGO_COORDINATE_FRAME_ID_PREVIOUS_DEVICE_POSE
 
const TangoCoordinateFrameId TANGO_COORDINATE_FRAME_ID_START_OF_SERVICE
 

Detailed Description

File containing Project Tango C API.

Definition in file tango_client_api.h.

Macro Definition Documentation

#define TANGO_MAX_IMAGE_PLANES   (4)

The TangoImage contains information about a byte buffer holding image data. This version supplies a pointer to the start of each image plane, as there may be padding between the planes. It is meant to closely replicate the data available from the Android Image class, and as such camera specific metadata has been moved into a separate struct, TangoCameraMetadata.

Definition at line 382 of file tango_client_api.h.

Typedef Documentation

The TangoCameraIntrinsics struct contains intrinsic parameters for a camera.

Given a 3D point (X, Y, Z) in camera coordinates, the corresponding pixel coordinates (x, y) are:

1 x = X / Z * fx * rd / ru + cx
2 y = Y / Z * fy * rd / ru + cy

The normalized radial distance ru is given by:

1 ru = sqrt((X^2 + Y^2) / (Z^2))

The distorted radial distance rd depends on the distortion model used.

TANGO_CALIBRATION_POLYNOMIAL_3_PARAMETERS implements Brown's camera model, where rd is a polynomial that depends on the three distortion coefficients k1, k2 and k3:

1 rd = ru + k1 * ru^3 + k2 * ru^5 + k3 * ru^7

TANGO_CALIBRATION_EQUIDISTANT implements the FOV camera model, where rd depends on the single distortion coefficient w:

1 rd = 1 / w * arctan(2 * ru * tan(w / 2))

For more information, see our page on Camera Intrinsics and Extrinsics.

TangoCameraMetadata. This struct contains information specific to the camera capture. It is meant to replicate some of the information provided by the Android CameraMetadata class.

typedef struct TangoEvent TangoEvent

The TangoEvent structure signals important sensor and tracking events. Each event comes with a timestamp, a type, and a key-value pair describing the event. The type is an enumeration which generally classifies the event type. The key is a text string describing the event. The description holds parameters specific to the event.

Possible descriptions (as "key:value") are:

  • "TangoServiceException:X" - The service has encountered an exception, and a text description is given in X.
  • "FisheyeOverExposed:X" - The fisheye image is over exposed with average pixel value X px.
  • "FisheyeUnderExposed:X" - The fisheye image is under exposed with average pixel value X px.
  • "ColorOverExposed:X" - The color image is over exposed with average pixel value X px.
  • "ColorUnderExposed:X" - The color image is under exposed with average pixel value X px.
  • "TooFewFeaturesTracked:X" - Too few features were tracked in the fisheye image. The number of features tracked is X.
  • "AreaDescriptionSaveProgress:X" - ADF saving is X * 100 percent complete.
  • "Unknown"
typedef struct TangoImage TangoImage

The TangoImageBuffer contains information about a byte buffer holding image data. This data is populated by the service when it returns an image.

TangoPointCloud contains information returned from the depth sensor.

typedef struct TangoPoseData TangoPoseData

The TangoPoseData struct contains pose information returned from motion tracking. The device pose is given using Android conventions. See the Android Sensor Overview page for more information.

The TangoTransformation struct contains an orientation and translation that can be applied to transform a point.

typedef struct TangoXYZij TangoXYZij
Deprecated:
Use TangoPointCloud instead.

The TangoXYZij struct contains information returned from the depth sensor.

Function Documentation

TangoErrorType TangoService_Experimental_connectTextureIdUnity ( TangoCameraId  id,
unsigned int  texture_y,
unsigned int  texture_Cb,
unsigned int  texture_Cr,
void *  context,
void(*)(void *, TangoCameraId callback 
)

Experimental API only, subject to change. Connect a Texture IDs to a camera. The camera is selected via TangoCameraId. Currently only TANGO_CAMERA_COLOR is supported. The texture handles will be regenerated by the API on startup after which the application can use them, and will be packed RGBA8888 data containing bytes of the image (so a single RGBA8888 will pack 4 neighbouring pixels). If the config flag experimental_image_pixel_format is set to HAL_PIXEL_FORMAT_YCrCb_420_SP, texture_y will pack 1280x720 pixels into a 320x720 RGBA8888 texture. texture_Cb and texture_Cr will contain copies of the 2x2 downsampled interleaved UV planes packed similarly. If experimental_image_pixel_format is set to HAL_PIXEL_FORMAT_YV12 then texture_y will have a stride of 1536 containing 1280 columns of data, packed similarly in a RGBA8888 texture. texture_Cb and texture_Cr will be 2x2 downsampled versions of the same. See YV12 and NV21 formats for details.

Parameters
idThe ID of the camera to connect this texture to. Only TANGO_CAMERA_COLOR and TANGO_CAMERA_FISHEYE are supported.
contextThe context returned during the onFrameAvailable callback.
texture_yThe texture ID to use for the Y-plane.
texture_CbThe texture ID to use for a chroma plane.
texture_CrThe texture ID to use for a chroma plane.
Returns
TANGO_INVALID if the camera ID is not valid, or TANGO_ERROR if an internal error occurred.
TangoErrorType TangoService_Experimental_deleteDataset ( const TangoUUID  dataset_uuid)

Experimental API only, subject to change. Deletes a dataset.

Parameters
dataset_uuidThe ID of the dataset to be deleted.
Returns
TANGO_SUCCESS if the dataset was successfully deleted, TANGO_ERROR if communication failed or the datasets could not be found, or TANGO_NO_DATASET_PERMISSION if user has not given permissions to read and write datasets.
TangoErrorType TangoService_Experimental_getCurrentDatasetUUID ( TangoUUID dataset_uuid)

Experimental API only, subject to change. Gets the current dataset UUID.

Parameters
dataset_uuidThe current dataset UUID.
Returns
TANGO_SUCCESS if the id was successfully retrieved, or TANGO_ERROR if communication failed.
TangoErrorType TangoService_Experimental_getDatasetUUIDs ( TangoUUID **  dataset_uuids,
int *  num_dataset_uuids 
)

Experimental API only, subject to change. Returns a list of Tango dataset UUIDs, containing a UUID for each valid dataset recorded to the Tango Service application directory. Memory will be dynamically allocated by this call, and must be deallocated using TangoService_Experimental_ReleaseDatasetUUIDs. The service does not need to be connected in order to call this function.

Parameters
dataset_uuidsa dynamic array of TangoUUIDs. Will be dynamically allocated by this call.
num_dataset_uuidsAn output parameter for the number of dataset UUIDs returned.
Returns
TANGO_SUCCESS if the dataset UUIDs were successfully retrieved, TANGO_ERROR if communication failed or the datasets could not be enumerated, TANGO_NO_DATASET_PERMISSION if user has not given permissions to read and write datasets, or TANGO_INVALID if any of the arguments passed were NULL.
TangoErrorType TangoService_Experimental_releaseDatasetUUIDs ( TangoUUID **  dataset_uuids)

Experimental API only, subject to change Frees up memory allocated by TangoService_Experimental_GetDatasetUUIDs

Parameters
dataset_uuidsa dynamic array of TangoUUIDs. Will be deallocated by this call.
Returns
TANGO_INVALID if any of the arguments passed were NULL; TANGO_SUCCESS otherwise.


tango_client_api
Author(s):
autogenerated on Mon Jun 10 2019 15:37:44