123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- using System;
- using System.Text;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.Events;
- namespace Seengene.XDKUnityPluginCloud {
- #region enum
- public enum MapQueryStatus {
- MAP_SUCCESS = 0,
- MAP_FAIL = 1
- }
- public enum SmoothMoveType {
- Linear = 0,
- EaseInOut = 1
- }
- public enum RelocalizeQueryStatus {
-
-
- SUCCESS = 0,
-
- FRAME_SUCCESS_BA_FAIL = 1,
-
-
- MAP_FAIL = 2,
-
- RELOCALIZE_FAIL = 3,
-
- BA_SESSION_EXPIRED = 4
- }
- public enum DebugInfoType {
- Normal = 0,
- UpdateFrameNative = 1,
- GetSpatialMappingNative = 2
- }
- #endregion of enum
- #region Custom Data Structure
-
-
-
- public class RequestMapKeys {
-
- public const byte RequestType_MapId = 0;
-
- public const byte ResponseType_SessionId = 0;
- public const byte ResponseType_Status = 1;
- public const byte ResponseType_Scale = 2;
- }
-
-
-
- public class RelocalizeKeys {
-
- public const byte RequestType_SessionId = 0;
- public const byte RequestType_Seq = 1;
- public const byte RequestType_Pose = 2;
- public const byte RequestType_Intrinsics = 3;
- public const byte RequestType_Image = 4;
- public const byte RequestType_MapID = 5;
- public const byte RequestType_CameraModel = 6;
- public const byte RequestType_DitortionPara = 7;
-
- public const byte ResponseType_Status = 0;
- public const byte ResponseType_Seq = 1;
- public const byte ResponseType_Point2dVec = 2;
- public const byte ResponseType_Point3dVec = 3;
- public const byte ResponseType_TransformLtg = 4;
- public const byte ResponseType_ExtraMsg = 5;
- }
- public class AuthorizationResponse {
- public string sessionID;
- public Int32 status;
- public double scale;
- public AuthorizationResponse() { }
- public AuthorizationResponse(Int32 status, double scale, string sessionID) {
- this.status = status;
- this.scale = scale;
- this.sessionID = sessionID;
- }
- public override string ToString() {
- return string.Format("AuthorizationResponse status:{0}, scale:{1}, sessionID:{2}", status, scale, sessionID);
- }
- }
- public class RelocationResponse {
- public Int32 status;
- public Int32 seq;
- public List<Vector2> point2d_vec = new List<Vector2>();
- public List<Vector3> point3d_vec = new List<Vector3>();
- public List<double> transform_ltg = new List<double>();
- public string extra_msg;
- public Matrix4x4 cameraPos;
- public CameraCalibration cameraCalibration;
- public string sessionID;
- public RelocationResponse() { }
- public RelocationResponse(Int32 status, Int32 seq, List<Vector2> point2d_vec, List<Vector3> point3d_vec, List<double> transform_ltg, string extra_msg, Matrix4x4 cameraPos, CameraCalibration cameraCalibration, string sessionID) {
- this.status = status;
- this.seq = seq;
- this.point2d_vec = point2d_vec;
- this.point3d_vec = point3d_vec;
- this.transform_ltg = transform_ltg;
- this.extra_msg = extra_msg;
- this.cameraPos = cameraPos;
- this.cameraCalibration = cameraCalibration;
- this.sessionID = sessionID;
- }
- public override string ToString() {
- return string.Format("RelocationResponse status:{0}, seq:{1}, point2d_vec:{2}, point3d_vec:{3}, transform_ltg:{4}, extra_msg:{5}",
- status, seq, XDKTools.ListVectro2ToString(point2d_vec), XDKTools.ListVector3ToString(point3d_vec), XDKTools.ListDoubleToString(transform_ltg), extra_msg);
- }
- }
- [System.Serializable]
- public class RelocUploadImageItem {
- public string sessionID;
- public Int32 seq;
- public Matrix4x4 cameraPose;
- public CameraCalibration cameraCalibration;
- public byte[] imageBytes;
- public RelocUploadImageItem() { }
- public RelocUploadImageItem(string sessionID, Int32 seq, Matrix4x4 cameraPose, CameraCalibration cameraCalibration, byte[] imageBytes) {
- this.sessionID = sessionID;
- this.seq = seq;
- this.cameraPose = cameraPose;
- this.cameraCalibration = cameraCalibration;
- this.imageBytes = imageBytes;
- }
- public override string ToString() {
- StringBuilder sb = new StringBuilder();
- sb.Append("RelocUploadImageItem: ");
- sb.Append("sessionID: " + sessionID + "; ");
- sb.Append("seq: " + seq + "; ");
- sb.Append("cameraPose: " + cameraPose.ToString() + "; ");
- sb.Append("cameraCalibration: " + cameraCalibration.ToString() + "; ");
- sb.Append("imageBytes(0-100): " + XDKTools.GetBytesString(imageBytes, 0, 100, ", ") + "; ");
- return sb.ToString();
- }
- }
- #endregion of Custom Data Structure
- #region Cumsom UnityEvent
- [System.Serializable]
- public class UnityEventBool : UnityEvent<bool> { }
- #endregion of Cumsom UnityEvent
- }
|