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.
|
The class containing the primary business logic for the BSM Generator Package. More...
#include <bsm_generator_worker.hpp>
Public Member Functions | |
BSMGeneratorWorker () | |
Default Constructor for BSMGeneratorWorker. More... | |
uint8_t | getNextMsgCount () |
Function to increment the BSM message counter and obtain the new counter value. Counter restarts at 0 once it reaches a value of 128. More... | |
std::vector< uint8_t > | getMsgId (const rclcpp::Time now, double secs) |
Function to obtain the current BSM message ID. The ID is updated to a new random BSM message ID every 5 minutes. More... | |
uint16_t | getSecMark (const rclcpp::Time now) |
Function to obtain the 'milliseconds' mark of the provided time within the last minute. More... | |
float | getSpeedInRange (const double speed) |
Function to apply minimum and maximum limits to a speed value. Minimum limit is 0.0, and maximum limit is 163.8. More... | |
float | getSteerWheelAngleInRange (const double angle) |
Function to apply minimum and maximum limits to a steering wheel angle value. Minimum limit is -189.0, maximum limit is 189.0. More... | |
float | getLongAccelInRange (const float accel) |
Function to apply minimum and maximum limits to a longitudinal acceleration value. Minimum limit is -20.0, maximum limit is 20.0. More... | |
float | getYawRateInRange (const double yaw_rate) |
Function to apply minimum and maximum limits to a yaw rate value. Minimum limit is -327.67, maximum limit is 327.67. More... | |
uint8_t | getBrakeAppliedStatus (const double brake) |
Function to convert the current applied brake status to a value used within the BSM message. More... | |
float | getHeadingInRange (const float heading) |
Function to apply minimum and maximum limits to a vehicle heading value. Minimum limit is 0.0, maximum limit is 359.9875. More... | |
Private Attributes | |
std::default_random_engine | generator_ |
uint8_t | msg_count_ {0} |
int | random_id_ {0} |
rclcpp::Time | last_id_generation_time_ |
bool | first_msg_id_ = true |
The class containing the primary business logic for the BSM Generator Package.
Definition at line 32 of file bsm_generator_worker.hpp.
bsm_generator::BSMGeneratorWorker::BSMGeneratorWorker | ( | ) |
Default Constructor for BSMGeneratorWorker.
Definition at line 23 of file bsm_generator_worker.cpp.
uint8_t bsm_generator::BSMGeneratorWorker::getBrakeAppliedStatus | ( | const double | brake | ) |
Function to convert the current applied brake status to a value used within the BSM message.
brake | The current applied brake status |
Definition at line 91 of file bsm_generator_worker.cpp.
float bsm_generator::BSMGeneratorWorker::getHeadingInRange | ( | const float | heading | ) |
Function to apply minimum and maximum limits to a vehicle heading value. Minimum limit is 0.0, maximum limit is 359.9875.
heading | The current vehicle heading value |
Definition at line 96 of file bsm_generator_worker.cpp.
float bsm_generator::BSMGeneratorWorker::getLongAccelInRange | ( | const float | accel | ) |
Function to apply minimum and maximum limits to a longitudinal acceleration value. Minimum limit is -20.0, maximum limit is 20.0.
accel | The current longitudinal acceleration value |
Definition at line 81 of file bsm_generator_worker.cpp.
std::vector< uint8_t > bsm_generator::BSMGeneratorWorker::getMsgId | ( | const rclcpp::Time | now, |
double | secs | ||
) |
Function to obtain the current BSM message ID. The ID is updated to a new random BSM message ID every 5 minutes.
now | The current time |
secs | Id change period in sec |
Definition at line 36 of file bsm_generator_worker.cpp.
References first_msg_id_, generator_, process_bag::i, last_id_generation_time_, and random_id_.
uint8_t bsm_generator::BSMGeneratorWorker::getNextMsgCount | ( | ) |
Function to increment the BSM message counter and obtain the new counter value. Counter restarts at 0 once it reaches a value of 128.
Definition at line 25 of file bsm_generator_worker.cpp.
References msg_count_.
uint16_t bsm_generator::BSMGeneratorWorker::getSecMark | ( | const rclcpp::Time | now | ) |
Function to obtain the 'milliseconds' mark of the provided time within the last minute.
now | The current time |
Definition at line 66 of file bsm_generator_worker.cpp.
float bsm_generator::BSMGeneratorWorker::getSpeedInRange | ( | const double | speed | ) |
Function to apply minimum and maximum limits to a speed value. Minimum limit is 0.0, and maximum limit is 163.8.
speed | The current vehicle speed |
Definition at line 71 of file bsm_generator_worker.cpp.
float bsm_generator::BSMGeneratorWorker::getSteerWheelAngleInRange | ( | const double | angle | ) |
Function to apply minimum and maximum limits to a steering wheel angle value. Minimum limit is -189.0, maximum limit is 189.0.
angle | The current steering wheel angle |
Definition at line 76 of file bsm_generator_worker.cpp.
float bsm_generator::BSMGeneratorWorker::getYawRateInRange | ( | const double | yaw_rate | ) |
Function to apply minimum and maximum limits to a yaw rate value. Minimum limit is -327.67, maximum limit is 327.67.
yaw_rate | The current yaw rate value |
Definition at line 86 of file bsm_generator_worker.cpp.
|
private |
Definition at line 126 of file bsm_generator_worker.hpp.
Referenced by getMsgId().
|
private |
Definition at line 113 of file bsm_generator_worker.hpp.
Referenced by getMsgId().
|
private |
Definition at line 122 of file bsm_generator_worker.hpp.
Referenced by getMsgId().
|
private |
Definition at line 116 of file bsm_generator_worker.hpp.
Referenced by getNextMsgCount().
|
private |
Definition at line 119 of file bsm_generator_worker.hpp.
Referenced by getMsgId().