#pragma once

namespace inertia
{

/** @brief GNSS/GPS Sensor data.
 *
 *  This struct contains measurements from a Global Navigation Satellite System (GNSS) module.
 */
struct INERTIA_API GPSsample
{
	bool navigationValid;          ///< The navigation values in the GPS sample are valid.
	bool velocityValid;            ///< The velocity values in the GPS sample are valid.

	bool hasUTC;                   ///< The GPS sample has UTC timestamp values.
	unsigned year;                 ///< The UTC timestamp year.
	unsigned month;                ///< The UTC timestamp month.
	unsigned day;                  ///< The UTC timestamp day.
	unsigned hour;                 ///< The UTC timestamp hour.
	unsigned minute;               ///< The UTC timestamp minute.
	double second;                 ///< The UTC timestamp second (and millisecond).

	bool hasLatLon;                ///< The GPS sample has Latitude and Longitude values.
	double latitude;               ///< The Latitude (degrees).
	double longitude;              ///< The Longitude (degrees).

	bool hasAltitudeEllipsoid;     ///< The GPS sample has an Altitude from Ellipsoid value.
	double altitudeEllipsoid;      ///< The Altitude from Ellipsoid (m).

	bool hasAltitudeMSL;           ///< The GPS sample has an Altitude from Mean Sea Level value.
	double altitudeMSL;            ///< The Altitude from Mean Sea Level (m).

	bool hasSpeedOverGround;       ///< The GPS sample has a Speed over Ground value.
	double speedOverGround;        ///< The Speed over Ground (m/s).

	bool hasCourseOverGround;      ///< The GPS sample has a Course over Ground value.
	double courseOverGround;       ///< The Course over Ground (degrees).

	bool hasNumberSvsInFix;        ///< The GPS sample has a Number of used Satellites value.
	unsigned numberSvsInFix;       ///< The Number of used Satellites.

	bool hasHDOP;                  ///< The GPS sample has a Horizontal Dilution of Position value.
	double horDilutionOfPrecision; ///< The Horizontal Dilution of Position (HDOP).

	bool hasHorPosError;           ///< The GPS sample has an Estimated Horizontal Position Error value.
	double horPosError;            ///< The Estimated Horizontal Position Error (EHPE) (m).

	bool hasVertPosError;          ///< The GPS sample has an Estimated Vertical Position Error value.
	double vertPosError;           ///< The Estimated Vertical Position Error (EVPE) (m).

	bool hasTimeError;             ///< The GPS sample has an Estimated Time Error value.
	double timeError;              ///< The Estimated Time Error (ETE) (s).

	bool hasHorVelocityError;      ///< The GPS sample has an Estimated Horizontal Velocity Error value.
	double horVelocityError;       ///< The Estimated Horizontal Velocity Error (EHVE) (m/s).

	/** Default constructor. */
	GPSsample();
};

}
