17#ifndef __ARBITRATOR_INCLUDE_ARBITRATOR_HPP__ 
   18#define __ARBITRATOR_INCLUDE_ARBITRATOR_HPP__ 
   20#include <rclcpp/rclcpp.hpp> 
   21#include <carma_ros2_utils/carma_lifecycle_node.hpp> 
   22#include <carma_planning_msgs/msg/guidance_state.hpp> 
   24#include <geometry_msgs/msg/pose_stamped.hpp> 
   25#include <geometry_msgs/msg/twist_stamped.hpp> 
   26#include <tf2_ros/transform_listener.h> 
   27#include <tf2_ros/buffer.h> 
   28#include <tf2/LinearMath/Transform.h> 
   29#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp> 
   30#include <boost/uuid/uuid.hpp> 
   31#include <boost/uuid/uuid_io.hpp> 
   32#include <boost/uuid/uuid_generators.hpp> 
   47            case carma_planning_msgs::msg::GuidanceState::STARTUP:
 
   49            case carma_planning_msgs::msg::GuidanceState::DRIVERS_READY:
 
   50                return "DRIVERS_READY";
 
   84            Arbitrator(std::shared_ptr<carma_ros2_utils::CarmaLifecycleNode> nh,
 
   85                std::shared_ptr<ArbitratorStateMachine> sm,
 
   86                std::shared_ptr<CapabilitiesInterface> ci,
 
   87                std::shared_ptr<PlanningStrategy> planning_strategy,
 
   88                rclcpp::Duration min_plan_duration,
 
   89                double planning_period,
 
  112            void twist_cb(geometry_msgs::msg::TwistStamped::UniquePtr msg);
 
  162            std::shared_ptr<ArbitratorStateMachine> 
sm_;
 
  165            std::shared_ptr<carma_ros2_utils::CarmaLifecycleNode> 
nh_;
 
  174            geometry_msgs::msg::TransformStamped 
tf_;
 
  182                carma_planning_msgs::msg::GuidanceState::STARTUP;  
 
void planning_state()
Function to be called when the Arbitrator begins planning.
bool planning_in_progress_
tf2::Stamped< tf2::Transform > bumper_transform_
rclcpp::Time next_planning_process_start_
carma_planning_msgs::msg::GuidanceState::_state_type previous_guidance_state_
void shutdown_state()
Function to be executed when the Arbitrator is to clean up and shutdown.
void paused_state()
Function to be executed when the Arbitrator is not planning but also not awaiting a new plan cycle.
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.
void initial_state()
Function to be executed during the initial state of the Arbitrator.
rclcpp::Duration min_plan_duration_
carma_ros2_utils::PubPtr< carma_planning_msgs::msg::ManeuverPlan > final_plan_pub_
std::shared_ptr< carma_ros2_utils::CarmaLifecycleNode > nh_
void twist_cb(geometry_msgs::msg::TwistStamped::UniquePtr msg)
Callback for the twist subscriber, which will store latest twist locally.
tf2_ros::Buffer tf2_buffer_
carma_ros2_utils::SubPtr< carma_planning_msgs::msg::GuidanceState > guidance_state_sub_
void waiting_state()
Function to be executed when the Arbitrator has finished planning and is awaiting another planning cy...
carma_wm::WorldModelConstPtr wm_
rclcpp::Duration time_between_plans_
std::shared_ptr< PlanningStrategy > planning_strategy_
void initializeBumperTransformLookup()
Initialize transform Lookup from front bumper to map.
std::unique_ptr< tf2_ros::TransformListener > tf2_listener_
void run()
Begin the operation of the arbitrator.
std::shared_ptr< CapabilitiesInterface > capabilities_interface_
VehicleState vehicle_state_
geometry_msgs::msg::TransformStamped tf_
void bumper_pose_cb()
Callback for the front bumper pose transform.
void guidance_state_cb(carma_planning_msgs::msg::GuidanceState::UniquePtr msg)
Callback for receiving Guidance state machine updates.
std::shared_ptr< ArbitratorStateMachine > sm_
std::string guidance_state_to_string(uint8_t state)
Convert guidance state enum to string representation.
std::shared_ptr< const WorldModel > WorldModelConstPtr
Struct defining the vehicle state required for maneuver planning.