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 |
carma_planning_msgs::msg::GuidanceState::_state_type | previous_guidance_state_ |
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 71 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 84 of file arbitrator.hpp.
void arbitrator::Arbitrator::bumper_pose_cb | ( | ) |
Callback for the front bumper pose transform.
Definition at line 187 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, previous_guidance_state_, 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 121 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 228 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 176 of file arbitrator.cpp.
Referenced by run().
|
protected |
Function to be called when the Arbitrator begins planning.
Definition at line 136 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 181 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 223 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 171 of file arbitrator.cpp.
References arbitrator::PLANNING_TIMER_TRIGGER, and sm_.
Referenced by run().
|
private |
Definition at line 179 of file arbitrator.hpp.
Referenced by bumper_pose_cb().
|
private |
Definition at line 169 of file arbitrator.hpp.
|
private |
Definition at line 163 of file arbitrator.hpp.
Referenced by initial_state(), and planning_state().
|
private |
Definition at line 164 of file arbitrator.hpp.
Referenced by initial_state().
|
private |
Definition at line 171 of file arbitrator.hpp.
Referenced by initial_state().
|
private |
Definition at line 166 of file arbitrator.hpp.
Referenced by planning_state().
|
private |
Definition at line 168 of file arbitrator.hpp.
Referenced by planning_state().
|
private |
Definition at line 165 of file arbitrator.hpp.
Referenced by bumper_pose_cb(), guidance_state_cb(), initial_state(), planning_state(), run(), and shutdown_state().
|
private |
Definition at line 180 of file arbitrator.hpp.
Referenced by run().
|
private |
Definition at line 170 of file arbitrator.hpp.
Referenced by planning_state().
|
private |
Definition at line 181 of file arbitrator.hpp.
Referenced by guidance_state_cb().
|
private |
Definition at line 162 of file arbitrator.hpp.
Referenced by guidance_state_cb(), planning_state(), run(), and waiting_state().
|
private |
Definition at line 176 of file arbitrator.hpp.
Referenced by bumper_pose_cb(), and initializeBumperTransformLookup().
|
private |
Definition at line 177 of file arbitrator.hpp.
Referenced by initializeBumperTransformLookup().
|
private |
Definition at line 174 of file arbitrator.hpp.
Referenced by bumper_pose_cb().
|
private |
Definition at line 167 of file arbitrator.hpp.
Referenced by planning_state().
|
private |
Definition at line 160 of file arbitrator.hpp.
Referenced by bumper_pose_cb(), planning_state(), and twist_cb().
|
private |
Definition at line 172 of file arbitrator.hpp.
Referenced by bumper_pose_cb().