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.
|
Worker class for the Guidance node. More...
#include <guidance_worker.hpp>
Public Member Functions | |
GuidanceWorker (const rclcpp::NodeOptions &) | |
GuidanceWorker constructor. More... | |
rcl_interfaces::msg::SetParametersResult | parameter_update_callback (const std::vector< rclcpp::Parameter > ¶meters) |
Callback for dynamic parameter updates. More... | |
bool | spin_cb () |
Timer callback. More... | |
void | route_event_cb (carma_planning_msgs::msg::RouteEvent::UniquePtr msg) |
Callback for route event messages. More... | |
void | robot_status_cb (carma_driver_msgs::msg::RobotEnabled::UniquePtr msg) |
Callback for robot enabled messages. More... | |
void | vehicle_status_cb (const autoware_msgs::msg::VehicleStatus::UniquePtr msg) |
Callback for vehicle status messages. More... | |
bool | guidance_activation_cb (const std::shared_ptr< rmw_request_id_t >, const std::shared_ptr< carma_planning_msgs::srv::SetGuidanceActive::Request > req, std::shared_ptr< carma_planning_msgs::srv::SetGuidanceActive::Response > resp) |
Set_guidance_active service callback. User can attempt to activate the guidance system by calling this service. More... | |
carma_ros2_utils::CallbackReturn | handle_on_configure (const rclcpp_lifecycle::State &prev_state) |
carma_ros2_utils::CallbackReturn | handle_on_activate (const rclcpp_lifecycle::State &) |
carma_ros2_utils::CallbackReturn | handle_on_shutdown (const rclcpp_lifecycle::State &prev_state) |
Private Attributes | |
carma_ros2_utils::SubPtr< carma_driver_msgs::msg::RobotEnabled > | robot_status_subscriber_ |
carma_ros2_utils::SubPtr< carma_planning_msgs::msg::RouteEvent > | route_event_subscriber_ |
carma_ros2_utils::SubPtr< autoware_msgs::msg::VehicleStatus > | vehicle_status_subscriber_ |
carma_ros2_utils::PubPtr< carma_planning_msgs::msg::GuidanceState > | state_publisher_ |
carma_ros2_utils::ClientPtr< carma_driver_msgs::srv::SetEnableRobotic > | enable_client_ |
carma_ros2_utils::ServicePtr< carma_planning_msgs::srv::SetGuidanceActive > | guidance_activate_service_server_ |
rclcpp::TimerBase::SharedPtr | spin_timer_ |
Config | config_ |
GuidanceStateMachine | gsm_ |
Worker class for the Guidance node.
Definition at line 39 of file guidance_worker.hpp.
|
explicit |
GuidanceWorker constructor.
Definition at line 22 of file guidance_worker.cpp.
References config_, and guidance::Config::spin_rate_hz.
bool guidance::GuidanceWorker::guidance_activation_cb | ( | const std::shared_ptr< rmw_request_id_t > | , |
const std::shared_ptr< carma_planning_msgs::srv::SetGuidanceActive::Request > | req, | ||
std::shared_ptr< carma_planning_msgs::srv::SetGuidanceActive::Response > | resp | ||
) |
Set_guidance_active service callback. User can attempt to activate the guidance system by calling this service.
req | A carma_planning_msgs::srv::SetGuidanceActive::Request msg |
resp | A carma_planning_msgs::srv::SetGuidanceActive::Response msg |
Definition at line 102 of file guidance_worker.cpp.
References guidance::GuidanceStateMachine::ACTIVE, enable_client_, guidance::GuidanceStateMachine::getCurrentState(), gsm_, and guidance::GuidanceStateMachine::onSetGuidanceActive().
Referenced by handle_on_configure().
carma_ros2_utils::CallbackReturn guidance::GuidanceWorker::handle_on_activate | ( | const rclcpp_lifecycle::State & | prev_state | ) |
Definition at line 81 of file guidance_worker.cpp.
References config_, gsm_, guidance::GuidanceStateMachine::onGuidanceInitialized(), spin_cb(), guidance::Config::spin_rate_hz, and spin_timer_.
carma_ros2_utils::CallbackReturn guidance::GuidanceWorker::handle_on_configure | ( | const rclcpp_lifecycle::State & | prev_state | ) |
Definition at line 44 of file guidance_worker.cpp.
References config_, enable_client_, guidance_activate_service_server_, guidance_activation_cb(), parameter_update_callback(), robot_status_cb(), robot_status_subscriber_, route_event_cb(), route_event_subscriber_, guidance::Config::spin_rate_hz, state_publisher_, vehicle_status_cb(), and vehicle_status_subscriber_.
carma_ros2_utils::CallbackReturn guidance::GuidanceWorker::handle_on_shutdown | ( | const rclcpp_lifecycle::State & | prev_state | ) |
Definition at line 96 of file guidance_worker.cpp.
References gsm_, and guidance::GuidanceStateMachine::onGuidanceShutdown().
rcl_interfaces::msg::SetParametersResult guidance::GuidanceWorker::parameter_update_callback | ( | const std::vector< rclcpp::Parameter > & | parameters | ) |
Callback for dynamic parameter updates.
Definition at line 33 of file guidance_worker.cpp.
References config_, and guidance::Config::spin_rate_hz.
Referenced by handle_on_configure().
void guidance::GuidanceWorker::robot_status_cb | ( | carma_driver_msgs::msg::RobotEnabled::UniquePtr | msg | ) |
Callback for robot enabled messages.
msg | Latest robot enabled message |
Definition at line 138 of file guidance_worker.cpp.
References gsm_, and guidance::GuidanceStateMachine::onRoboticStatus().
Referenced by handle_on_configure().
void guidance::GuidanceWorker::route_event_cb | ( | carma_planning_msgs::msg::RouteEvent::UniquePtr | msg | ) |
Callback for route event messages.
msg | Latest route event message |
Definition at line 133 of file guidance_worker.cpp.
References gsm_, and guidance::GuidanceStateMachine::onRouteEvent().
Referenced by handle_on_configure().
bool guidance::GuidanceWorker::spin_cb | ( | ) |
Timer callback.
Definition at line 119 of file guidance_worker.cpp.
References enable_client_, guidance::GuidanceStateMachine::getCurrentState(), gsm_, guidance::GuidanceStateMachine::shouldCallSetEnableRobotic(), and state_publisher_.
Referenced by handle_on_activate().
void guidance::GuidanceWorker::vehicle_status_cb | ( | const autoware_msgs::msg::VehicleStatus::UniquePtr | msg | ) |
Callback for vehicle status messages.
msg | Latest vehicle status message |
Definition at line 143 of file guidance_worker.cpp.
References gsm_, and guidance::GuidanceStateMachine::onVehicleStatus().
Referenced by handle_on_configure().
|
private |
Definition at line 61 of file guidance_worker.hpp.
Referenced by GuidanceWorker(), handle_on_activate(), handle_on_configure(), and parameter_update_callback().
|
private |
Definition at line 52 of file guidance_worker.hpp.
Referenced by guidance_activation_cb(), handle_on_configure(), and spin_cb().
|
private |
Definition at line 64 of file guidance_worker.hpp.
Referenced by guidance_activation_cb(), handle_on_activate(), handle_on_shutdown(), robot_status_cb(), route_event_cb(), spin_cb(), and vehicle_status_cb().
|
private |
Definition at line 55 of file guidance_worker.hpp.
Referenced by handle_on_configure().
|
private |
Definition at line 44 of file guidance_worker.hpp.
Referenced by handle_on_configure().
|
private |
Definition at line 45 of file guidance_worker.hpp.
Referenced by handle_on_configure().
|
private |
Definition at line 58 of file guidance_worker.hpp.
Referenced by handle_on_activate().
|
private |
Definition at line 49 of file guidance_worker.hpp.
Referenced by handle_on_configure(), and spin_cb().
|
private |
Definition at line 46 of file guidance_worker.hpp.
Referenced by handle_on_configure().