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/LinearMath/Transform.h>
28#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
57 Arbitrator(std::shared_ptr<carma_ros2_utils::CarmaLifecycleNode> nh,
58 std::shared_ptr<ArbitratorStateMachine> sm,
59 std::shared_ptr<CapabilitiesInterface> ci,
60 std::shared_ptr<PlanningStrategy> planning_strategy,
61 rclcpp::Duration min_plan_duration,
62 double planning_period,
85 void twist_cb(geometry_msgs::msg::TwistStamped::UniquePtr msg);
135 std::shared_ptr<ArbitratorStateMachine>
sm_;
138 std::shared_ptr<carma_ros2_utils::CarmaLifecycleNode>
nh_;
147 geometry_msgs::msg::TransformStamped
tf_;
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_
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::shared_ptr< const WorldModel > WorldModelConstPtr
Struct defining the vehicle state required for maneuver planning.