Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
これぐらいなら頑張れそう
--- tango_client_api_opaque.h 2016-06-04 14:41:51.000000000 +0900
+++ tango_client_api_mira.h 2016-06-04 14:41:56.000000000 +0900
@@ -16,6 +16,7 @@
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
} TangoCoordinateFrameType;
@@ -50,11 +51,28 @@
typedef enum {
TANGO_RECORDING_MODE_UNKNOWN = -1,
TANGO_RECORDING_MODE_MOTION_TRACKING = 0,
- TANGO_RECORDING_MODE_SCENE_RECONSTRUTCION = 1,
+ TANGO_RECORDING_MODE_SCENE_RECONSTRUCTION = 1,
+ TANGO_RECORDING_MODE_MOTION_TRACKING_AND_FISHEYE = 2,
+ TANGO_RECORDING_MODE_ALL = 3
} TangoRecordingMode_Experimental;
typedef void *TangoConfig;
#define TANGO_UUID_LEN 37
+#define TANGO_COORDINATE_FRAME_ID_BYTE_LEN 16
+#define TANGO_LEVEL_SHORT_NAME_BYTE_MAX_LEN 16
+#define TANGO_LEVEL_ID_BYTE_MAX_LEN 19
typedef char TangoUUID[TANGO_UUID_LEN];
+typedef struct TangoCoordinateFrameId { uint8_t data[TANGO_COORDINATE_FRAME_ID_BYTE_LEN]; } TangoCoordinateFrameId;
+const TangoCoordinateFrameId TANGO_COORDINATE_FRAME_ID_NONE = {{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}};
+const TangoCoordinateFrameId TANGO_COORDINATE_FRAME_ID_GLOBAL_WGS84 = {{0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}};
+const TangoCoordinateFrameId TANGO_COORDINATE_FRAME_ID_AREA_DESCRIPTION = {{0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}};
+const TangoCoordinateFrameId TANGO_COORDINATE_FRAME_ID_START_OF_SERVICE = {{0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02}};
+const TangoCoordinateFrameId TANGO_COORDINATE_FRAME_ID_PREVIOUS_DEVICE_POSE = {{0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03}};
+const TangoCoordinateFrameId TANGO_COORDINATE_FRAME_ID_DEVICE = {{0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04}};
+const TangoCoordinateFrameId TANGO_COORDINATE_FRAME_ID_IMU = {{0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05}};
+const TangoCoordinateFrameId TANGO_COORDINATE_FRAME_ID_DISPLAY = {{0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06}};
+const TangoCoordinateFrameId TANGO_COORDINATE_FRAME_ID_CAMERA_COLOR = {{0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07}};
+const TangoCoordinateFrameId TANGO_COORDINATE_FRAME_ID_CAMERA_DEPTH = {{0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08}};
+const TangoCoordinateFrameId TANGO_COORDINATE_FRAME_ID_CAMERA_FISHEYE = {{0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09}};
typedef void *TangoAreaDescriptionMetadata;
typedef struct {
TangoCoordinateFrameType base;
@@ -70,6 +88,10 @@
uint32_t confidence;
float accuracy;
} TangoPoseData;
+typedef struct TangoTransformation {
+ double orientation[4];
+ double translation[3];
+} TangoTransformation;
typedef struct TangoImageBuffer {
uint32_t width;
uint32_t height;
@@ -106,19 +128,31 @@
const char *event_key;
const char *event_value;
} TangoEvent;
+typedef struct LevelData {
+ uint32_t version;
+ char short_name[TANGO_LEVEL_SHORT_NAME_BYTE_MAX_LEN];
+ int32_t level_number_E3;
+ char level_id[TANGO_LEVEL_ID_BYTE_MAX_LEN];
+} LevelData;
#ifdef __cplusplus
extern "C" {
#endif
void TangoConfig_free(TangoConfig config);
char *TangoConfig_toString(TangoConfig config);
TangoErrorType TangoService_initialize(JNIEnv *env, jobject activity);
+TangoErrorType TangoService_setBinder(JNIEnv *env, jobject iBinder);
TangoConfig TangoService_getConfig(TangoConfigType config_type);
TangoErrorType TangoService_connect(void *context, TangoConfig config);
TangoErrorType TangoService_setRuntimeConfig(TangoConfig tconfig);
void TangoService_disconnect();
void TangoService_resetMotionTracking();
TangoErrorType TangoService_connectOnPoseAvailable(uint32_t count, const TangoCoordinateFramePair *frames, void (*TangoService_onPoseAvailable)(void *context, const TangoPoseData *pose), ...);
+TangoErrorType TangoService_connectOnLevelDataChanged(void (*TangoService_onLevelDataChanged)(void *context, const LevelData *level_data), ...);
TangoErrorType TangoService_getPoseAtTime(double timestamp, TangoCoordinateFramePair frame, TangoPoseData *pose);
+TangoErrorType TangoService_Experimental_getPoseAtTime2(double timestamp, TangoCoordinateFrameId base_frame_id, TangoCoordinateFrameId target_frame_id, TangoPoseData *return_pose);
+TangoErrorType TangoService_Experimental_createFrameOfInterest(double timestamp, TangoCoordinateFrameId base_frame_id, TangoTransformation tango_transformation, TangoCoordinateFrameId *foi_id);
+TangoErrorType TangoService_Experimental_updateFrameOfInterest(double timestamp, TangoCoordinateFrameId base_frame_id, TangoTransformation tango_transformation, TangoCoordinateFrameId foi_id);
+TangoErrorType TangoService_Experimental_deleteFrameOfInterest(TangoCoordinateFrameId foi_id);
TangoErrorType TangoService_connectOnXYZijAvailable(void (*TangoService_onXYZijAvailable)(void *context, const TangoXYZij *xyz_ij), ...);
TangoErrorType TangoService_connectOnTangoEvent(void (*TangoService_onTangoEvent)(void *context, const TangoEvent *event), ...);
TangoErrorType TangoService_connectTextureId(TangoCameraId id, unsigned int tex, void *context, void (*callback)(void *, TangoCameraId));
@@ -190,10 +224,13 @@
TangoErrorType TangoService_Experimental_freeTrajectory(TangoPositionData_Experimental **trajectory);
TangoErrorType TangoService_Experimental_loadAreaDescription(const TangoUUID uuid);
TangoErrorType TangoService_Experimental_loadAreaDescriptionFromFile(const char *file_path);
+TangoErrorType TangoService_Experimental_unloadAreaDescriptionFromFile(const char *file_path);
+TangoErrorType TangoService_Experimental_loadNavigationGraphFromFile(const char *file_path);
TangoErrorType TangoService_Experimental_getDatasetUUIDs(TangoUUID **dataset_uuids, int *num_dataset_uuids);
TangoErrorType TangoService_Experimental_releaseDatasetUUIDs(TangoUUID **dataset_uuids);
TangoErrorType TangoService_Experimental_deleteDataset(const TangoUUID dataset_uuid);
TangoErrorType TangoService_Experimental_getCurrentDatasetUUID(TangoUUID *dataset_uuid);
+TangoErrorType TangoService_Experimental_getLastIndoorLevel(LevelData *level_data);
#ifdef __cplusplus
}
#endif
@muojp
Copy link
Author

muojp commented Jun 4, 2016

License

Of course, this diff is a derived work of Google licensed under Apache 2.0 (ref: https://github.com/muojp/ProjectTangoPlugin/blob/master/ThirdParty/Public/tango_client_api.h#L1-L13 ).

How to get this diff:

cloc --strip-comments=o ./ThirdParty/Public/tango_client_api.h
cloc --strip-comments=o ~/path/to/tango/sdk/tango_client_api.h

.. strip one-line comments and trailing whitespaces using regexp in vim ..

clang-format -i -style="{ColumnLimit: 200}" tango_client_api_mira.h
clang-format -i -style="{ColumnLimit: 200}" tango_client_api_opaque.h
diff -u tango_client_api_opaque.h tango_client_api_mira.h > tango_client_api_opaque_mira.diff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment