Carma-platform v4.2.0
CARMA Platform is built on robot operating system (ROS) and utilizes open source software (OSS) that enables Cooperative Driving Automation (CDA) features to allow Automated Driving Systems to interact and cooperate with infrastructure and other vehicles through communication.
carma_cooperative_perception::DDateTime Struct Reference

#include <j2735_types.hpp>

Collaboration diagram for carma_cooperative_perception::DDateTime:
Collaboration graph

Static Public Member Functions

static auto from_msg (const j2735_v2x_msgs::msg::DDateTime &msg) -> DDateTime
 

Public Attributes

std::optional< units::time::year_t > year {std::nullopt}
 
std::optional< Monthmonth {std::nullopt}
 
std::optional< units::time::day_t > day {std::nullopt}
 
std::optional< units::time::hour_t > hour {std::nullopt}
 
std::optional< units::time::minute_t > minute {std::nullopt}
 
std::optional< units::time::second_t > second {std::nullopt}
 
std::optional< units::time::minute_t > time_zone_offset {std::nullopt}
 

Detailed Description

Definition at line 36 of file j2735_types.hpp.

Member Function Documentation

◆ from_msg()

auto carma_cooperative_perception::DDateTime::from_msg ( const j2735_v2x_msgs::msg::DDateTime &  msg) -> DDateTime
static

Definition at line 19 of file j2735_types.cpp.

20{
21 DDateTime d_date_time;
22
23 if (msg.presence_vector & msg.YEAR) {
24 d_date_time.year = units::time::year_t{static_cast<double>(msg.year.year)};
25 }
26
27 if (msg.presence_vector & msg.MONTH) {
28 d_date_time.month = Month{msg.month.month};
29 }
30
31 if (msg.presence_vector & msg.DAY) {
32 d_date_time.day = units::time::day_t{static_cast<double>(msg.day.day)};
33 }
34
35 if (msg.presence_vector & msg.HOUR) {
36 d_date_time.hour = units::time::hour_t{static_cast<double>(msg.hour.hour)};
37 }
38
39 if (msg.presence_vector & msg.MINUTE) {
40 d_date_time.minute = units::time::minute_t{static_cast<double>(msg.minute.minute)};
41 }
42
43 if (msg.presence_vector & msg.SECOND) {
44 d_date_time.second = units::time::millisecond_t{static_cast<double>(msg.second.millisecond)};
45 }
46
47 if (msg.presence_vector & msg.OFFSET) {
48 d_date_time.time_zone_offset =
49 units::time::minute_t{static_cast<double>(msg.offset.offset_minute)};
50 }
51
52 return d_date_time;
53}

References day, hour, minute, month, second, time_zone_offset, and year.

Referenced by carma_cooperative_perception::to_detection_list_msg().

Here is the caller graph for this function:

Member Data Documentation

◆ day

std::optional<units::time::day_t> carma_cooperative_perception::DDateTime::day {std::nullopt}

Definition at line 40 of file j2735_types.hpp.

Referenced by from_msg().

◆ hour

std::optional<units::time::hour_t> carma_cooperative_perception::DDateTime::hour {std::nullopt}

Definition at line 41 of file j2735_types.hpp.

Referenced by from_msg().

◆ minute

std::optional<units::time::minute_t> carma_cooperative_perception::DDateTime::minute {std::nullopt}

Definition at line 42 of file j2735_types.hpp.

Referenced by from_msg().

◆ month

std::optional<Month> carma_cooperative_perception::DDateTime::month {std::nullopt}

Definition at line 39 of file j2735_types.hpp.

Referenced by from_msg().

◆ second

std::optional<units::time::second_t> carma_cooperative_perception::DDateTime::second {std::nullopt}

◆ time_zone_offset

std::optional<units::time::minute_t> carma_cooperative_perception::DDateTime::time_zone_offset {std::nullopt}

Definition at line 44 of file j2735_types.hpp.

Referenced by from_msg().

◆ year

std::optional<units::time::year_t> carma_cooperative_perception::DDateTime::year {std::nullopt}

Definition at line 38 of file j2735_types.hpp.

Referenced by from_msg().


The documentation for this struct was generated from the following files: