23 if (msg.presence_vector & msg.YEAR) {
24 d_date_time.
year = units::time::year_t{
static_cast<double>(msg.year.year)};
27 if (msg.presence_vector & msg.MONTH) {
31 if (msg.presence_vector & msg.DAY) {
32 d_date_time.
day = units::time::day_t{
static_cast<double>(msg.day.day)};
35 if (msg.presence_vector & msg.HOUR) {
36 d_date_time.
hour = units::time::hour_t{
static_cast<double>(msg.hour.hour)};
39 if (msg.presence_vector & msg.MINUTE) {
40 d_date_time.
minute = units::time::minute_t{
static_cast<double>(msg.minute.minute)};
43 if (msg.presence_vector & msg.SECOND) {
44 d_date_time.
second = units::time::millisecond_t{
static_cast<double>(msg.second.millisecond)};
47 if (msg.presence_vector & msg.OFFSET) {
49 units::time::minute_t{
static_cast<double>(msg.offset.offset_minute)};
59 units::acceleration::centi_meters_per_second_squared_t{
static_cast<double>(msg.longitudinal)},
60 units::acceleration::centi_meters_per_second_squared_t{
static_cast<double>(msg.lateral)},
61 units::acceleration::two_centi_standard_gravities_t{
static_cast<double>(msg.vert)},
62 units::angular_velocity::centi_degrees_per_second_t{
static_cast<double>(msg.yaw_rate)}};
69 units::acceleration::meters_per_second_squared_t{
static_cast<double>(msg.longitudinal)},
70 units::acceleration::meters_per_second_squared_t{
static_cast<double>(msg.lateral)},
71 units::acceleration::meters_per_second_squared_t{
static_cast<double>(msg.vert)},
72 units::angular_velocity::degrees_per_second_t{
static_cast<double>(msg.yaw_rate)}};
78 units::angle::deci_micro_degrees_t{
static_cast<double>(msg.latitude)},
79 units::angle::deci_micro_degrees_t{
static_cast<double>(msg.longitude)}, std::nullopt};
81 if (msg.elevation_exists) {
82 position.
elevation = units::length::deca_centimeters_t{
static_cast<double>(msg.elevation)};
91 units::angle::degree_t{
static_cast<double>(msg.latitude)},
92 units::angle::degree_t{
static_cast<double>(msg.longitude)}, std::nullopt};
94 if (msg.elevation_exists) {
95 position.
elevation = units::length::meter_t{
static_cast<double>(msg.elevation)};
103 return {units::angle::eighth_deci_degrees_t{
static_cast<double>(heading.heading)}};
108 return {units::angle::degree_t{
static_cast<double>(heading.heading)}};
113 return {units::velocity::two_centi_meters_per_second_t{
static_cast<double>(speed.speed)}};
118 return {units::velocity::meters_per_second_t{
static_cast<double>(speed.speed)}};
static auto from_msg(const j2735_v2x_msgs::msg::AccelerationSet4Way &msg) -> AccelerationSet4Way
std::optional< units::time::hour_t > hour
std::optional< units::time::day_t > day
std::optional< units::time::minute_t > minute
std::optional< Month > month
static auto from_msg(const j2735_v2x_msgs::msg::DDateTime &msg) -> DDateTime
std::optional< units::time::year_t > year
std::optional< units::time::second_t > second
std::optional< units::time::minute_t > time_zone_offset
static auto from_msg(const j2735_v2x_msgs::msg::Heading &heading) -> Heading
static auto from_msg(const j2735_v2x_msgs::msg::Position3D &msg) -> Position3D
std::optional< units::length::deca_centimeters_t > elevation
static auto from_msg(const j2735_v2x_msgs::msg::Speed &speed) -> Speed