18 Q_MOC_INCLUDE(
"QmlObjectListModel.h")
35 Q_INVOKABLE
void gimbalOnScreenControl(
float panpct,
float tiltpct,
bool clickAndPoint,
bool clickAndDrag,
bool rateControl,
bool retract =
false,
bool neutral =
false,
bool yawlock =
false);
36 Q_INVOKABLE
void sendPitchBodyYaw(
float pitch,
float yaw,
bool showError =
true);
47 Q_INVOKABLE
void sendGimbalRate(
float pitch_rate_deg_s,
float yaw_rate_deg_s);
63 void _initialConnectCompleted();
65 void _rateSenderTimeout();
69 GimbalPairId() =
default;
70 GimbalPairId(uint8_t _managerCompid, uint8_t _deviceId)
71 : managerCompid(_managerCompid)
72 , deviceId(_deviceId) {}
75 bool operator<(
const GimbalPairId &other)
const {
77 if (managerCompid < other.managerCompid) {
79 }
else if (managerCompid > other.managerCompid) {
81 }
else if (deviceId < other.deviceId) {
88 bool operator==(
const GimbalPairId &other)
const {
89 return (managerCompid == other.managerCompid) && (deviceId == other.deviceId);
92 uint8_t managerCompid = 0;
97 bool _requestGimbalInformation(uint8_t compid);
99 static void _requestDeviceInformationResultHandler(
107 void _checkComplete(
Gimbal &gimbal, GimbalPairId pairId);
108 bool _tryGetGimbalControl();
109 bool _yawInVehicleFrame(uint32_t flags);
111 void _sendGimbalAttitudeRates(
float pitch_rate_deg_s,
float yaw_rate_deg_s);
113 QTimer _rateSenderTimer;
115 Gimbal *_activeGimbal =
nullptr;
116 int _pendingInformationRequestCompId = -1;
118 struct PotentialGimbalManager {
119 unsigned requestGimbalManagerInformationRetries = 6;
120 bool receivedGimbalManagerInformation =
false;
122 QMap<uint8_t, PotentialGimbalManager> _potentialGimbalManagers;
124 QMap<GimbalPairId, Gimbal*> _potentialGimbals;
126 bool _initialConnectComplete =
false;
128 static constexpr const char *_gimbalFactGroupNamePrefix =
"gimbal";
Q_INVOKABLE void gimbalOnScreenControl(float panpct, float tiltpct, bool clickAndPoint, bool clickAndDrag, bool rateControl, bool retract=false, bool neutral=false, bool yawlock=false)