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 responsible for publishing MobilityPath messages based on the latest trajectory plan. More...
#include <mobilitypath_publisher.hpp>
Public Member Functions | |
MobilityPathPublication (const rclcpp::NodeOptions &) | |
MobilityPathPublication constructor. More... | |
rcl_interfaces::msg::SetParametersResult | parameter_update_callback (const std::vector< rclcpp::Parameter > ¶meters) |
Function callback for dynamic parameter updates. More... | |
carma_v2x_msgs::msg::MobilityPath | mobility_path_message_generator (const carma_planning_msgs::msg::TrajectoryPlan &trajectory_plan) |
Generates a MobilityPath message from a TrajectoryPlan. More... | |
void | georeference_cb (const std_msgs::msg::String::UniquePtr msg) |
Callback for map projection string to define lat/lon -> map conversion. More... | |
carma_ros2_utils::CallbackReturn | handle_on_configure (const rclcpp_lifecycle::State &) |
carma_ros2_utils::CallbackReturn | handle_on_activate (const rclcpp_lifecycle::State &) |
Private Member Functions | |
bool | spin_callback () |
Spin callback, which will be called frequently based on the configured spin rate. More... | |
void | trajectory_cb (const carma_planning_msgs::msg::TrajectoryPlan::UniquePtr msg) |
Callback for the trajectory plan subscriber, which stores the latest trajectory plan locally and stores its corresponding MobilityPath locally. More... | |
void | bsm_cb (const carma_v2x_msgs::msg::BSM::UniquePtr msg) |
Callback for the BSM subscriber, which stores the BSM's BSMCoreData locally. More... | |
void | guidance_state_cb (const carma_planning_msgs::msg::GuidanceState::UniquePtr msg) |
Callback for the Guidance State. More... | |
carma_v2x_msgs::msg::MobilityHeader | compose_mobility_header (uint64_t time) |
Generates a MobilityHeader to be used for a published MobilityPath message. More... | |
carma_v2x_msgs::msg::Trajectory | trajectory_plan_to_trajectory (const std::vector< carma_planning_msgs::msg::TrajectoryPlanPoint > &traj_points) const |
Converts a Trajectory Plan to a (Mobility) Trajectory. More... | |
carma_v2x_msgs::msg::LocationECEF | trajectory_point_to_ECEF (const carma_planning_msgs::msg::TrajectoryPlanPoint &traj_point) const |
Converts Trajectory Plan Point to ECEF (accepts meters and outputs in cm) More... | |
Private Attributes | |
carma_ros2_utils::SubPtr< carma_planning_msgs::msg::TrajectoryPlan > | traj_sub_ |
carma_ros2_utils::SubPtr< carma_v2x_msgs::msg::BSM > | bsm_sub_ |
carma_ros2_utils::SubPtr< std_msgs::msg::String > | georeference_sub_ |
carma_ros2_utils::SubPtr< carma_planning_msgs::msg::GuidanceState > | guidance_state_sub_ |
bool | guidance_engaged_ = false |
carma_ros2_utils::PubPtr< carma_v2x_msgs::msg::MobilityPath > | path_pub_ |
rclcpp::TimerBase::SharedPtr | path_pub_timer_ |
Config | config_ |
carma_planning_msgs::msg::TrajectoryPlan | latest_trajectory_ |
carma_v2x_msgs::msg::MobilityPath | latest_mobility_path_ |
carma_v2x_msgs::msg::BSMCoreData | bsm_core_ |
std::string | georeference_ {""} |
std::shared_ptr< lanelet::projection::LocalFrameProjector > | map_projector_ |
std::string | recipient_id = "" |
std::string | sender_bsm_id = "FFFF" |
The class responsible for publishing MobilityPath messages based on the latest trajectory plan.
Definition at line 44 of file mobilitypath_publisher.hpp.
|
explicit |
MobilityPathPublication constructor.
Definition at line 22 of file mobilitypath_publisher.cpp.
References config_, mobilitypath_publisher::Config::path_pub_rate, and mobilitypath_publisher::Config::vehicle_id.
|
private |
Callback for the BSM subscriber, which stores the BSM's BSMCoreData locally.
msg | Latest BSM message |
Definition at line 122 of file mobilitypath_publisher.cpp.
References bsm_core_.
Referenced by handle_on_configure().
|
private |
Generates a MobilityHeader to be used for a published MobilityPath message.
time | Time in milliseconds |
Definition at line 145 of file mobilitypath_publisher.cpp.
References bsm_core_, config_, recipient_id, carma_cooperative_perception::to_string(), and mobilitypath_publisher::Config::vehicle_id.
Referenced by mobility_path_message_generator().
void mobilitypath_publisher::MobilityPathPublication::georeference_cb | ( | const std_msgs::msg::String::UniquePtr | msg | ) |
Callback for map projection string to define lat/lon -> map conversion.
msg The proj string defining the projection.
Definition at line 106 of file mobilitypath_publisher.cpp.
References georeference_, and map_projector_.
Referenced by handle_on_configure().
|
private |
Callback for the Guidance State.
msg | Latest GuidanceState message |
Definition at line 80 of file mobilitypath_publisher.cpp.
References lightbar_manager::ENGAGED, and guidance_engaged_.
Referenced by handle_on_configure().
carma_ros2_utils::CallbackReturn mobilitypath_publisher::MobilityPathPublication::handle_on_activate | ( | const rclcpp_lifecycle::State & | prev_state | ) |
Definition at line 85 of file mobilitypath_publisher.cpp.
References config_, mobilitypath_publisher::Config::path_pub_rate, path_pub_timer_, and spin_callback().
carma_ros2_utils::CallbackReturn mobilitypath_publisher::MobilityPathPublication::handle_on_configure | ( | const rclcpp_lifecycle::State & | ) |
Definition at line 45 of file mobilitypath_publisher.cpp.
References bsm_cb(), bsm_sub_, config_, georeference_cb(), georeference_sub_, guidance_state_cb(), guidance_state_sub_, parameter_update_callback(), path_pub_, mobilitypath_publisher::Config::path_pub_rate, traj_sub_, trajectory_cb(), and mobilitypath_publisher::Config::vehicle_id.
carma_v2x_msgs::msg::MobilityPath mobilitypath_publisher::MobilityPathPublication::mobility_path_message_generator | ( | const carma_planning_msgs::msg::TrajectoryPlan & | trajectory_plan | ) |
Generates a MobilityPath message from a TrajectoryPlan.
trajectory_plan | A TrajectoryPlan |
Definition at line 127 of file mobilitypath_publisher.cpp.
References compose_mobility_header(), map_projector_, and trajectory_plan_to_trajectory().
Referenced by trajectory_cb().
rcl_interfaces::msg::SetParametersResult mobilitypath_publisher::MobilityPathPublication::parameter_update_callback | ( | const std::vector< rclcpp::Parameter > & | parameters | ) |
Function callback for dynamic parameter updates.
Definition at line 33 of file mobilitypath_publisher.cpp.
References config_, mobilitypath_publisher::Config::path_pub_rate, and mobilitypath_publisher::Config::vehicle_id.
Referenced by handle_on_configure().
|
private |
Spin callback, which will be called frequently based on the configured spin rate.
Definition at line 96 of file mobilitypath_publisher.cpp.
References guidance_engaged_, latest_mobility_path_, and path_pub_.
Referenced by handle_on_activate().
|
private |
Callback for the trajectory plan subscriber, which stores the latest trajectory plan locally and stores its corresponding MobilityPath locally.
msg | Latest trajectory plan message |
Definition at line 116 of file mobilitypath_publisher.cpp.
References latest_mobility_path_, latest_trajectory_, and mobility_path_message_generator().
Referenced by handle_on_configure().
|
private |
Converts a Trajectory Plan to a (Mobility) Trajectory.
traj_points | The TrajectoryPlan to be converted into a (Mobility) Trajectory |
Definition at line 159 of file mobilitypath_publisher.cpp.
References process_bag::i, and trajectory_point_to_ECEF().
Referenced by mobility_path_message_generator().
|
private |
Converts Trajectory Plan Point to ECEF (accepts meters and outputs in cm)
traj_points | The Trajectory Plan Point to be converted to ECEF |
Definition at line 193 of file mobilitypath_publisher.cpp.
References map_projector_.
Referenced by trajectory_plan_to_trajectory().
|
private |
Definition at line 72 of file mobilitypath_publisher.hpp.
Referenced by bsm_cb(), and compose_mobility_header().
|
private |
Definition at line 50 of file mobilitypath_publisher.hpp.
Referenced by handle_on_configure().
|
private |
Definition at line 63 of file mobilitypath_publisher.hpp.
Referenced by MobilityPathPublication(), compose_mobility_header(), handle_on_activate(), handle_on_configure(), and parameter_update_callback().
|
private |
Definition at line 75 of file mobilitypath_publisher.hpp.
Referenced by georeference_cb().
|
private |
Definition at line 51 of file mobilitypath_publisher.hpp.
Referenced by handle_on_configure().
|
private |
Definition at line 54 of file mobilitypath_publisher.hpp.
Referenced by guidance_state_cb(), and spin_callback().
|
private |
Definition at line 52 of file mobilitypath_publisher.hpp.
Referenced by handle_on_configure().
|
private |
Definition at line 69 of file mobilitypath_publisher.hpp.
Referenced by spin_callback(), and trajectory_cb().
|
private |
Definition at line 66 of file mobilitypath_publisher.hpp.
Referenced by trajectory_cb().
|
private |
Definition at line 76 of file mobilitypath_publisher.hpp.
Referenced by georeference_cb(), mobility_path_message_generator(), and trajectory_point_to_ECEF().
|
private |
Definition at line 57 of file mobilitypath_publisher.hpp.
Referenced by handle_on_configure(), and spin_callback().
|
private |
Definition at line 60 of file mobilitypath_publisher.hpp.
Referenced by handle_on_activate().
|
private |
Definition at line 79 of file mobilitypath_publisher.hpp.
Referenced by compose_mobility_header().
|
private |
Definition at line 82 of file mobilitypath_publisher.hpp.
|
private |
Definition at line 49 of file mobilitypath_publisher.hpp.
Referenced by handle_on_configure().