34#include "GPSInterface/Headers/GNSSEnums.h"
35#include "GPSInterface/Headers/RW5Info.h"
36#include "GPSInterface/Headers/NMEAParserData.h"
37#include <NDEVR/Device.h>
38#include <NDEVR/OrientationSensor.h>
39#include <NDEVR/PositionSensor.h>
40#include "Design/Headers/GPSPoint.h"
41#include "Base/Headers/Vertex.hpp"
42#include "Base/Headers/UUID.h"
43#include "Base/Headers/ApplicationOptions.h"
44#include "Base/Headers/Angle.h"
46class QGeoPositionInfo;
47class QGeoPositionInfoSource;
54 class NMEASentenceBase;
203 void processError(
uint04 error);
206 void localPositionUpdatedSlot(
const QGeoPositionInfo&
info);
209 void localNMEAUpdatedSlot(
const QString&
info);
The default object to store data of any type that should persist through sessions of the application.
The equivelent of std::vector but with a bit more control.
A Qt-integrated NMEA parser that reads data from serial connections or files and emits signals when p...
A standard interface for all types of connections that allow transmitting and receiving of data betwe...
A core class where all Design Objects including models, materials, and geometries are stored.
File file() const
Returns the file path associated with this design object as a File object.
A hash-based key-value store, useful for quick associative lookups.
A dialog designed to allow the user to navigate a filesytem and select or create one or more files or...
Logic for reading or writing to a file as well as navigating filesystems or other common file operati...
bool orientationValid() const
Returns whether a valid orientation has been received.
virtual bool requestUsingGPS(bool using_gps) override
Requests to enable or disable GPS usage.
TimeSpan differentialAge() const
Returns the differential correction age.
virtual ~GPSSensor()
Destructor.
const Dictionary< UUID, GNSSSatelliteInfo > & satelliteInfo()
Returns the current satellite info dictionary.
void update(Time time) override
Updates the sensor with the current time.
GNSSMode m_gps_mode
The current GPS data source mode.
bool m_satellite_info_valid
Whether the cached satellite info is valid.
NMEAUpdateInfo addNMEALine(const String &line)
Processes a single NMEA sentence line and returns update information.
GPSPoint nmeaPosition() const
Returns the current position from the NMEA parser.
const Buffer< NMEASentenceReader * > & sentenceParsers() const
Returns the registered sentence parser objects.
bool isValid() const
Returns whether the sensor has valid position data.
void gnssOrientationUpdateSignal()
Emitted when orientation data is updated.
bool requestLocalMachine()
Requests to use the local machine's GPS hardware.
void gnssQualityUpdateSignal()
Emitted when the GNSS quality level changes.
fltp08 convertErrorLatLonToMeters(fltp08 lat_lon_error, uint01 dimension=LAT) const
Converts a lat/lon error value to meters.
void updateOrientationFromNMEA(Time time)
Updates orientation data from the NMEA parser.
bool requestUseConnection(ConnectionInfo info)
Requests to connect using the specified connection info.
void gnssPositionUpdateSignal()
Emitted when a new position fix is received.
File activeFile() const
Returns the file currently being used for GPS input.
const NMEAInfo & info() const
Returns the current NMEA info structure.
bool isGNSSStreamOpen() const
Returns whether the GNSS data stream is currently open.
Dictionary< UUID, GNSSSatelliteInfo > computeSatelliteInfo()
Computes the satellite info dictionary from current NMEA data.
bool requestUseFile(const File &file)
Requests to read GPS data from a file.
bool requestNoConnection()
Requests to disconnect from all GPS sources.
CNMEAParserQt * parser()
Returns the internal NMEA parser.
virtual bool stationUsedForOffset() const override
Returns whether a base station is used for offset corrections.
GPSSensor(const Model &model, InfoPipe *log, QObject *parent=nullptr)
Constructs a GPS sensor from a model with a log and optional parent.
OrientationSensor * m_orientation_sensor
The associated orientation sensor.
DesignObjectLookup * m_lookup
Design object lookup for coordinate conversion.
void setGPSPoint(const GPSPoint &point)
Manually sets the GPS point.
Vector< 3, fltp08 > stdDev() const override
Returns the standard deviation of the position (not implemented).
bool m_has_valid_heading
Whether a valid heading has been received.
static ApplicationOption< TimeSpan > default_gnss_timeout
Default GNSS timeout application option.
Time lastGNSSRxTime() const
Returns the time of the last GNSS data reception.
fltp08 filePercent() const
Returns the file read progress as a percentage (0.0 to 1.0).
GNSSMode mode() const
Returns the current GPS data source mode.
void onConnectionChangedSignal()
Emitted when the connection state changes.
CNMEAParserQt * m_nmea_parser
The NMEA parser instance.
void setMode(GNSSMode mode)
Sets the GPS data source mode.
Vertex< 3, fltp08 > convertFromLatLon(const Vertex< 3, fltp08 > &lat_lon_point, bool &has_sent_warning) const
Converts a lat/lon/elevation vertex to the local coordinate system.
bool hasEstimate()
Returns whether the sensor has an estimated position.
void setAutoConnect(bool autoconnect)
Sets whether the sensor should auto-connect.
GNSSQuality m_last_gnss_quality
The last reported GNSS quality.
Connection * connection()
Returns the underlying connection object.
GPSPoint m_last_gps_point
The most recently received GPS point.
TimeSpan m_gps_timeout
The GNSS timeout duration.
const GPSPoint & lastGPSPoint() const
Returns the last received GPS point.
bool m_has_sent_warning
Whether a coordinate conversion warning was sent.
OrientationSensor * orientationSensor() const override
Returns the associated orientation sensor.
Time lastGNSSUpdateTime() const
Returns the time of the last GNSS position update.
RW5FileOptions m_rw5_file_options
RW5 file reading options.
Buffer< Vertex< 3, fltp08 > > m_localization_points
Localization reference points.
static Dictionary< UUID, GNSSSatelliteInfo > AverageSats(const Dictionary< UUID, GNSSSatelliteInfo > &a, const Dictionary< UUID, GNSSSatelliteInfo > &b, fltp08 ratio)
Computes a weighted average of two satellite info dictionaries.
virtual TimeSpan updateInterval() const override
Returns the sensor update interval.
Dictionary< UUID, GNSSSatelliteInfo > m_satellite_info
Cached satellite information.
QGeoPositionInfoSource * m_local_position_source
Qt local position source.
virtual GNSSQuality gpsQuality() const override
Returns the current GPS fix quality.
TimeSpan gnssTimeoutSpan() const
Returns the GNSS timeout span.
void gnssSatelliteUpdateSignal()
Emitted when satellite information is updated.
A light-weight base class for Log that allows processes to update, without the need for additional in...
Serves as the primary program interface for processes to report issues and allows any number of LogSt...
A core class that represents a node on model hierarchy.
Abstract base class for parsing specific NMEA sentence types (e.g.
Forward declaration for design object lookup service.
PositionSensor(const Model &name, LogPtr log, QObject *parent=nullptr)
Constructs a PositionSensor with the given model, log, and optional parent.
The core String class for the NDEVR API.
Stores a time span, or difference between two times, with an optional start time.
Represents a timestamp with utilities for manipulation and conversion.
A fixed-size array with N dimensions used as the basis for geometric and mathematical types.
A point in N-dimensional space, used primarily for spatial location information.
The primary namespace for the NDEVR SDK.
GNSSMode
Specifies the GPS data source mode used by the sensor.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
double fltp08
Defines an alias representing an 8 byte floating-point number.
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
GNSSQuality
Describes the quality level of a GNSS position fix.
@ e_invalid
No fix available or fix is invalid.
A structure designed to store information about a specific Connection.
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
A geographic coordinate point produced by a GNSS receiver.
The complete accumulated NMEA data state including satellite info, error data, INS data,...
Describes what was updated after processing an NMEA sentence, including which data categories changed...
Options for reading an RW5 file, including the parsed data, file path, and incremental read state.