dji_perception_impl.hpp
Go to the documentation of this file.
1 
29 #ifndef ONBOARDSDK_DJI_PERCEPTION_IMPL_H
30 #define ONBOARDSDK_DJI_PERCEPTION_IMPL_H
31 
32 #include <cstring>
33 #include "dji_perception.hpp"
34 #include "dji_vehicle.hpp"
35 #include "dji_linker.hpp"
36 
37 namespace DJI {
38 namespace OSDK {
39 
40 // Forward Declaration
41 class Vehicle;
42 
43 class PerceptionImpl {
44  public:
45  PerceptionImpl(Vehicle *vehiclePtr);
46 
47  ~PerceptionImpl();
48 
49  public:
50  typedef struct PerceptionImageHandler {
51  Perception::PerceptionImageCB cb;
52  void* userData;
53  } PerceptionImageHandler;
54 
55  typedef struct PerceptionCamParamHandler {
56  Perception::PerceptionCamParamCB cb;
57  void* userData;
58  } PerceptionCamParamHandler;
59 
60  static E_OsdkStat cameraImageHandler(struct _CommandHandle *cmdHandle,
61  const T_CmdInfo *cmdInfo, const uint8_t *cmdData, void *userData);
62 
63  static E_OsdkStat cameraParamHandler(struct _CommandHandle *cmdHandle,
64  const T_CmdInfo *cmdInfo, const uint8_t *cmdData, void *userData);
65 
66  E_OsdkStat subscribePerceptionImage(const char camChoice[11]);
67 
68  E_OsdkStat subscribePerceptionImage(Perception::CamPositionType camChoice);
69 
70  E_OsdkStat subscribePerceptionImage(Perception::DirectionType directionChoice);
71 
72  E_OsdkStat unsubscribePerceptionImage(const char camChoice[11]);
73 
74  E_OsdkStat unsubscribePerceptionImage(Perception::CamPositionType camChoice);
75 
76  E_OsdkStat unsubscribePerceptionImage(Perception::DirectionType directionChoice);
77 
78  E_OsdkStat subscribeCameraParam();
79 
80  void cancelAllSubsciptions();
81 
82  vector<Perception::DirectionType> getUpdatingDiretcion();
83  public:
84  static PerceptionImageHandler imageHandler;
85  static PerceptionCamParamHandler camParamHandler;
86 
87  static const char rectifyDownLeft[11];
88  static const char rectifyDownRight[11];
89  static const char rectifyFrontLeft[11];
90  static const char rectifyFrontRight[11];
91  static const char rectifyRearLeft[11];
92  static const char rectifyRearRight[11];
93  static const char rectifyUpLeft[11];
94  static const char rectifyUpRight[11];
95  static const char rectifyLeftLeft[11];
96  static const char rectifyLeftRight[11];
97  static const char rectifyRightLeft[11];
98  static const char rectifyRightRight[11];
99 
100  private:
101  Vehicle *vehicle;
102  static uint32_t imageUpdateSysMs[IMAGE_MAX_DIRECTION_NUM];
103  static uint32_t updateJudgingInMs;
104  string getSubscribeString(Perception::CamPositionType camChoice);
105 };
106 } // OSDK
107 } // DJI
108 
109 #endif //ONBOARDSDK_DJI_PERCEPTION_IMPL_H
Camera dji perception API of OSDK.
Definition: dji_ack.cpp:38
Vehicle API for DJI onboardSDK library.