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.
|
TODO for USER: Add class description. More...
#include <carma_cloud_client_node.hpp>
Public Member Functions | |
CarmaCloudClient (const rclcpp::NodeOptions &) | |
Node constructor. More... | |
rcl_interfaces::msg::SetParametersResult | parameter_update_callback (const std::vector< rclcpp::Parameter > ¶meters) |
callback for dynamic parameter updates More... | |
void | tcr_callback (carma_v2x_msgs::msg::TrafficControlRequest::UniquePtr msg) |
TCR subscription callback. More... | |
void | XMLconversion (char *xml_str, carma_v2x_msgs::msg::TrafficControlRequest request_msg) |
Funtion to Convert the TCR into XML format. More... | |
int | CloudSend (const std::string &local_msg, const std::string &local_url, const std::string &local_base, const std::string &local_method) |
Send http request to carma cloud. More... | |
void | CloudSendAsync (const std::string &local_msg, const std::string &local_url, const std::string &local_base, const std::string &local_method) |
Send async http request to carma cloud. More... | |
void | TCMHandler (QHttpEngine::Socket *socket) |
Handles the TCM received from CARMA Cloud. More... | |
int | StartWebService () |
Starts web service. More... | |
j2735_v2x_msgs::msg::TrafficControlMessage | parseTCMXML (boost::property_tree::ptree &tree) |
Parse xml package of tcm msg using boost property tree xml parser. More... | |
unsigned char | parse_hex (char c) |
Convert Hex char to unsigned char. More... | |
j2735_v2x_msgs::msg::TrafficControlPackage | parse_package (boost::property_tree::ptree &tree) |
Parse xml package subtree of tcm msg. More... | |
j2735_v2x_msgs::msg::TrafficControlParams | parse_params (boost::property_tree::ptree &tree) |
Parse xml params subtree of tcm msg. More... | |
j2735_v2x_msgs::msg::TrafficControlGeometry | parse_geometry (boost::property_tree::ptree &tree) |
Parse xml geometry subtree of tcm msg. More... | |
j2735_v2x_msgs::msg::TrafficControlSchedule | parse_schedule (boost::property_tree::ptree &tree) |
Parse xml schedule subtree of tcm msg. More... | |
j2735_v2x_msgs::msg::TrafficControlDetail | parse_detail (boost::property_tree::ptree &tree) |
Parse xml detail subtree of tcm msg. More... | |
QByteArray | UncompressBytes (const QByteArray compressedBytes) const |
Uncompress bytes using zlib library. More... | |
carma_ros2_utils::CallbackReturn | handle_on_configure (const rclcpp_lifecycle::State &prev_state) |
Private Attributes | |
carma_ros2_utils::SubPtr< carma_v2x_msgs::msg::TrafficControlRequest > | tcr_sub_ |
carma_ros2_utils::PubPtr< j2735_v2x_msgs::msg::TrafficControlMessage > | tcm_pub_ |
Config | config_ |
const char * | CONTENT_ENCODING_KEY = "Content-Encoding" |
const char * | CONTENT_ENCODING_VALUE = "gzip" |
TODO for USER: Add class description.
Definition at line 64 of file carma_cloud_client_node.hpp.
|
explicit |
Node constructor.
Definition at line 22 of file carma_cloud_client_node.cpp.
References carma_cloud_client::Config::base_ack, carma_cloud_client::Config::base_req, config_, carma_cloud_client::Config::fetchtime, carma_cloud_client::Config::list, carma_cloud_client::Config::method, carma_cloud_client::Config::port, carma_cloud_client::Config::url, carma_cloud_client::Config::webip, and carma_cloud_client::Config::webport.
int carma_cloud_client::CarmaCloudClient::CloudSend | ( | const std::string & | local_msg, |
const std::string & | local_url, | ||
const std::string & | local_base, | ||
const std::string & | local_method | ||
) |
Send http request to carma cloud.
local_msg | msg to be sent to cloud |
local_url | url to cloud |
local_base | base to be added to url |
local_method | method |
Definition at line 166 of file carma_cloud_client_node.cpp.
References config_, and carma_cloud_client::Config::port.
Referenced by CloudSendAsync(), and tcr_callback().
void carma_cloud_client::CarmaCloudClient::CloudSendAsync | ( | const std::string & | local_msg, |
const std::string & | local_url, | ||
const std::string & | local_base, | ||
const std::string & | local_method | ||
) |
Send async http request to carma cloud.
local_msg | msg to be sent to cloud |
local_url | url to cloud |
local_base | base to be added to url |
local_method | method |
Definition at line 193 of file carma_cloud_client_node.cpp.
References CloudSend().
carma_ros2_utils::CallbackReturn carma_cloud_client::CarmaCloudClient::handle_on_configure | ( | const rclcpp_lifecycle::State & | prev_state | ) |
Definition at line 58 of file carma_cloud_client_node.cpp.
References carma_cloud_client::Config::base_ack, carma_cloud_client::Config::base_req, config_, carma_cloud_client::Config::fetchtime, carma_cloud_client::Config::list, carma_cloud_client::Config::method, parameter_update_callback(), carma_cloud_client::Config::port, StartWebService(), tcm_pub_, tcr_callback(), tcr_sub_, carma_cloud_client::Config::url, carma_cloud_client::Config::webip, and carma_cloud_client::Config::webport.
rcl_interfaces::msg::SetParametersResult carma_cloud_client::CarmaCloudClient::parameter_update_callback | ( | const std::vector< rclcpp::Parameter > & | parameters | ) |
callback for dynamic parameter updates
parameters | list of parameters |
Definition at line 41 of file carma_cloud_client_node.cpp.
References carma_cloud_client::Config::base_ack, carma_cloud_client::Config::base_req, config_, carma_cloud_client::Config::list, carma_cloud_client::Config::method, carma_cloud_client::Config::port, and carma_cloud_client::Config::url.
Referenced by handle_on_configure().
j2735_v2x_msgs::msg::TrafficControlDetail carma_cloud_client::CarmaCloudClient::parse_detail | ( | boost::property_tree::ptree & | tree | ) |
Parse xml detail subtree of tcm msg.
tree | xml detail boost ptree subtree |
Definition at line 496 of file carma_cloud_client_node.cpp.
Referenced by parse_params().
j2735_v2x_msgs::msg::TrafficControlGeometry carma_cloud_client::CarmaCloudClient::parse_geometry | ( | boost::property_tree::ptree & | tree | ) |
Parse xml geometry subtree of tcm msg.
tree | xml geometry boost ptree subtree |
Definition at line 757 of file carma_cloud_client_node.cpp.
Referenced by parseTCMXML().
unsigned char carma_cloud_client::CarmaCloudClient::parse_hex | ( | char | c | ) |
Convert Hex char to unsigned char.
c | char in hex format |
Definition at line 808 of file carma_cloud_client_node.cpp.
References process_traj_logs::c.
Referenced by parseTCMXML().
j2735_v2x_msgs::msg::TrafficControlPackage carma_cloud_client::CarmaCloudClient::parse_package | ( | boost::property_tree::ptree & | tree | ) |
Parse xml package subtree of tcm msg.
tree | xml package boost ptree subtree |
Definition at line 401 of file carma_cloud_client_node.cpp.
Referenced by parseTCMXML().
j2735_v2x_msgs::msg::TrafficControlParams carma_cloud_client::CarmaCloudClient::parse_params | ( | boost::property_tree::ptree & | tree | ) |
Parse xml params subtree of tcm msg.
tree | xml params boost ptree subtree |
Definition at line 661 of file carma_cloud_client_node.cpp.
References parse_detail(), and parse_schedule().
Referenced by parseTCMXML().
j2735_v2x_msgs::msg::TrafficControlSchedule carma_cloud_client::CarmaCloudClient::parse_schedule | ( | boost::property_tree::ptree & | tree | ) |
Parse xml schedule subtree of tcm msg.
tree | xml schedule boost ptree subtree |
Definition at line 422 of file carma_cloud_client_node.cpp.
References process_bag::i.
Referenced by parse_params().
j2735_v2x_msgs::msg::TrafficControlMessage carma_cloud_client::CarmaCloudClient::parseTCMXML | ( | boost::property_tree::ptree & | tree | ) |
Parse xml package of tcm msg using boost property tree xml parser.
tree | xml boost ptree subtree |
Definition at line 298 of file carma_cloud_client_node.cpp.
References process_bag::i, parse_geometry(), parse_hex(), parse_package(), and parse_params().
Referenced by TCMHandler().
int carma_cloud_client::CarmaCloudClient::StartWebService | ( | ) |
Starts web service.
Definition at line 367 of file carma_cloud_client_node.cpp.
References config_, carma_cloud_client::Config::webip, and carma_cloud_client::Config::webport.
Referenced by handle_on_configure().
void carma_cloud_client::CarmaCloudClient::TCMHandler | ( | QHttpEngine::Socket * | socket | ) |
Handles the TCM received from CARMA Cloud.
socket | http socket |
Definition at line 237 of file carma_cloud_client_node.cpp.
References CONTENT_ENCODING_KEY, CONTENT_ENCODING_VALUE, parseTCMXML(), tcm_pub_, and UncompressBytes().
void carma_cloud_client::CarmaCloudClient::tcr_callback | ( | carma_v2x_msgs::msg::TrafficControlRequest::UniquePtr | msg | ) |
TCR subscription callback.
msg | Traffic Control Request pointer |
Definition at line 86 of file carma_cloud_client_node.cpp.
References carma_cloud_client::Config::base_req, CloudSend(), config_, carma_cloud_client::Config::method, carma_cloud_client::Config::url, and XMLconversion().
Referenced by handle_on_configure().
QByteArray carma_cloud_client::CarmaCloudClient::UncompressBytes | ( | const QByteArray | compressedBytes | ) | const |
Uncompress bytes using zlib library.
compressedBytes | compressed bytes |
Definition at line 201 of file carma_cloud_client_node.cpp.
Referenced by TCMHandler().
void carma_cloud_client::CarmaCloudClient::XMLconversion | ( | char * | xml_str, |
carma_v2x_msgs::msg::TrafficControlRequest | request_msg | ||
) |
Funtion to Convert the TCR into XML format.
xml_str | array of characters for xml format |
request_msg | input TCR msg |
Definition at line 99 of file carma_cloud_client_node.cpp.
References config_, motion_computation::conversion::convert(), carma_cloud_client::Config::fetchtime, process_bag::i, carma_cloud_client::Config::list, carma_cloud_client::Config::port, and process_traj_logs::x.
Referenced by tcr_callback().
|
private |
Definition at line 73 of file carma_cloud_client_node.hpp.
Referenced by CarmaCloudClient(), CloudSend(), handle_on_configure(), parameter_update_callback(), StartWebService(), tcr_callback(), and XMLconversion().
|
private |
Definition at line 75 of file carma_cloud_client_node.hpp.
Referenced by TCMHandler().
|
private |
Definition at line 76 of file carma_cloud_client_node.hpp.
Referenced by TCMHandler().
|
private |
Definition at line 70 of file carma_cloud_client_node.hpp.
Referenced by handle_on_configure(), and TCMHandler().
|
private |
Definition at line 69 of file carma_cloud_client_node.hpp.
Referenced by handle_on_configure().