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 _receivedGimbalManagerInformation = other._receivedGimbalManagerInformation;
33 _receivedGimbalManagerStatus = other._receivedGimbalManagerStatus;
34 _receivedGimbalDeviceAttitudeStatus = other._receivedGimbalDeviceAttitudeStatus;
35 _isComplete = other._isComplete;
36 _retracted = other._retracted;
37 _neutral = other._neutral;
38 _haveControl = other._haveControl;
39 _othersHaveControl = other._othersHaveControl;
40 _absoluteRollFact = other._absoluteRollFact;
41 _absolutePitchFact = other._absolutePitchFact;
42 _bodyYawFact = other._bodyYawFact;
43 _absoluteYawFact = other._absoluteYawFact;
44 _deviceIdFact = other._deviceIdFact;
45 _yawLock = other._yawLock;
46 _haveControl = other._haveControl;
47 _othersHaveControl = other._othersHaveControl;
48
49 return *this;
50}
51
52void Gimbal::_initFacts()
53{
54 _addFact(&_absoluteRollFact);
55 _addFact(&_absolutePitchFact);
56 _addFact(&_bodyYawFact);
57 _addFact(&_absoluteYawFact);
58 _addFact(&_deviceIdFact);
59 _addFact(&_managerCompidFact);
60
61 _absoluteRollFact.setRawValue(0.0f);
62 _absolutePitchFact.setRawValue(0.0f);
63 _bodyYawFact.setRawValue(0.0f);
64 _absoluteYawFact.setRawValue(0.0f);
65 _deviceIdFact.setRawValue(0);
66 _managerCompidFact.setRawValue(0);
67}
68
69void Gimbal::setCapabilityFlags(uint32_t flags)
70{
71 if (_capabilityFlags != flags) {
72 _capabilityFlags = flags;
74 }
75}
#define QGC_LOGGING_CATEGORY(name, categoryStr)
Used to group Facts together into an object hierarachy.
Definition FactGroup.h:19
void _addFact(Fact *fact, const QString &name)
Definition FactGroup.cc:113
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:69