1 #ifndef __MARNAV__NMEA__RMB__HPP__
2 #define __MARNAV__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";
66 rmb(const rmb
&) = default;
67 rmb
& operator=(const rmb
&) = default;
68 rmb(rmb
&&) = default;
69 rmb
& operator=(rmb
&&) = default;
72 rmb(talker talk
, 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
<mode_indicator
> mode_ind
;
92 decltype(active
) get_active() const { return active
; }
93 decltype(cross_track_error
) get_cross_track_error() const { return cross_track_error
; }
94 decltype(steer_dir
) get_steer_dir() const { return steer_dir
; }
95 decltype(waypoint_to
) get_waypoint_to() const { return waypoint_to
; }
96 decltype(waypoint_from
) get_waypoint_from() const { return waypoint_from
; }
97 decltype(range
) get_range() const { return range
; }
98 decltype(bearing
) get_bearing() const { return bearing
; }
99 decltype(dst_velocity
) get_dst_velocity() const { return dst_velocity
; }
100 decltype(arrival_status
) get_arrival_status() const { return arrival_status
; }
101 decltype(mode_ind
) get_mode_ind() const { return mode_ind
; }
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(mode_indicator t
) noexcept
{ mode_ind
= t
; }