1 #ifndef MARNAV_NMEA_GST_HPP
2 #define MARNAV_NMEA_GST_HPP
4 #include <marnav/nmea/sentence.hpp>
5 #include <marnav/nmea/time.hpp>
6 #include <marnav/units/units.hpp>
11 /// @brief GST - GPS Pseudorange Noise Statistics
16 /// $--GST,hhmmss.ss,x,x,x,x,x,x,x*hh<CR><LF>
20 /// 1. TC time of associated GGA fix
21 /// 2. Total RMS standard deviation of ranges inputs to the navigation solution
22 /// 3. Standard deviation (meters) of semi-major axis of error ellipse
23 /// 4. Standard deviation (meters) of semi-minor axis of error ellipse
24 /// 5. Orientation of semi-major axis of error ellipse (true north degrees)
25 /// 6. Standard deviation (meters) of latitude error
26 /// 7. Standard deviation (meters) of longitude error
27 /// 8. Standard deviation (meters) of altitude error
29 class gst
: public sentence
31 friend class detail::factory
;
34 constexpr static sentence_id ID
= sentence_id::GST
;
35 constexpr static const char * TAG
= "GST";
38 gst(const gst
&) = default;
39 gst
& operator=(const gst
&) = default;
40 gst(gst
&&) = default;
41 gst
& operator=(gst
&&) = default;
44 gst(talker talk
, fields::const_iterator first
, fields::const_iterator last
);
45 void append_data_to(std::string
&, const version
&) const override
;
49 double total_rms_
= 0.0;
50 units::meters dev_semi_major_
;
51 units::meters dev_semi_minor_
;
52 double orientation_
= 0.0;
53 units::meters dev_lat_
;
54 units::meters dev_lon_
;
55 units::meters dev_alt_
;
58 nmea::time
get_time_utc() const { return time_utc_
; }
59 double get_total_rms() const { return total_rms_
; }
60 units::length
get_dev_semi_major() const { return {dev_semi_major_
}; }
61 units::length
get_dev_semi_minor() const { return {dev_semi_minor_
}; }
62 double get_orientation() const { return orientation_
; }
63 units::length
get_dev_lat() const { return {dev_lat_
}; }
64 units::length
get_dev_lon() const { return {dev_lon_
}; }
65 units::length
get_dev_alt() const { return {dev_alt_
}; }
67 void set_time_utc(const nmea::time
& t
) noexcept
{ time_utc_
= t
; }
68 void set_total_rms(double t
) noexcept
{ total_rms_
= t
; }
69 void set_dev_semi_major(units::length t
) noexcept
71 dev_semi_major_
= t
.get
<units::meters
>();
73 void set_dev_semi_minor(units::length t
) noexcept
75 dev_semi_minor_
= t
.get
<units::meters
>();
77 void set_orientation(double t
) noexcept
{ orientation_
= t
; }
78 void set_dev_lat(units::length t
) noexcept
{ dev_lat_
= t
.get
<units::meters
>(); }
79 void set_dev_lon(units::length t
) noexcept
{ dev_lon_
= t
.get
<units::meters
>(); }
80 void set_dev_alt(units::length t
) noexcept
{ dev_alt_
= t
.get
<units::meters
>(); }