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.
|
#include <GeofenceSchedule.hpp>
Public Types | |
using | DayOfTheWeekSet = std::unordered_set< boost::gregorian::greg_weekday, std::hash< int > > |
Public Member Functions | |
GeofenceSchedule () | |
Default Constructor does not initialize any members. More... | |
GeofenceSchedule (rclcpp::Time schedule_start, rclcpp::Time schedule_end, rclcpp::Duration control_start, rclcpp::Duration control_duration, rclcpp::Duration control_offset, rclcpp::Duration control_span, rclcpp::Duration control_period, DayOfTheWeekSet week_day_set={ 0, 1, 2, 3, 4, 5, 6 }) | |
Constructor. More... | |
bool | scheduleExpired (const rclcpp::Time &time) const |
Returns true if the schedule has expired by the provided time. More... | |
bool | scheduleStarted (const rclcpp::Time &time) const |
Returns true if the schedule has started by the provided time. More... | |
std::pair< bool, rclcpp::Time > | getNextInterval (const rclcpp::Time &time) const |
Returns the start time of the next active interval defined by this schedule. More... | |
Public Attributes | |
rclcpp::Time | schedule_start_ |
rclcpp::Time | schedule_end_ |
rclcpp::Duration | control_start_ {0, 0} |
rclcpp::Duration | control_duration_ {0, 0} |
rclcpp::Duration | control_offset_ {0, 0} |
rclcpp::Duration | control_span_ {0, 0} |
rclcpp::Duration | control_period_ {0, 0} |
DayOfTheWeekSet | week_day_set_ |
Definition at line 26 of file GeofenceSchedule.hpp.
using carma_wm_ctrl::GeofenceSchedule::DayOfTheWeekSet = std::unordered_set<boost::gregorian::greg_weekday, std::hash<int> > |
Definition at line 38 of file GeofenceSchedule.hpp.
carma_wm_ctrl::GeofenceSchedule::GeofenceSchedule | ( | ) |
Default Constructor does not initialize any members.
Definition at line 22 of file GeofenceSchedule.cpp.
carma_wm_ctrl::GeofenceSchedule::GeofenceSchedule | ( | rclcpp::Time | schedule_start, |
rclcpp::Time | schedule_end, | ||
rclcpp::Duration | control_start, | ||
rclcpp::Duration | control_duration, | ||
rclcpp::Duration | control_offset, | ||
rclcpp::Duration | control_span, | ||
rclcpp::Duration | control_period, | ||
DayOfTheWeekSet | week_day_set = { 0, 1, 2, 3, 4, 5, 6 } |
||
) |
Constructor.
schedule_start | Overall schedule start in UTC |
schedule_end | Overall schedule end in UTC |
control_start | Duration from start of day |
control_duration | Duration from start of control_start |
control_offset | Duration from start of day (specifies start time for repeat parameters - span, period) |
control_span | Duration of active status. Starts from offset |
control_period | Interval between active status within control_duration since control_start |
week_day_set | Set of days of the week which this schedule applies to. Defaults as all days of the week |
Definition at line 26 of file GeofenceSchedule.cpp.
std::pair< bool, rclcpp::Time > carma_wm_ctrl::GeofenceSchedule::getNextInterval | ( | const rclcpp::Time & | time | ) | const |
Returns the start time of the next active interval defined by this schedule.
time | UTC time to compare |
TODO the UTC offset is provided in the geofence spec but for now we will ignore and assume all times are UTC
Definition at line 46 of file GeofenceSchedule.cpp.
References control_duration_, control_offset_, control_period_, control_span_, control_start_, schedule_end_, scheduleExpired(), and week_day_set_.
bool carma_wm_ctrl::GeofenceSchedule::scheduleExpired | ( | const rclcpp::Time & | time | ) | const |
Returns true if the schedule has expired by the provided time.
time | UTC time to compare |
Definition at line 34 of file GeofenceSchedule.cpp.
References schedule_end_.
Referenced by getNextInterval().
bool carma_wm_ctrl::GeofenceSchedule::scheduleStarted | ( | const rclcpp::Time & | time | ) | const |
Returns true if the schedule has started by the provided time.
time | UTC time to compare |
Definition at line 39 of file GeofenceSchedule.cpp.
References schedule_start_.
rclcpp::Duration carma_wm_ctrl::GeofenceSchedule::control_duration_ {0, 0} |
Definition at line 33 of file GeofenceSchedule.hpp.
Referenced by getNextInterval().
rclcpp::Duration carma_wm_ctrl::GeofenceSchedule::control_offset_ {0, 0} |
Definition at line 34 of file GeofenceSchedule.hpp.
Referenced by getNextInterval().
rclcpp::Duration carma_wm_ctrl::GeofenceSchedule::control_period_ {0, 0} |
Definition at line 36 of file GeofenceSchedule.hpp.
Referenced by getNextInterval().
rclcpp::Duration carma_wm_ctrl::GeofenceSchedule::control_span_ {0, 0} |
Definition at line 35 of file GeofenceSchedule.hpp.
Referenced by getNextInterval().
rclcpp::Duration carma_wm_ctrl::GeofenceSchedule::control_start_ {0, 0} |
Definition at line 32 of file GeofenceSchedule.hpp.
Referenced by getNextInterval().
rclcpp::Time carma_wm_ctrl::GeofenceSchedule::schedule_end_ |
Definition at line 30 of file GeofenceSchedule.hpp.
Referenced by getNextInterval(), and scheduleExpired().
rclcpp::Time carma_wm_ctrl::GeofenceSchedule::schedule_start_ |
Definition at line 29 of file GeofenceSchedule.hpp.
Referenced by scheduleStarted().
DayOfTheWeekSet carma_wm_ctrl::GeofenceSchedule::week_day_set_ |
Definition at line 41 of file GeofenceSchedule.hpp.
Referenced by getNextInterval().