QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
Gimbal.cc
Go to the documentation of this file.
1#include "Gimbal.h"
2#include "GimbalController.h"
4
5QGC_LOGGING_CATEGORY(GimbalLog, "Gimbal.Gimbal")
6
8 : FactGroup(1000, QStringLiteral(":/json/Vehicle/GimbalFact.json"), parent)
9{
10 qCDebug(GimbalLog) << this;
11
12 _initFacts();
13}
14
16 : FactGroup(1000, QStringLiteral(":/json/Vehicle/GimbalFact.json"), other.parent())
17{
18 _initFacts();
19 *this = other;
20}
21
23{
24 // qCDebug(GimbalLog) << Q_FUNC_INFO << this;
25}
26
27const Gimbal &Gimbal::operator=(const Gimbal &other)
28{
29 _requestInformationRetries = other._requestInformationRetries;
30 _requestStatusRetries = other._requestStatusRetries;
31 _requestAttitudeRetries = other._requestAttitudeRetries;
32 _lastStatusRequestMs = other._lastStatusRequestMs;
33 _receivedGimbalManagerInformation = other._receivedGimbalManagerInformation;
34 _receivedGimbalManagerStatus = other._receivedGimbalManagerStatus;
35 _receivedGimbalDeviceAttitudeStatus = other._receivedGimbalDeviceAttitudeStatus;
36 _deltaYawValid = other._deltaYawValid;
37 _receivedGimbalDeviceInformation = other._receivedGimbalDeviceInformation;
38 _deviceName = other._deviceName;
39 _isComplete = other._isComplete;
40 _retracted = other._retracted;
41 _neutral = other._neutral;
42 _haveControl = other._haveControl;
43 _othersHaveControl = other._othersHaveControl;
44 _absoluteRollFact = other._absoluteRollFact;
45 _absolutePitchFact = other._absolutePitchFact;
46 _bodyYawFact = other._bodyYawFact;
47 _absoluteYawFact = other._absoluteYawFact;
48 _deltaYawFact = other._deltaYawFact;
49 _deviceIdFact = other._deviceIdFact;
50 _yawLock = other._yawLock;
51 _haveControl = other._haveControl;
52 _othersHaveControl = other._othersHaveControl;
53
54 return *this;
55}
56
57void Gimbal::_initFacts()
58{
59 _addFact(&_absoluteRollFact);
60 _addFact(&_absolutePitchFact);
61 _addFact(&_bodyYawFact);
62 _addFact(&_absoluteYawFact);
63 _addFact(&_deltaYawFact);
64 _addFact(&_deviceIdFact);
65 _addFact(&_managerCompidFact);
66
67 _absoluteRollFact.setRawValue(0.0f);
68 _absolutePitchFact.setRawValue(0.0f);
69 _bodyYawFact.setRawValue(0.0f);
70 _absoluteYawFact.setRawValue(0.0f);
71 _deltaYawFact.setRawValue(qQNaN());
72 _deviceIdFact.setRawValue(0);
73 _managerCompidFact.setRawValue(0);
74}
75
76void Gimbal::setCapabilityFlags(uint32_t flags)
77{
78 if (_capabilityFlags != flags) {
79 _capabilityFlags = flags;
81 }
82}
#define QGC_LOGGING_CATEGORY(name, categoryStr)
Used to group Facts together into an object hierarachy.
Definition FactGroup.h:16
void _addFact(Fact *fact, const QString &name)
Definition FactGroup.cc:116
void setRawValue(const QVariant &value)
Definition Fact.cc:135
Definition Gimbal.h:9
const Gimbal & operator=(const Gimbal &other)
Definition Gimbal.cc:27
~Gimbal()
Definition Gimbal.cc:22
Gimbal(GimbalController *parent)
Definition Gimbal.cc:7
void capabilityFlagsChanged()
void setCapabilityFlags(uint32_t flags)
Definition Gimbal.cc:76