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 <arbitrator.hpp>
Public Member Functions | |
Arbitrator (std::shared_ptr< carma_ros2_utils::CarmaLifecycleNode > nh, std::shared_ptr< ArbitratorStateMachine > sm, std::shared_ptr< CapabilitiesInterface > ci, std::shared_ptr< PlanningStrategy > planning_strategy, rclcpp::Duration min_plan_duration, double planning_period, carma_wm::WorldModelConstPtr wm) | |
Constructor for arbitrator class taking in dependencies via dependency injection. More... | |
void | run () |
Begin the operation of the arbitrator. More... | |
void | twist_cb (geometry_msgs::msg::TwistStamped::UniquePtr msg) |
Callback for the twist subscriber, which will store latest twist locally. More... | |
void | bumper_pose_cb () |
Callback for the front bumper pose transform. More... | |
void | initializeBumperTransformLookup () |
Initialize transform Lookup from front bumper to map. More... | |
Protected Member Functions | |
void | initial_state () |
Function to be executed during the initial state of the Arbitrator. More... | |
void | planning_state () |
Function to be called when the Arbitrator begins planning. More... | |
void | waiting_state () |
Function to be executed when the Arbitrator has finished planning and is awaiting another planning cycle. More... | |
void | paused_state () |
Function to be executed when the Arbitrator is not planning but also not awaiting a new plan cycle. More... | |
void | shutdown_state () |
Function to be executed when the Arbitrator is to clean up and shutdown. More... | |
void | guidance_state_cb (carma_planning_msgs::msg::GuidanceState::UniquePtr msg) |
Callback for receiving Guidance state machine updates. More... | |
Private Attributes | |
VehicleState | vehicle_state_ |
std::shared_ptr< ArbitratorStateMachine > | sm_ |
carma_ros2_utils::PubPtr< carma_planning_msgs::msg::ManeuverPlan > | final_plan_pub_ |
carma_ros2_utils::SubPtr< carma_planning_msgs::msg::GuidanceState > | guidance_state_sub_ |
std::shared_ptr< carma_ros2_utils::CarmaLifecycleNode > | nh_ |
rclcpp::Duration | min_plan_duration_ |
rclcpp::Duration | time_between_plans_ |
rclcpp::Time | next_planning_process_start_ |
std::shared_ptr< CapabilitiesInterface > | capabilities_interface_ |
std::shared_ptr< PlanningStrategy > | planning_strategy_ |
bool | initialized_ |
carma_wm::WorldModelConstPtr | wm_ |
geometry_msgs::msg::TransformStamped | tf_ |
tf2_ros::Buffer | tf2_buffer_ |
std::unique_ptr< tf2_ros::TransformListener > | tf2_listener_ |
tf2::Stamped< tf2::Transform > | bumper_transform_ |
bool | planning_in_progress_ = false |
Primary work class for the Arbitrator package
Governs the interactions of plugins during the maneuver planning phase of the CARMA planning process. Utilizes a generic planning interface to allow for reconfiguration with other paradigms in the future.
Definition at line 44 of file arbitrator.hpp.
|
inline |
Constructor for arbitrator class taking in dependencies via dependency injection.
nh | A CarmaLifecycleNode node pointer |
sm | An ArbitratorStateMachine instance for regulating the states of the Arbitrator |
ci | A CapabilitiesInterface for querying plugins |
planning_strategy | A planning strategy implementation for generating plans |
min_plan_duration | The minimum acceptable length of a plan |
planning_frequency | The frequency at which to generate high-level plans when engaged |
wm | pointer to an inialized world model. |
Definition at line 57 of file arbitrator.hpp.
void arbitrator::Arbitrator::bumper_pose_cb | ( | ) |
Callback for the front bumper pose transform.
Definition at line 170 of file arbitrator.cpp.
References bumper_transform_, arbitrator::VehicleState::downtrack, arbitrator::VehicleState::lane_id, nh_, arbitrator::VehicleState::stamp, tf2_buffer_, tf_, vehicle_state_, wm_, arbitrator::VehicleState::x, and arbitrator::VehicleState::y.
|
protected |
Callback for receiving Guidance state machine updates.
msg | The new GuidanceState message |
Definition at line 67 of file arbitrator.cpp.
References lightbar_manager::ACTIVE, arbitrator::ARBITRATOR_PAUSED, arbitrator::ARBITRATOR_RESUMED, lightbar_manager::ENGAGED, port_drayage_plugin::INACTIVE, arbitrator::INITIAL, nh_, arbitrator::PAUSED, arbitrator::PLANNING, arbitrator::SHUTDOWN, sm_, arbitrator::SYSTEM_SHUTDOWN_INITIATED, arbitrator::SYSTEM_STARTUP_COMPLETE, and arbitrator::WAITING.
Referenced by initial_state().
|
protected |
Function to be executed during the initial state of the Arbitrator.
Definition at line 105 of file arbitrator.cpp.
References final_plan_pub_, guidance_state_cb(), guidance_state_sub_, initialized_, and nh_.
Referenced by run().
void arbitrator::Arbitrator::initializeBumperTransformLookup | ( | ) |
Initialize transform Lookup from front bumper to map.
Definition at line 211 of file arbitrator.cpp.
References tf2_buffer_, and tf2_listener_.
|
protected |
Function to be executed when the Arbitrator is not planning but also not awaiting a new plan cycle.
Definition at line 159 of file arbitrator.cpp.
Referenced by run().
|
protected |
Function to be called when the Arbitrator begins planning.
Definition at line 120 of file arbitrator.cpp.
References final_plan_pub_, arbitrator_utils::get_plan_end_time(), arbitrator_utils::get_plan_start_time(), min_plan_duration_, next_planning_process_start_, nh_, arbitrator::PLANNING_COMPLETE, planning_strategy_, sm_, time_between_plans_, and vehicle_state_.
Referenced by run().
void arbitrator::Arbitrator::run | ( | ) |
Begin the operation of the arbitrator.
Loops internally via rclcpp::Duration sleeps and spins
Definition at line 27 of file arbitrator.cpp.
References arbitrator::INITIAL, initial_state(), nh_, arbitrator::PAUSED, paused_state(), arbitrator::PLANNING, planning_in_progress_, planning_state(), arbitrator::SHUTDOWN, sm_, arbitrator::WAITING, and waiting_state().
|
protected |
Function to be executed when the Arbitrator is to clean up and shutdown.
Definition at line 164 of file arbitrator.cpp.
References nh_.
void arbitrator::Arbitrator::twist_cb | ( | geometry_msgs::msg::TwistStamped::UniquePtr | msg | ) |
Callback for the twist subscriber, which will store latest twist locally.
msg | Latest twist message |
Definition at line 206 of file arbitrator.cpp.
References vehicle_state_, and arbitrator::VehicleState::velocity.
Referenced by arbitrator::ArbitratorNode::handle_on_configure().
|
protected |
Function to be executed when the Arbitrator has finished planning and is awaiting another planning cycle.
Definition at line 153 of file arbitrator.cpp.
References nh_, arbitrator::PLANNING_TIMER_TRIGGER, and sm_.
Referenced by run().
|
private |
Definition at line 152 of file arbitrator.hpp.
Referenced by bumper_pose_cb().
|
private |
Definition at line 142 of file arbitrator.hpp.
|
private |
Definition at line 136 of file arbitrator.hpp.
Referenced by initial_state(), and planning_state().
|
private |
Definition at line 137 of file arbitrator.hpp.
Referenced by initial_state().
|
private |
Definition at line 144 of file arbitrator.hpp.
Referenced by initial_state().
|
private |
Definition at line 139 of file arbitrator.hpp.
Referenced by planning_state().
|
private |
Definition at line 141 of file arbitrator.hpp.
Referenced by planning_state().
|
private |
Definition at line 138 of file arbitrator.hpp.
Referenced by bumper_pose_cb(), guidance_state_cb(), initial_state(), planning_state(), run(), shutdown_state(), and waiting_state().
|
private |
Definition at line 153 of file arbitrator.hpp.
Referenced by run().
|
private |
Definition at line 143 of file arbitrator.hpp.
Referenced by planning_state().
|
private |
Definition at line 135 of file arbitrator.hpp.
Referenced by guidance_state_cb(), planning_state(), run(), and waiting_state().
|
private |
Definition at line 149 of file arbitrator.hpp.
Referenced by bumper_pose_cb(), and initializeBumperTransformLookup().
|
private |
Definition at line 150 of file arbitrator.hpp.
Referenced by initializeBumperTransformLookup().
|
private |
Definition at line 147 of file arbitrator.hpp.
Referenced by bumper_pose_cb().
|
private |
Definition at line 140 of file arbitrator.hpp.
Referenced by planning_state().
|
private |
Definition at line 133 of file arbitrator.hpp.
Referenced by bumper_pose_cb(), planning_state(), and twist_cb().
|
private |
Definition at line 145 of file arbitrator.hpp.
Referenced by bumper_pose_cb().