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.
platooning_tactical_plugin.h
Go to the documentation of this file.
1#pragma once
2
3/*------------------------------------------------------------------------------
4* Copyright (C) 2020-2022 LEIDOS.
5*
6* Licensed under the Apache License, Version 2.0 (the "License"); you may not
7* use this file except in compliance with the License. You may obtain a copy of
8* the License at
9*
10* http://www.apache.org/licenses/LICENSE-2.0
11*
12* Unless required by applicable law or agreed to in writing, software
13* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15* License for the specific language governing permissions and limitations under
16* the License.
17
18------------------------------------------------------------------------------*/
19
20#include <vector>
21#include <carma_planning_msgs/msg/trajectory_plan.hpp>
22#include <carma_planning_msgs/msg/trajectory_plan_point.hpp>
23#include <carma_wm/Geometry.hpp>
24#include <carma_planning_msgs/srv/plan_trajectory.hpp>
26#include <functional>
27#include <unordered_set>
28#include <carma_debug_ros2_msgs/msg/trajectory_curvature_speeds.hpp>
30#include <carma_ros2_utils/timers/TimerFactory.hpp>
31
33
35{
36using DebugPublisher = std::function<void(const carma_debug_ros2_msgs::msg::TrajectoryCurvatureSpeeds&)>;
41{
42 lanelet::BasicPoint2d point;
43 double speed = 0;
44};
45
51{
52public:
60 std::shared_ptr<carma_ros2_utils::timers::TimerFactory> timer_factory);
61
70 bool plan_trajectory_cb(carma_planning_msgs::srv::PlanTrajectory::Request& req, carma_planning_msgs::srv::PlanTrajectory::Response& resp);
71
76
77
78 carma_planning_msgs::msg::VehicleState ending_state_before_buffer_; //state before applying extra points for curvature calculation that are removed later
79
80private:
83
84 carma_debug_ros2_msgs::msg::TrajectoryCurvatureSpeeds debug_msg_;
86
87 carma_planning_msgs::msg::VehicleState ending_state_before_buffer; //state before applying extra points for curvature calculation that are removed later
88
89 std::shared_ptr<carma_ros2_utils::timers::TimerFactory> timer_factory_;
90};
91} // namespace platooning_tactical_plugin
Class containing primary business logic for the Platooning Tactical Plugin for trajectory generation.
carma_planning_msgs::msg::VehicleState ending_state_before_buffer_
carma_debug_ros2_msgs::msg::TrajectoryCurvatureSpeeds debug_msg_
std::shared_ptr< carma_ros2_utils::timers::TimerFactory > timer_factory_
PlatooningTacticalPlugin(carma_wm::WorldModelConstPtr wm, PlatooningTacticalPluginConfig config, std::shared_ptr< carma_ros2_utils::timers::TimerFactory > timer_factory)
Constructor.
void set_config(PlatooningTacticalPluginConfig config)
Set the current config.
carma_planning_msgs::msg::VehicleState ending_state_before_buffer
bool plan_trajectory_cb(carma_planning_msgs::srv::PlanTrajectory::Request &req, carma_planning_msgs::srv::PlanTrajectory::Response &resp)
Service callback for trajectory planning.
std::shared_ptr< const WorldModel > WorldModelConstPtr
Definition: WorldModel.hpp:452
std::function< void(const carma_debug_ros2_msgs::msg::TrajectoryCurvatureSpeeds &)> DebugPublisher
Stuct containing the algorithm configuration values for the PlatooningTacticalPlugin.
Convenience class for pairing 2d points with speeds.