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.
yield_plugin_node.hpp
Go to the documentation of this file.
1#pragma once
2
3/*
4 * Copyright (C) 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#include <carma_planning_msgs/msg/plugin.hpp>
20#include <carma_ros2_utils/carma_lifecycle_node.hpp>
23#include <carma_planning_msgs/srv/plan_trajectory.hpp>
24#include <carma_planning_msgs/msg/lane_change_status.hpp>
25#include <carma_v2x_msgs/msg/mobility_response.hpp>
26#include <carma_v2x_msgs/msg/bsm.hpp>
27#include <functional>
28#include <carma_perception_msgs/msg/external_object_list.hpp>
29#include "yield_plugin.hpp"
30#include "yield_config.hpp"
31
32namespace yield_plugin
33{
38{
39public:
40
44 explicit YieldPluginNode(const rclcpp::NodeOptions &);
45
47 // Overrides
49 carma_ros2_utils::CallbackReturn on_configure_plugin();
50
51 bool get_availability() override;
52
53 std::string get_version_id() override final;
54
56 std::shared_ptr<rmw_request_id_t> srv_header,
57 carma_planning_msgs::srv::PlanTrajectory::Request::SharedPtr req,
58 carma_planning_msgs::srv::PlanTrajectory::Response::SharedPtr resp) override;
59
60private:
61
62 // Config
64
65 // Worker
66 std::shared_ptr<YieldPlugin> worker_;
67
68 std::string version_id_;
69
70 // Publishers
71 rclcpp_lifecycle::LifecyclePublisher<carma_v2x_msgs::msg::MobilityResponse>::SharedPtr mob_resp_pub_;
72 rclcpp_lifecycle::LifecyclePublisher<carma_planning_msgs::msg::LaneChangeStatus>::SharedPtr lc_status_pub_;
73
74 // Subscribers
75 rclcpp::Subscription<carma_v2x_msgs::msg::MobilityRequest>::SharedPtr mob_request_sub_;
76 rclcpp::Subscription<carma_v2x_msgs::msg::BSM>::SharedPtr bsm_sub_;
77 rclcpp::Subscription<carma_perception_msgs::msg::ExternalObjectList>::SharedPtr external_objects_sub_;
78 rclcpp::Subscription<std_msgs::msg::String>::SharedPtr georeference_sub_;
79};
80
81} // namespace yield_plugin
82
83
84
TacticalPlugin base class which can be extended by user provided plugins which wish to implement the ...
ROS node for the YieldPlugin.
YieldPluginNode(const rclcpp::NodeOptions &)
Node constructor.
rclcpp_lifecycle::LifecyclePublisher< carma_planning_msgs::msg::LaneChangeStatus >::SharedPtr lc_status_pub_
rclcpp::Subscription< carma_v2x_msgs::msg::MobilityRequest >::SharedPtr mob_request_sub_
void plan_trajectory_callback(std::shared_ptr< rmw_request_id_t > srv_header, carma_planning_msgs::srv::PlanTrajectory::Request::SharedPtr req, carma_planning_msgs::srv::PlanTrajectory::Response::SharedPtr resp) override
Extending class provided callback which should return a planned trajectory based on the provided traj...
rclcpp::Subscription< carma_v2x_msgs::msg::BSM >::SharedPtr bsm_sub_
std::shared_ptr< YieldPlugin > worker_
rclcpp::Subscription< carma_perception_msgs::msg::ExternalObjectList >::SharedPtr external_objects_sub_
std::string get_version_id() override final
Returns the version id of this plugin.
bool get_availability() override
Get the availability status of this plugin based on the current operating environment....
carma_ros2_utils::CallbackReturn on_configure_plugin()
Method which is triggered when this plugin is moved from the UNCONFIGURED to INACTIVE states....
rclcpp_lifecycle::LifecyclePublisher< carma_v2x_msgs::msg::MobilityResponse >::SharedPtr mob_resp_pub_
rclcpp::Subscription< std_msgs::msg::String >::SharedPtr georeference_sub_
Stuct containing the algorithm configuration values for the YieldPluginConfig.