QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
VehicleGPSFactGroup Class Reference

#include <VehicleGPSFactGroup.h>

+ Inheritance diagram for VehicleGPSFactGroup:
+ Collaboration diagram for VehicleGPSFactGroup:

Public Types

enum class  ReceiverIndex { Primary , Secondary }
 The worse of the reported spoofing and jamming states, or 0 when neither is reported. More...
 
enum class  InterferenceState { Unknown = 0 , NotDetected = 1 , Mitigated = 2 , Detected = 3 }
 MAVLink GPS_JAMMING_STATE and GPS_SPOOFING_STATE, which share their values. More...
 
enum class  AuthenticationState {
  Unknown = 0 , Initializing = 1 , Error = 2 , Ok = 3 ,
  Disabled = 4
}
 MAVLink GPS_AUTHENTICATION_STATE. More...
 

Signals

void positionReported (const QGeoPositionInfo &position, int fixType)
 
void systemErrorTextChanged ()
 
void resilienceChanged ()
 
- Signals inherited from FactGroup
void factNamesChanged ()
 
void factGroupNamesChanged ()
 
void telemetryAvailableChanged (bool telemetryAvailable)
 

Public Member Functions

 VehicleGPSFactGroup (QObject *parent=nullptr, RuntimeScheduler *scheduler=nullptr, ReceiverIndex receiver=ReceiverIndex::Primary)
 
Fact * lat ()
 
Fact * lon ()
 
Fact * mgrs ()
 
Fact * hdop ()
 
Fact * vdop ()
 
Fact * horizontalAccuracy ()
 
Fact * verticalAccuracy ()
 
Fact * courseOverGround ()
 
Fact * yaw ()
 
Fact * count ()
 
Fact * lock ()
 
Fact * systemErrors ()
 
Fact * spoofingState ()
 
Fact * jammingState ()
 
Fact * authenticationState ()
 
Fact * correctionsQuality ()
 
Fact * systemQuality ()
 
Fact * gnssSignalQuality ()
 
Fact * postProcessingQuality ()
 
Fact * rtkBaseline ()
 GPS_RTK (primary) or GPS2_RTK (secondary); cleared when the vehicle stops reporting them.
 
Fact * rtkRate ()
 
Fact * rtkSatellites ()
 
QString systemErrorText () const
 The receiver's reported system errors, comma separated; empty when there are none.
 
bool jammingReported () const
 
bool spoofingReported () const
 
bool authenticationReported () const
 
int interferenceState () const
 
int authenticationSeverity () const
 
void handleMessage (Vehicle *vehicle, const mavlink_message_t &message) override
 Allows a FactGroup to parse incoming messages and fill in values.
 
- Public Member Functions inherited from FactGroup
 FactGroup (int updateRateMsecs, const QString &metaDataFile, QObject *parent=nullptr, bool ignoreCamelCase=false)
 < false: No telemetry for these values has been received
 
 FactGroup (int updateRateMsecs, QObject *parent=nullptr, bool ignoreCamelCase=false)
 
virtual ~FactGroup ()
 
Q_INVOKABLE bool factExists (const QString &name) const
 @ return true: if the fact exists in the group
 
Q_INVOKABLE Fact * getFact (const QString &name) const
 
Q_INVOKABLE FactGroup * getFactGroup (const QString &name) const
 
Q_INVOKABLE void setLiveUpdates (bool liveUpdates)
 Turning on live updates will allow value changes to flow through as they are received.
 
QStringList factNames () const
 
QStringList factGroupNames () const
 
bool telemetryAvailable () const
 
const QMap< QString, FactGroup * > & factGroups () const
 

Static Public Member Functions

static constexpr bool reported (int state)
 A state other than Unknown or NOT_REPORTED.
 

Static Public Attributes

static constexpr int NOT_REPORTED = 255
 The value of a state the vehicle has not reported.
 
static constexpr std::chrono::seconds RTK_STATUS_TIMEOUT {5}
 
static constexpr std::chrono::seconds GNSS_INTEGRITY_TIMEOUT {5}
 The GNSS_INTEGRITY facts return to unreported when the vehicle stops sending it for this long.
 

Additional Inherited Members

- Protected Slots inherited from FactGroup
virtual void _updateAllValues ()
 
- Protected Member Functions inherited from FactGroup
void _addFact (Fact *fact, const QString &name)
 
void _addFact (Fact *fact)
 
void _addFactGroup (FactGroup *factGroup, const QString &name)
 
void _addFactGroup (FactGroup *factGroup)
 
void _loadFromJsonArray (const QJsonArray &jsonArray)
 
void _setTelemetryAvailable (bool telemetryAvailable)
 
- Protected Attributes inherited from FactGroup
const int _updateRateMSecs = 0
 Update rate for Fact::valueChanged signals, 0: immediate update.
 
QMap< QString, Fact * > _nameToFactMap
 
QMap< QString, FactGroup * > _nameToFactGroupMap
 
QMap< QString, FactMetaData * > _nameToFactMetaDataMap
 
QStringList _factNames
 

Detailed Description

One vehicle GNSS receiver: GPS_RAW_INT, GPS_RTK and GNSS_INTEGRITY id 0 for the primary, their GPS2 forms and id 1 for the secondary.

Definition at line 16 of file VehicleGPSFactGroup.h.

Member Enumeration Documentation

◆ AuthenticationState

MAVLink GPS_AUTHENTICATION_STATE.

Enumerator
Unknown 
Initializing 
Error 
Ok 
Disabled 

Definition at line 72 of file VehicleGPSFactGroup.h.

◆ InterferenceState

MAVLink GPS_JAMMING_STATE and GPS_SPOOFING_STATE, which share their values.

Enumerator
Unknown 
NotDetected 
Mitigated 
Detected 

Definition at line 62 of file VehicleGPSFactGroup.h.

◆ ReceiverIndex

The worse of the reported spoofing and jamming states, or 0 when neither is reported.

Ranks the reported authentication state, from 0 when unreported through Disabled, Initializing and Ok to Error.

Enumerator
Primary 
Secondary 

Definition at line 55 of file VehicleGPSFactGroup.h.

Constructor & Destructor Documentation

◆ VehicleGPSFactGroup()

VehicleGPSFactGroup::VehicleGPSFactGroup ( QObject *  parent = nullptr,
RuntimeScheduler *  scheduler = nullptr,
ReceiverIndex  receiver = ReceiverIndex::Primary 
)
explicit

Member Function Documentation

◆ authenticationReported()

bool VehicleGPSFactGroup::authenticationReported ( ) const

Definition at line 290 of file VehicleGPSFactGroup.cc.

References Fact::rawValue(), and reported().

◆ authenticationSeverity()

int VehicleGPSFactGroup::authenticationSeverity ( ) const

Definition at line 302 of file VehicleGPSFactGroup.cc.

References Disabled, Error, Initializing, Ok, and Fact::rawValue().

◆ authenticationState()

Fact * VehicleGPSFactGroup::authenticationState ( )
inline

Definition at line 116 of file VehicleGPSFactGroup.h.

◆ correctionsQuality()

Fact * VehicleGPSFactGroup::correctionsQuality ( )
inline

Definition at line 118 of file VehicleGPSFactGroup.h.

◆ count()

Fact * VehicleGPSFactGroup::count ( )
inline

Definition at line 106 of file VehicleGPSFactGroup.h.

◆ courseOverGround()

Fact * VehicleGPSFactGroup::courseOverGround ( )
inline

Definition at line 102 of file VehicleGPSFactGroup.h.

◆ gnssSignalQuality()

Fact * VehicleGPSFactGroup::gnssSignalQuality ( )
inline

Definition at line 122 of file VehicleGPSFactGroup.h.

◆ handleMessage()

void VehicleGPSFactGroup::handleMessage ( Vehicle *  ,
const mavlink_message_t &   
)
overridevirtual

Allows a FactGroup to parse incoming messages and fill in values.

Reimplemented from FactGroup.

Definition at line 64 of file VehicleGPSFactGroup.cc.

References Primary, and Secondary.

◆ hdop()

Fact * VehicleGPSFactGroup::hdop ( )
inline

Definition at line 94 of file VehicleGPSFactGroup.h.

◆ horizontalAccuracy()

Fact * VehicleGPSFactGroup::horizontalAccuracy ( )
inline

Definition at line 98 of file VehicleGPSFactGroup.h.

◆ interferenceState()

int VehicleGPSFactGroup::interferenceState ( ) const

Definition at line 295 of file VehicleGPSFactGroup.cc.

References Fact::rawValue(), and reported().

◆ jammingReported()

bool VehicleGPSFactGroup::jammingReported ( ) const

Definition at line 280 of file VehicleGPSFactGroup.cc.

References Fact::rawValue(), and reported().

◆ jammingState()

Fact * VehicleGPSFactGroup::jammingState ( )
inline

Definition at line 114 of file VehicleGPSFactGroup.h.

◆ lat()

Fact * VehicleGPSFactGroup::lat ( )
inline

Definition at line 88 of file VehicleGPSFactGroup.h.

◆ lock()

Fact * VehicleGPSFactGroup::lock ( )
inline

Definition at line 108 of file VehicleGPSFactGroup.h.

◆ lon()

Fact * VehicleGPSFactGroup::lon ( )
inline

Definition at line 90 of file VehicleGPSFactGroup.h.

◆ mgrs()

Fact * VehicleGPSFactGroup::mgrs ( )
inline

Definition at line 92 of file VehicleGPSFactGroup.h.

◆ positionReported

void VehicleGPSFactGroup::positionReported ( const QGeoPositionInfo &  position,
int  fixType 
)
signal

Emitted for every position report after the facts update. The altitude is above mean sea level and fixType is a MAVLink GPS_FIX_TYPE.

Referenced by NTRIPVehicleGgaSource::setVehicle().

◆ postProcessingQuality()

Fact * VehicleGPSFactGroup::postProcessingQuality ( )
inline

Definition at line 124 of file VehicleGPSFactGroup.h.

◆ reported()

static constexpr bool VehicleGPSFactGroup::reported ( int  state)
inlinestaticconstexpr

A state other than Unknown or NOT_REPORTED.

Definition at line 143 of file VehicleGPSFactGroup.h.

References NOT_REPORTED.

Referenced by authenticationReported(), interferenceState(), jammingReported(), and spoofingReported().

◆ resilienceChanged

void VehicleGPSFactGroup::resilienceChanged ( )
signal

Referenced by VehicleGPSFactGroup().

◆ rtkBaseline()

Fact * VehicleGPSFactGroup::rtkBaseline ( )
inline

GPS_RTK (primary) or GPS2_RTK (secondary); cleared when the vehicle stops reporting them.

Definition at line 127 of file VehicleGPSFactGroup.h.

◆ rtkRate()

Fact * VehicleGPSFactGroup::rtkRate ( )
inline

Definition at line 129 of file VehicleGPSFactGroup.h.

◆ rtkSatellites()

Fact * VehicleGPSFactGroup::rtkSatellites ( )
inline

Definition at line 131 of file VehicleGPSFactGroup.h.

◆ spoofingReported()

bool VehicleGPSFactGroup::spoofingReported ( ) const

Definition at line 285 of file VehicleGPSFactGroup.cc.

References Fact::rawValue(), and reported().

◆ spoofingState()

Fact * VehicleGPSFactGroup::spoofingState ( )
inline

Definition at line 112 of file VehicleGPSFactGroup.h.

◆ systemErrors()

Fact * VehicleGPSFactGroup::systemErrors ( )
inline

Definition at line 110 of file VehicleGPSFactGroup.h.

◆ systemErrorText()

QString VehicleGPSFactGroup::systemErrorText ( ) const

The receiver's reported system errors, comma separated; empty when there are none.

Definition at line 253 of file VehicleGPSFactGroup.cc.

References Fact::rawValue().

◆ systemErrorTextChanged

void VehicleGPSFactGroup::systemErrorTextChanged ( )
signal

Referenced by VehicleGPSFactGroup().

◆ systemQuality()

Fact * VehicleGPSFactGroup::systemQuality ( )
inline

Definition at line 120 of file VehicleGPSFactGroup.h.

◆ vdop()

Fact * VehicleGPSFactGroup::vdop ( )
inline

Definition at line 96 of file VehicleGPSFactGroup.h.

◆ verticalAccuracy()

Fact * VehicleGPSFactGroup::verticalAccuracy ( )
inline

Definition at line 100 of file VehicleGPSFactGroup.h.

◆ yaw()

Fact * VehicleGPSFactGroup::yaw ( )
inline

Definition at line 104 of file VehicleGPSFactGroup.h.

Member Data Documentation

◆ GNSS_INTEGRITY_TIMEOUT

constexpr std::chrono::seconds VehicleGPSFactGroup::GNSS_INTEGRITY_TIMEOUT {5}
staticconstexpr

The GNSS_INTEGRITY facts return to unreported when the vehicle stops sending it for this long.

Definition at line 147 of file VehicleGPSFactGroup.h.

◆ NOT_REPORTED

constexpr int VehicleGPSFactGroup::NOT_REPORTED = 255
staticconstexpr

The value of a state the vehicle has not reported.

Definition at line 83 of file VehicleGPSFactGroup.h.

Referenced by reported().

◆ RTK_STATUS_TIMEOUT

constexpr std::chrono::seconds VehicleGPSFactGroup::RTK_STATUS_TIMEOUT {5}
staticconstexpr

Definition at line 145 of file VehicleGPSFactGroup.h.


The documentation for this class was generated from the following files: