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.
guidance_controller.hpp
Go to the documentation of this file.
1#pragma once
2
3/*
4 * Copyright (C) 2021 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
21#include <memory>
22
23#include <carma_msgs/msg/system_alert.hpp>
24#include <carma_planning_msgs/msg/plugin.hpp>
25#include <carma_planning_msgs/srv/get_plugin_api.hpp>
26#include <carma_planning_msgs/srv/plugin_list.hpp>
27#include <carma_planning_msgs/srv/plugin_activation.hpp>
28#include <ros2_lifecycle_manager/ros2_lifecycle_manager.hpp>
29#include <rclcpp/rclcpp.hpp>
31#include "plugin_manager.h"
33
35{
36 namespace cr2 = carma_ros2_utils;
37
39 {
40 public:
41
43
45
51 explicit GuidanceControllerNode(const rclcpp::NodeOptions &options);
52
53 cr2::CallbackReturn handle_on_configure(const rclcpp_lifecycle::State &);
54
55 cr2::CallbackReturn handle_on_activate(const rclcpp_lifecycle::State &);
56
57 cr2::CallbackReturn handle_on_deactivate(const rclcpp_lifecycle::State &);
58
59 cr2::CallbackReturn handle_on_cleanup(const rclcpp_lifecycle::State &);
60
61 cr2::CallbackReturn handle_on_shutdown(const rclcpp_lifecycle::State &);
62
63 private:
65 std::shared_ptr<PluginManager> plugin_manager_;
66
69
71
72 cr2::SubPtr<carma_planning_msgs::msg::Plugin> plugin_discovery_sub_;
73
74 cr2::ServicePtr<carma_planning_msgs::srv::PluginList> get_registered_plugins_server_;
75
76 cr2::ServicePtr<carma_planning_msgs::srv::PluginList> get_active_plugins_server_;
77
78 cr2::ServicePtr<carma_planning_msgs::srv::PluginActivation> activate_plugin_server_;
79
80 cr2::ServicePtr<carma_planning_msgs::srv::GetPluginApi> get_strategic_plugins_by_capability_server_;
81
82 cr2::ServicePtr<carma_planning_msgs::srv::GetPluginApi> get_tactical_plugins_by_capability_server_;
83
84 cr2::ServicePtr<carma_planning_msgs::srv::GetPluginApi> get_control_plugins_by_capability_server_;
85
86 };
87
88} // namespace v2x_controller
89
A base class for all subsystem_controllers which provides default lifecycle behavior for subsystems.
cr2::SubPtr< carma_planning_msgs::msg::Plugin > plugin_discovery_sub_
ROS handles.
cr2::ServicePtr< carma_planning_msgs::srv::GetPluginApi > get_control_plugins_by_capability_server_
cr2::CallbackReturn handle_on_activate(const rclcpp_lifecycle::State &)
cr2::ServicePtr< carma_planning_msgs::srv::GetPluginApi > get_strategic_plugins_by_capability_server_
cr2::CallbackReturn handle_on_deactivate(const rclcpp_lifecycle::State &)
cr2::ServicePtr< carma_planning_msgs::srv::GetPluginApi > get_tactical_plugins_by_capability_server_
cr2::CallbackReturn handle_on_configure(const rclcpp_lifecycle::State &)
cr2::ServicePtr< carma_planning_msgs::srv::PluginList > get_active_plugins_server_
cr2::ServicePtr< carma_planning_msgs::srv::PluginActivation > activate_plugin_server_
cr2::CallbackReturn handle_on_cleanup(const rclcpp_lifecycle::State &)
cr2::ServicePtr< carma_planning_msgs::srv::PluginList > get_registered_plugins_server_
GuidanceControllerConfig config_
Config for user provided parameters.
cr2::CallbackReturn handle_on_shutdown(const rclcpp_lifecycle::State &)
std::shared_ptr< PluginManager > plugin_manager_
Plugin manager to handle all the plugin specific discovery and reporting.
Stuct containing the algorithm configuration values for the GuidanceController.