1 #ifndef __NMEA__RMB__HPP__
2 #define __NMEA__RMB__HPP__
4 #include <marnav/nmea/sentence.hpp>
5 #include <marnav/nmea/angle.hpp>
6 #include <marnav/nmea/waypoint.hpp>
7 #include <marnav/utils/optional.hpp>
13 MARNAV_NMEA_DECLARE_SENTENCE_PARSE_FUNC(rmb
)
15 /// @brief RMB - Recommended Minimum Navigation Information
17 /// To be sent by a navigation receiver when a destination waypoint is active.
21 /// 1 2 3 4 5 6 7 8 9 10 11 12 13|
22 /// | | | | | | | | | | | | | |
23 /// $--RMB,A,x.x,a,c--c,c--c,llll.ll,a,yyyyy.yy,a,x.x,x.x,x.x,A,m,*hh<CR><LF>
30 /// 2. Cross Track error - nautical miles
31 /// 3. Direction to Steer
35 /// 5. FROM Waypoint ID
36 /// 6. Destination Waypoint Latitude
37 /// 7. Destination Waypoint Latitude hemisphere
40 /// 8. Destination Waypoint Longitude
41 /// 9. Destination Waypoint Longitude hemisphere
44 /// 10. Range to destination in nautical miles
45 /// 11. Bearing to destination in degrees True
46 /// 12. Destination closing velocity in knots
47 /// 13. Arrival Status
48 /// - A = Arrival Circle Entered
50 /// 14. FAA mode indicator (NMEA 2.3 and later)
54 /// $GPRMB,A,0.66,L,003,004,4917.24,N,12309.57,W,001.3,052.5,000.5,V*0B
57 class rmb
: public sentence
59 MARNAV_NMEA_SENTENCE_FRIENDS(rmb
)
62 constexpr static const sentence_id ID
= sentence_id::RMB
;
63 constexpr static const char * TAG
= "RMB";
68 rmb(const rmb
&) = default;
69 rmb
& operator=(const rmb
&) = default;
72 rmb(const std::string
& talker
, fields::const_iterator first
, fields::const_iterator last
);
73 virtual std::vector
<std::string
> get_data() const override
;
76 utils::optional
<status
> active
; // V:warning
77 utils::optional
<double> cross_track_error
; // cross track error in nautical miles
78 utils::optional
<side
> steer_dir
; // direction to steer, left or right
79 utils::optional
<waypoint
> waypoint_to
; // TO waypoint ID
80 utils::optional
<waypoint
> waypoint_from
; // FROM waypoint ID
81 utils::optional
<geo::latitude
> lat
; // destination waypoint latitude
82 utils::optional
<direction
> lat_hem
; // destination waypoint latitude dir, N:north, S:south
83 utils::optional
<geo::longitude
> lon
; // destination waypoint longitude
84 utils::optional
<direction
> lon_hem
; // destination waypoint longitude dir, E:east, W:west
85 utils::optional
<double> range
; // range to destination in nautical miles
86 utils::optional
<double> bearing
; // bearing to destination in degrees to true
87 utils::optional
<double> dst_velocity
; // destination closing velocity in knots
88 utils::optional
<status
> arrival_status
; // arrival status, A:arrival circle entered
89 utils::optional
<positioning_system_mode_indicator
> mode_indicator
;
93 NMEA_GETTER(cross_track_error
)
94 NMEA_GETTER(steer_dir
)
95 NMEA_GETTER(waypoint_to
)
96 NMEA_GETTER(waypoint_from
)
99 NMEA_GETTER(dst_velocity
)
100 NMEA_GETTER(arrival_status
)
101 NMEA_GETTER(mode_indicator
)
103 utils::optional
<geo::longitude
> get_longitude() const;
104 utils::optional
<geo::latitude
> get_latitude() const;
106 void set_active(status t
) noexcept
{ active
= t
; }
107 void set_cross_track_error(double t
) noexcept
{ cross_track_error
= t
; }
108 void set_steer_dir(side t
) noexcept
{ steer_dir
= t
; }
109 void set_waypoint_to(const waypoint
& id
) { waypoint_to
= id
; }
110 void set_waypoint_from(const waypoint
& id
) { waypoint_from
= id
; }
111 void set_lat(const geo::latitude
& t
);
112 void set_lon(const geo::longitude
& t
);
113 void set_range(double t
) noexcept
{ range
= t
; }
114 void set_bearing(double t
) noexcept
{ bearing
= t
; }
115 void set_dst_velocity(double t
) noexcept
{ dst_velocity
= t
; }
116 void set_arrival_status(status t
) noexcept
{ arrival_status
= t
; }
117 void set_mode_indicator(positioning_system_mode_indicator t
) noexcept