29 #ifndef ONBOARDSDK_DJI_PERCEPTION_H 30 #define ONBOARDSDK_DJI_PERCEPTION_H 35 #define IMAGE_MAX_DIRECTION_NUM (6) 46 Perception(Vehicle *vehiclePtr);
53 OSDK_PERCEPTION_PASS = 0,
54 OSDK_PERCEPTION_TIMEOUT = 1,
55 OSDK_PERCEPTION_SUBSCRIBE_FAIL = 2,
56 OSDK_PERCEPTION_PARAM_ERR = 3,
57 OSDK_PERCEPTION_REQ_REFUSED = 4,
58 OSDK_PERCEPTION_REQ_UNSUPPORT = 5,
59 OSDK_LIVEVIEW_UNKNOWN = 0xFF,
62 typedef enum CamPositionType : uint32_t {
63 RECTIFY_DOWN_LEFT = 1,
64 RAW_DOWN_FRONT = RECTIFY_DOWN_LEFT,
65 RECTIFY_DOWN_RIGHT = 2,
66 RAW_DOWN_BACK = RECTIFY_DOWN_RIGHT,
67 RECTIFY_FRONT_LEFT = 3,
68 RAW_FRONT_LEFT = RECTIFY_FRONT_LEFT,
69 RECTIFY_FRONT_RIGHT = 4,
70 RAW_FRONT_RIGHT = RECTIFY_FRONT_RIGHT,
71 RECTIFY_REAR_LEFT = 5,
72 RECTIFY_REAR_RIGHT = 6,
74 RECTIFY_UP_RIGHT = 22,
75 RECTIFY_LEFT_LEFT = 23,
76 RECTIFY_LEFT_RIGHT = 24,
77 RECTIFY_RIGHT_LEFT = 25,
78 RECTIFY_RIGHT_RIGHT = 26
81 typedef enum DirectionType : uint8_t {
91 typedef struct RawImageInfoType {
93 DirectionType direction;
99 typedef struct ImageInfoType {
100 RawImageInfoType rawInfo;
103 CamPositionType dataType;
107 typedef struct CamParamType {
108 DirectionType direction;
109 float leftIntrinsics[9];
110 float rightIntrinsics[9];
111 float rotaionLeftInRight[9];
112 float translationLeftInRight[3];
117 uint32_t directionNum;
118 CamParamType cameraParam[IMAGE_MAX_DIRECTION_NUM];
119 } CamParamPacketType;
123 typedef void(*PerceptionCamParamCB)
124 (Perception::CamParamPacketType paramPacket,
void *userData);
127 typedef void(*PerceptionImageCB)
128 (Perception::ImageInfoType, uint8_t *imageRawBuffer,
int bufferLen,
void *userData);
142 PerceptionErrCode subscribePerceptionImage(DirectionType direction, PerceptionImageCB cb,
void* userData);
152 PerceptionErrCode unsubscribePerceptionImage(DirectionType direction);
161 PerceptionErrCode triggerStereoCamParamsPushing();
171 void setStereoCamParamsObserver(PerceptionCamParamCB cb,
void *userData);
177 void cancelAllSubsciptions();
181 PerceptionImpl *impl;
186 #endif //ONBOARDSDK_DJI_PERCEPTION_H Definition: dji_ack.cpp:38