2 #include <marnav/nmea/io.hpp>
8 MARNAV_NMEA_DEFINE_SENTENCE_PARSE_FUNC(xtr
)
10 constexpr const char * xtr::TAG
;
13 : sentence(ID
, TAG
, talker_id::global_positioning_system
)
17 xtr::xtr(talker talk
, fields::const_iterator first
, fields::const_iterator last
)
18 : sentence(ID
, TAG
, talk
)
20 if (std::distance(first
, last
) != 3)
21 throw std::invalid_argument
{"invalid number of fields in xtr"};
23 read(*(first
+ 0), cross_track_error_magnitude
);
24 read(*(first
+ 1), direction_to_steer
);
25 read(*(first
+ 2), cross_track_unit
);
28 std::vector
<std::string
> xtr::get_data() const
30 return {to_string(cross_track_error_magnitude
), to_string(direction_to_steer
),
31 to_string(cross_track_unit
)};