1 #ifndef __MARNAV__NMEA__PGRME__HPP__
2 #define __MARNAV__NMEA__PGRME__HPP__
4 #include <marnav/nmea/sentence.hpp>
5 #include <marnav/utils/optional.hpp>
11 MARNAV_NMEA_DECLARE_SENTENCE_PARSE_FUNC(pgrme
)
13 /// @brief PGRME - Garmin Estimated Error
18 /// $PGRME,hhh,M,vvv,M,ttt,M*hh<CR><LF>
23 /// 1. Estimated horizontal position error (HPE)
25 /// 3. Estimated vertical position error (VPE)
27 /// 5. Overall spherical equivalent position error
31 /// Example: <tt>$PGRME,15.0,M,45.0,M,25.0,M*22</tt>
33 class pgrme
: public sentence
35 MARNAV_NMEA_SENTENCE_FRIENDS(pgrme
)
38 constexpr static const sentence_id ID
= sentence_id::PGRME
;
39 constexpr static const char * TAG
= "PGRME";
42 pgrme(const pgrme
&) = default;
43 pgrme
& operator=(const pgrme
&) = default;
44 pgrme(pgrme
&&) = default;
45 pgrme
& operator=(pgrme
&&) = default;
48 pgrme(talker talk
, fields::const_iterator first
, fields::const_iterator last
);
49 virtual std::vector
<std::string
> get_data() const override
;
52 utils::optional
<double> horizontal_position_error
;
53 unit::distance horizontal_position_error_unit
= unit::distance::meter
;
54 utils::optional
<double> vertical_position_error
;
55 unit::distance vertical_position_error_unit
= unit::distance::meter
;
56 utils::optional
<double> overall_spherical_equiv_position_error
;
57 unit::distance overall_spherical_equiv_position_error_unit
= unit::distance::meter
;
60 decltype(horizontal_position_error
) get_horizontal_position_error() const
62 return horizontal_position_error
;
64 decltype(horizontal_position_error_unit
) get_horizontal_position_error_unit() const
66 return horizontal_position_error_unit
;
68 decltype(vertical_position_error
) get_vertical_position_error() const
70 return vertical_position_error
;
72 decltype(vertical_position_error_unit
) get_vertical_position_error_unit() const
74 return vertical_position_error_unit
;
76 decltype(overall_spherical_equiv_position_error
)
77 get_overall_spherical_equiv_position_error() const
79 return overall_spherical_equiv_position_error
;
81 decltype(overall_spherical_equiv_position_error_unit
)
82 get_overall_spherical_equiv_position_error_unit() const
84 return overall_spherical_equiv_position_error_unit
;
87 void set_horizontal_position_error(double t
) noexcept
{ horizontal_position_error
= t
; }
88 void set_vertical_position_error(double t
) noexcept
{ vertical_position_error
= t
; }
89 void set_overall_spherical_equiv_position_error(double t
) noexcept
91 overall_spherical_equiv_position_error
= t
;