19#include <carma_planning_msgs/msg/trajectory_plan_point.hpp>
20#include <carma_planning_msgs/msg/trajectory_plan.hpp>
21#include <boost/optional.hpp>
25#include <boost/shared_ptr.hpp>
29#include <lanelet2_core/primitives/Lanelet.h>
30#include <lanelet2_core/geometry/LineString.h>
32#include <carma_ros2_utils/carma_lifecycle_node.hpp>
33#include <boost/geometry.hpp>
34#include <geometry_msgs/msg/pose_stamped.hpp>
35#include <geometry_msgs/msg/twist_stamped.hpp>
36#include <carma_planning_msgs/srv/plan_trajectory.hpp>
37#include <carma_planning_msgs/msg/plugin.hpp>
56 StopandWait(std::shared_ptr<carma_ros2_utils::CarmaLifecycleNode> nh,
59 const std::string& plugin_name,
70 bool plan_trajectory_cb(carma_planning_msgs::srv::PlanTrajectory::Request::SharedPtr req, carma_planning_msgs::srv::PlanTrajectory::Response::SharedPtr resp);
85 std::vector<PointSpeedPair>
maneuvers_to_points(
const std::vector<carma_planning_msgs::msg::Maneuver>& maneuvers,
87 const carma_planning_msgs::msg::VehicleState& state);
99 const std::vector<PointSpeedPair>& points,
double starting_downtrack,
double starting_speed,
double stop_location,
100 double stop_location_buffer, rclcpp::Time start_time,
double stopping_acceleration,
double& initial_speed);
105 void splitPointSpeedPairs(
const std::vector<PointSpeedPair>& points, std::vector<lanelet::BasicPoint2d>* basic_points,
106 std::vector<double>* speeds)
const;
109 const std::vector<lanelet::BasicPoint2d>& points,
const std::vector<double>& times,
110 const std::vector<double>& yaws, rclcpp::Time startTime);
117 void set_yield_client(carma_ros2_utils::ClientPtr<carma_planning_msgs::srv::PlanTrajectory> client);
128 std::shared_ptr<carma_ros2_utils::CarmaLifecycleNode>
nh_;
130 carma_ros2_utils::ClientPtr<carma_planning_msgs::srv::PlanTrajectory>
yield_client_;
carma_wm::WorldModelConstPtr wm_
StopandWaitConfig config_
void splitPointSpeedPairs(const std::vector< PointSpeedPair > &points, std::vector< lanelet::BasicPoint2d > *basic_points, std::vector< double > *speeds) const
Helper method to split a list of PointSpeedPair into separate point and speed lists.
void set_yield_client(carma_ros2_utils::ClientPtr< carma_planning_msgs::srv::PlanTrajectory > client)
set the yield service
std::vector< PointSpeedPair > maneuvers_to_points(const std::vector< carma_planning_msgs::msg::Maneuver > &maneuvers, const carma_wm::WorldModelConstPtr &wm, const carma_planning_msgs::msg::VehicleState &state)
Converts a set of requested STOP_AND_WAIT maneuvers to point speed limit pairs.
bool plan_trajectory_cb(carma_planning_msgs::srv::PlanTrajectory::Request::SharedPtr req, carma_planning_msgs::srv::PlanTrajectory::Response::SharedPtr resp)
Service callback for trajectory planning.
std::vector< carma_planning_msgs::msg::TrajectoryPlanPoint > compose_trajectory_from_centerline(const std::vector< PointSpeedPair > &points, double starting_downtrack, double starting_speed, double stop_location, double stop_location_buffer, rclcpp::Time start_time, double stopping_acceleration, double &initial_speed)
Method converts a list of lanelet centerline points and current vehicle state into a usable list of t...
StopandWait(std::shared_ptr< carma_ros2_utils::CarmaLifecycleNode > nh, carma_wm::WorldModelConstPtr wm, const StopandWaitConfig &config, const std::string &plugin_name, const std::string &version_id)
Constructor.
std::shared_ptr< carma_ros2_utils::CarmaLifecycleNode > nh_
carma_ros2_utils::ClientPtr< carma_planning_msgs::srv::PlanTrajectory > yield_client_
std::vector< carma_planning_msgs::msg::TrajectoryPlanPoint > trajectory_from_points_times_orientations(const std::vector< lanelet::BasicPoint2d > &points, const std::vector< double > ×, const std::vector< double > &yaws, rclcpp::Time startTime)
std::shared_ptr< const WorldModel > WorldModelConstPtr
Stuct containing the algorithm configuration values for the stop_and_wait_plugin.
Convenience class for pairing 2d points with speeds.
lanelet::BasicPoint2d point