tango_client_api.h
Go to the documentation of this file.
1 // Copyright 2014 Google Inc. All Rights Reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 #ifndef TANGO_CLIENT_API_HEADER_TANGO_CLIENT_API_H_
15 #define TANGO_CLIENT_API_HEADER_TANGO_CLIENT_API_H_
16 
17 #include <stdbool.h>
18 #include <stddef.h>
19 #include <stdint.h>
20 
23 
27 
29 typedef enum {
36 
38 typedef enum {
46 
48 typedef enum {
70 
74 typedef enum {
95 
103 typedef enum {
109 
111 // Known TangoEvents are documented below in non-doxygen style. One of the tech
112 // writers is welcome to edit and expose later, if desired.
113 typedef enum {
116  // "TangoServiceException" : "Service faulted will restart."
117  // "EXPERIMENTAL_PleaseDisconnect" : "" (Experimental)
118  // "CloudLocalizeSuccess" : "" (Internal Debug)
119  // "CloudLocalizeFailure" : "" (Internal Debug)
120  // "TileRequested" : "<s2Token>" (Internal Debug)
121  // "TileUnavailable" : "<s2Token>" (Internal Debug)
122  // "TileLoaded" : "<s2Token>" (Internal Debug)
123  // "TileUnloaded" : "<s2Token>" (Internal Debug)
124  // "TileDownloadFailed" : "<s2Token>" (Internal Debug)
126  // "FisheyeOverExposed" : ""
127  // "FisheyeUnderExposed" : ""
129  // "ColorOverExposed" : ""
130  // "ColorUnderExposed" : ""
132  // <none>
134  // "TooFewFeaturesTracked" : ""
136  // "AreaDescriptionSaveProgress" : "<fraction complete>"
138  // "STATUS_READY" : "0" (Experimental)
139  // "STATUS_NOT_AVAILABLE" : "0" (Experimental)
140  // "STATUS_FAILURE" : "0" (Experimental)
142 
145 typedef enum {
161 
166 typedef enum {
171 
173 typedef enum {
181 
184 typedef enum {
196 
199 typedef enum {
208 
211 
217 typedef void* TangoConfig;
218 
219 #define TANGO_UUID_LEN 37
220 #define TANGO_COORDINATE_FRAME_ID_LEN 37
221 #define TANGO_LEVEL_SHORT_NAME_BYTE_MAX_LEN 16
222 #define TANGO_LEVEL_ID_BYTE_MAX_LEN 19
223 
227 typedef char TangoUUID[TANGO_UUID_LEN];
228 
229 // The unique id associated with a frame of interest.
230 // When a new frame of interest is created, the returned id can be used to
231 // reference the same frame of interest in future calls. A caller should not
232 // need to create such an id manually.
233 typedef struct TangoCoordinateFrameId {
234  // String representation of the unique id (36 characters + null terminator).
237 
238 // The following predefined UUIDs must be in the reserved space in
239 // 10000000-0000-0000-0000-0000000000[00-ff].
241  "10000000-0000-0000-0000-0000000000ff"};
243  "10000000-0000-0000-0000-000000000000"};
245  "10000000-0000-0000-0000-000000000001"};
247  "10000000-0000-0000-0000-000000000002"};
249  "10000000-0000-0000-0000-000000000003"};
251  "10000000-0000-0000-0000-000000000004"};
253  "10000000-0000-0000-0000-000000000005"};
255  "10000000-0000-0000-0000-000000000006"};
257  "10000000-0000-0000-0000-000000000007"};
259  "10000000-0000-0000-0000-000000000008"};
261  "10000000-0000-0000-0000-000000000009"};
262 
266 
269 typedef struct {
292 
298 
305 typedef struct TangoPoseData {
307  uint32_t version;
308 
310  double timestamp;
311 
321  double orientation[4];
322 
325  double translation[3];
332  uint32_t confidence;
333  float accuracy;
334 } TangoPoseData;
335 
338 typedef struct TangoTransformation {
348  double orientation[4];
349 
352  double translation[3];
354 
357 typedef struct TangoImageBuffer {
359  uint32_t width;
361  uint32_t height;
363  uint32_t stride;
365  double timestamp;
367  int64_t frame_number;
371  uint8_t* data;
375 
382 #define TANGO_MAX_IMAGE_PLANES (4)
383 typedef struct TangoImage {
385  uint32_t width;
387  uint32_t height;
391  int64_t timestamp_ns;
392 
394  uint32_t num_planes;
396  uint8_t* plane_data[TANGO_MAX_IMAGE_PLANES];
398  int32_t plane_size[TANGO_MAX_IMAGE_PLANES];
400  int32_t plane_row_stride[TANGO_MAX_IMAGE_PLANES];
402  int32_t plane_pixel_stride[TANGO_MAX_IMAGE_PLANES];
403 } TangoImage;
404 
409 typedef struct TangoCameraMetadata {
411  int64_t timestamp_ns;
413  int64_t frame_number;
417 
421 typedef struct TangoXYZij {
423  uint32_t version;
424 
426  double timestamp;
427 
432  uint32_t xyz_count;
433 
442  float (*xyz)[3];
443 
445  uint32_t ij_rows;
447  uint32_t ij_cols;
448 
458  uint32_t* ij;
459 
462 } TangoXYZij;
463 
465 typedef struct TangoPointCloud {
467  uint32_t version;
468 
470  double timestamp;
471 
475  uint32_t num_points;
476 
483  float (*points)[4];
485 
525 typedef struct TangoCameraIntrinsics {
531 
533  uint32_t width;
535  uint32_t height;
536 
538  double fx;
540  double fy;
542  double cx;
544  double cy;
545 
548  double distortion[5];
550 
573 typedef struct TangoEvent {
575  double timestamp;
579  const char* event_key;
581  const char* event_value;
582 } TangoEvent;
583 
584 #ifdef __cplusplus
585 extern "C" {
586 #endif
587 
594 
598 void TangoConfig_free(TangoConfig config);
599 
604 char* TangoConfig_toString(TangoConfig config);
605 
608 
645 TangoErrorType TangoService_initialize(void* jni_env, void* activity);
646 
662 TangoErrorType TangoService_setBinder(void* jni_env, void* iBinder);
663 
683 
710 TangoErrorType TangoService_connect(void* context, TangoConfig config);
711 
723 
729 
741 
744 
770  uint32_t count, const TangoCoordinateFramePair* frames,
771  void (*TangoService_onPoseAvailable)(void* context,
772  const TangoPoseData* pose),
773  ...);
774 
805  TangoPoseData* pose);
806 
809 
827  void (*TangoService_onXYZijAvailable)(void* context,
828  const TangoXYZij* xyz_ij),
829  ...);
830 
842  void (*TangoService_onPointCloudAvailable)(void* context,
843  const TangoPointCloud* cloud),
844  ...);
845 
848 
859  void (*TangoService_onTangoEvent)(void* context, const TangoEvent* event),
860  ...);
861 
864 
872 
889  TangoCameraId id, unsigned int tex, void* context,
891 
904 
919  TangoCameraId id, void* context, TangoService_OnTextureAvailable callback);
920 
938  unsigned int tex,
939  double* timestamp);
940 
941 typedef int64_t TangoBufferId;
942 
959  double* timestamp,
960  TangoBufferId* buffer);
961 
969 void TangoService_unlockCameraBuffer(TangoCameraId id, TangoBufferId buffer);
970 
987  TangoCameraId id, unsigned int texture_id, TangoBufferId buffer);
988 
1006  TangoCameraId id, void* context,
1007  void (*onFrameAvailable)(void* context, TangoCameraId id,
1008  const TangoImageBuffer* buffer));
1009 
1027  TangoCameraId id, void* context,
1028  void (*onImageAvailable)(void* context, TangoCameraId id,
1029  const TangoImage* image,
1030  const TangoCameraMetadata* metadata));
1031 
1038 
1051  TangoCameraIntrinsics* intrinsics);
1052 
1055 
1105 
1113 
1123 
1133  const TangoUUID uuid, TangoAreaDescriptionMetadata* metadata);
1134 
1142  const TangoUUID uuid, TangoAreaDescriptionMetadata metadata);
1143 
1149  TangoAreaDescriptionMetadata metadata);
1150 
1159 TangoErrorType TangoService_importAreaDescription(const char* src_file_path,
1160  TangoUUID* uuid);
1161 
1169  const TangoUUID uuid, const char* dst_file_dir);
1170 
1224  TangoAreaDescriptionMetadata metadata, const char* key, size_t* value_size,
1225  char** value);
1226 
1239  TangoAreaDescriptionMetadata metadata, const char* key, size_t value_size,
1240  const char* value);
1241 
1249  TangoAreaDescriptionMetadata metadata, char** key_list);
1250 
1253 
1374 TangoErrorType TangoConfig_setBool(TangoConfig config, const char* key,
1375  bool value);
1376 
1384 TangoErrorType TangoConfig_setInt32(TangoConfig config, const char* key,
1385  int32_t value);
1386 
1394 TangoErrorType TangoConfig_setInt64(TangoConfig config, const char* key,
1395  int64_t value);
1396 
1404 TangoErrorType TangoConfig_setDouble(TangoConfig config, const char* key,
1405  double value);
1406 
1414 TangoErrorType TangoConfig_setString(TangoConfig config, const char* key,
1415  const char* value);
1416 
1424 TangoErrorType TangoConfig_getBool(TangoConfig config, const char* key,
1425  bool* value);
1426 
1434 TangoErrorType TangoConfig_getInt32(TangoConfig config, const char* key,
1435  int32_t* value);
1436 
1444 TangoErrorType TangoConfig_getInt64(TangoConfig config, const char* key,
1445  int64_t* value);
1446 
1454 TangoErrorType TangoConfig_getDouble(TangoConfig config, const char* key,
1455  double* value);
1456 
1467 TangoErrorType TangoConfig_getString(TangoConfig config, const char* key,
1468  char* value, size_t size);
1497  TangoCameraId id, unsigned int texture_y, unsigned int texture_Cb,
1498  unsigned int texture_Cr, void* context,
1499  void (*callback)(void*, TangoCameraId));
1500 
1517  TangoUUID** dataset_uuids, int* num_dataset_uuids);
1518 
1526  TangoUUID** dataset_uuids);
1527 
1536  const TangoUUID dataset_uuid);
1537 
1544  TangoUUID* dataset_uuid);
1545 
1546 #ifdef __cplusplus
1547 }
1548 #endif
1549 
1550 #endif // TANGO_CLIENT_API_HEADER_TANGO_CLIENT_API_H_
Event related to cloud ADFs.
const TangoCoordinateFrameId TANGO_COORDINATE_FRAME_ID_GLOBAL_WGS84
TangoCoordinateFrameType
Tango coordinate frame enumerations.
The input argument is invalid.
TangoImageBuffer * color_image
TangoImageBuffer is reserved for future use.
double timestamp
The timestamp of the pose estimate, in seconds.
Could not estimate pose at this time.
struct TangoCoordinateFrameId TangoCoordinateFrameId
uint32_t ij_rows
The dimensions of the ij index buffer.
const TangoCoordinateFrameId TANGO_COORDINATE_FRAME_ID_CAMERA_COLOR
TangoErrorType TangoService_setRuntimeConfig(TangoConfig tconfig)
TangoErrorType TangoService_Experimental_deleteDataset(const TangoUUID dataset_uuid)
TangoErrorType TangoService_initialize(void *jni_env, void *activity)
TangoErrorType TangoService_exportAreaDescription(const TangoUUID uuid, const char *dst_file_dir)
TangoErrorType TangoService_connectOnXYZijAvailable(void(*TangoService_onXYZijAvailable)(void *context, const TangoXYZij *xyz_ij),...)
uint32_t width
The width of the image in pixels.
Contains data required for motion tracking and scene reconstruction.
const TangoCoordinateFrameId TANGO_COORDINATE_FRAME_ID_IMU
Contains only data required for motion tracking.
char TangoUUID[TANGO_UUID_LEN]
int64_t exposure_duration_ns
Camera exposure time in nanoseconds.
TangoErrorType TangoService_connectOnFrameAvailable(TangoCameraId id, void *context, void(*onFrameAvailable)(void *context, TangoCameraId id, const TangoImageBuffer *buffer))
int64_t frame_number
The frame number of this image.
The user has not given permissions to read and write datasets.
void TangoConfig_free(TangoConfig config)
int64_t frame_number
Camera frame number.
double timestamp
The timestamp of this image.
double cx
Principal point x coordinate on the image, in pixels.
TangoErrorType TangoService_connectOnTextureAvailable(TangoCameraId id, void *context, TangoService_OnTextureAvailable callback)
#define TANGO_COORDINATE_FRAME_ID_LEN
uint32_t version
< Unused. An integer denoting the version of the structure.
TangoErrorType TangoConfig_getString(TangoConfig config, const char *key, char *value, size_t size)
TangoErrorType TangoService_Experimental_connectTextureIdUnity(TangoCameraId id, unsigned int texture_y, unsigned int texture_Cb, unsigned int texture_Cr, void *context, void(*callback)(void *, TangoCameraId))
uint32_t xyz_count
TangoErrorType TangoConfig_getDouble(TangoConfig config, const char *key, double *value)
uint32_t height
The height of the image data.
TangoPoseStatusType
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).
TangoCameraId camera_id
ID of the camera which the intrinsics reference.
const TangoCoordinateFrameId TANGO_COORDINATE_FRAME_ID_DISPLAY
TangoErrorType TangoAreaDescriptionMetadata_get(TangoAreaDescriptionMetadata metadata, const char *key, size_t *value_size, char **value)
TangoErrorType TangoService_connectOnPointCloudAvailable(void(*TangoService_onPointCloudAvailable)(void *context, const TangoPointCloud *cloud),...)
TangoErrorType
Tango Error types. Errors less than 0 should be dealt with by the program. Success is denoted by TANG...
Stop recording. Has no effect if recording is not currently started.
TangoErrorType TangoService_Experimental_releaseDatasetUUIDs(TangoUUID **dataset_uuids)
TangoErrorType TangoAreaDescriptionMetadata_listKeys(TangoAreaDescriptionMetadata metadata, char **key_list)
uint32_t version
An integer denoting the version of the structure.
Back-facing color camera.
TangoErrorType TangoService_updateTexture(TangoCameraId id, double *timestamp)
char * TangoConfig_toString(TangoConfig config)
TangoDepthMode
Tango depth data formats.
double fx
Focal length, x axis, in pixels.
TangoErrorType TangoService_connectOnPoseAvailable(uint32_t count, const TangoCoordinateFramePair *frames, void(*TangoService_onPoseAvailable)(void *context, const TangoPoseData *pose),...)
The TangoEvent structure signals important sensor and tracking events. Each event comes with a timest...
uint32_t version
An integer denoting the version of the structure.
struct TangoImageBuffer TangoImageBuffer
Immediately previous device pose.
Start recording. Has no effect if recording has already been started.
struct TangoEvent TangoEvent
The TangoEvent structure signals important sensor and tracking events. Each event comes with a timest...
This error code denotes some sort of hard error occurred.
void TangoService_disconnect()
TangoCoordinateFrameType base
double timestamp
Timestamp, in seconds, of the event.
Maximum number allowable.
Maximum camera allowable.
Area Learning Event.
TangoErrorType TangoService_disconnectCamera(TangoCameraId id)
Unknown dataset recording mode.
Origin when the device started tracking.
uint32_t width
The width of the image data.
TangoCalibrationType
The calling app is missing Android permissions for ACCESS_FINE_LOCATION.
TangoErrorType TangoConfig_getInt64(TangoConfig config, const char *key, int64_t *value)
const TangoCoordinateFrameId TANGO_COORDINATE_FRAME_ID_CAMERA_DEPTH
#define TANGO_UUID_LEN
struct TangoPointCloud TangoPointCloud
TangoPointCloud contains information returned from the depth sensor.
Contains data required for motion tracking, as well as fisheye images.
TangoErrorType TangoService_Experimental_getDatasetUUIDs(TangoUUID **dataset_uuids, int *num_dataset_uuids)
TangoErrorType TangoConfig_setInt64(TangoConfig config, const char *key, int64_t value)
double fy
Focal length, y axis, in pixels.
Contains motion data, depth, and fisheye and RGB images.
The pose of this estimate is not valid.
TangoErrorType TangoService_updateTextureExternalOesForBuffer(TangoCameraId id, unsigned int texture_id, TangoBufferId buffer)
TangoErrorType TangoService_getAreaDescriptionUUIDList(char **uuid_list)
TangoCoordinateFramePair frame
TangoRuntimeRecordingControl_Experimental
TangoCameraId
Tango Camera enumerations.
const char * event_key
Description of the event key.
TangoErrorType TangoConfig_setString(TangoConfig config, const char *key, const char *value)
int64_t TangoBufferId
struct TangoPoseData TangoPoseData
const TangoCoordinateFrameId TANGO_COORDINATE_FRAME_ID_CAMERA_FISHEYE
Runtime settable configuration.
TangoErrorType TangoAreaDescriptionMetadata_free(TangoAreaDescriptionMetadata metadata)
void(* TangoService_OnTextureAvailable)(void *, TangoCameraId)
Callback for when a new camera texture is available.
int64_t timestamp_ns
The timestamp of this image.
TangoErrorType TangoService_getAreaDescriptionMetadata(const TangoUUID uuid, TangoAreaDescriptionMetadata *metadata)
TangoPointCloud contains information returned from the depth sensor.
TangoErrorType TangoService_updateTextureExternalOes(TangoCameraId id, unsigned int tex, double *timestamp)
TangoErrorType TangoService_lockCameraBuffer(TangoCameraId id, double *timestamp, TangoBufferId *buffer)
TangoErrorType TangoConfig_setBool(TangoConfig config, const char *key, bool value)
uint32_t stride
The number of bytes per scanline of image data.
The user has not given permission to access the device&#39;s camera.
TangoErrorType TangoService_connectOnTangoEvent(void(*TangoService_onTangoEvent)(void *context, const TangoEvent *event),...)
void TangoService_unlockCameraBuffer(TangoCameraId id, TangoBufferId buffer)
void * TangoAreaDescriptionMetadata
Motion estimation is being initialized.
The pose of this estimate is valid.
uint32_t width
The width of the image data.
TangoErrorType TangoService_deleteAreaDescription(const TangoUUID uuid)
Origin within a saved area description.
Inertial Measurement Unit.
TangoErrorType TangoService_getPoseAtTime(double timestamp, TangoCoordinateFramePair frame, TangoPoseData *pose)
TangoImageFormatType format
Pixel format of data.
TangoErrorType TangoService_connectTextureId(TangoCameraId id, unsigned int tex, void *context, TangoService_OnTextureAvailable callback)
double cy
Principal point y coordinate on the image, in pixels.
TangoErrorType TangoConfig_setDouble(TangoConfig config, const char *key, double value)
Default, motion tracking only.
TangoErrorType TangoConfig_getInt32(TangoConfig config, const char *key, int32_t *value)
See TangoPointCloud.
uint32_t ij_cols
The dimensions of the ij index buffer.
TangoConfigType
Tango runtime configuration enumerations.
uint8_t * data
Pixels in the format of this image buffer.
Feature Tracking Event.
TangoCoordinateFrameType target
TangoErrorType TangoService_connectOnImageAvailable(TangoCameraId id, void *context, void(*onImageAvailable)(void *context, TangoCameraId id, const TangoImage *image, const TangoCameraMetadata *metadata))
void TangoService_resetMotionTracking()
TangoErrorType TangoService_importAreaDescription(const char *src_file_path, TangoUUID *uuid)
struct TangoCameraMetadata TangoCameraMetadata
int64_t timestamp_ns
Camera timestamp in nanoseconds.
Device coordinate frame.
This code indicates success.
Color Camera Event.
const TangoCoordinateFrameId TANGO_COORDINATE_FRAME_ID_AREA_DESCRIPTION
TangoErrorType TangoService_getCameraIntrinsics(TangoCameraId camera_id, TangoCameraIntrinsics *intrinsics)
TangoPoseStatusType status_code
The status of the pose, according to the pose lifecycle.
TangoConfig TangoService_getConfig(TangoConfigType config_type)
struct TangoTransformation TangoTransformation
uint32_t height
The height of the image data.
const TangoCoordinateFrameId TANGO_COORDINATE_FRAME_ID_DEVICE
Back-facing fisheye wide-angle camera.
The TangoCoordinateFramePair struct contains a pair of coordinate frames of reference.
float accuracy
Unused. Reserved for metric accuracy.
uint32_t * ij
TangoRecordingMode_Experimental
TangoErrorType TangoAreaDescriptionMetadata_set(TangoAreaDescriptionMetadata metadata, const char *key, size_t value_size, const char *value)
Back-facing camera producing IR-sensitive images.
TangoEventType type
Type of event.
#define TANGO_MAX_IMAGE_PLANES
TangoErrorType TangoService_saveAreaDescription(TangoUUID *uuid)
int64_t exposure_duration_ns
Exposure duration of this image in nanoseconds.
TangoErrorType TangoService_connect(void *context, TangoConfig config)
double timestamp
Time of capture of the depth data for this struct (in seconds).
TangoImageFormatType format
Pixel format of data.
double timestamp
Time of capture of the depth data for this struct (in seconds).
TangoErrorType TangoService_Experimental_getCurrentDatasetUUID(TangoUUID *dataset_uuid)
Unclassified Event Type.
char data[TANGO_COORDINATE_FRAME_ID_LEN]
TangoEventType
Tango Event types.
TangoImageFormatType
Fisheye Camera Event.
The user has not given permission to export or import ADF files.
TangoErrorType TangoConfig_getBool(TangoConfig config, const char *key, bool *value)
TangoErrorType TangoService_saveAreaDescriptionMetadata(const TangoUUID uuid, TangoAreaDescriptionMetadata metadata)
const TangoCoordinateFrameId TANGO_COORDINATE_FRAME_ID_NONE
Depth camera.
struct TangoXYZij TangoXYZij
const TangoCoordinateFrameId TANGO_COORDINATE_FRAME_ID_START_OF_SERVICE
TangoCalibrationType calibration_type
const TangoCoordinateFrameId TANGO_COORDINATE_FRAME_ID_PREVIOUS_DEVICE_POSE
void * TangoConfig
uint32_t num_planes
Number of planes for the image format of this buffer.
uint32_t height
The height of the image in pixels.
struct TangoImage TangoImage
General uncategorized callbacks.
struct TangoCameraIntrinsics TangoCameraIntrinsics
TangoErrorType TangoService_setBinder(void *jni_env, void *iBinder)
TangoErrorType TangoConfig_setInt32(TangoConfig config, const char *key, int32_t value)
The user has not given permission to save or change ADF files.
uint32_t confidence
Unused. Integer levels are determined by service.
const char * event_value
Description of the event value.


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