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.
stop_and_wait_node.hpp
Go to the documentation of this file.
1#pragma once
2
3/*
4 * Copyright (C) 2021-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 <rclcpp/rclcpp.hpp>
20#include <string>
21#include <algorithm>
22#include <memory>
23#include <boost/uuid/uuid_generators.hpp>
24#include <boost/uuid/uuid_io.hpp>
25#include <lanelet2_core/geometry/Point.h>
26#include <trajectory_utils/trajectory_utils.hpp>
27#include <trajectory_utils/conversions/conversions.hpp>
29#include <sstream>
30#include <carma_ros2_utils/carma_lifecycle_node.hpp>
31#include <Eigen/Core>
32#include <Eigen/Geometry>
33#include <Eigen/LU>
34#include <Eigen/SVD>
35#include <unordered_set>
38#include <vector>
39#include <lanelet2_core/primitives/Lanelet.h>
40#include <lanelet2_core/geometry/LineString.h>
42#include <math.h>
43#include <std_msgs/msg/float64.hpp>
44#include <carma_planning_msgs/msg/stop_and_wait_maneuver.hpp>
45#include <carma_wm/Geometry.hpp>
46#include <carma_planning_msgs/msg/trajectory_plan_point.hpp>
47#include <carma_planning_msgs/msg/trajectory_plan.hpp>
48
50{
52{
53
54private:
55
57
58 // Service Clients
59 carma_ros2_utils::ClientPtr<carma_planning_msgs::srv::PlanTrajectory> yield_client_;
60
61 // Worker
62 std::shared_ptr<StopandWait> plugin_;
63
64 std::string version_id_;
65 std::string plugin_name_;
66
67public:
68
72 explicit StopandWaitNode(const rclcpp::NodeOptions &);
73
77 carma_ros2_utils::CallbackReturn on_configure_plugin();
78
82 rcl_interfaces::msg::SetParametersResult
83 parameter_update_callback(const std::vector<rclcpp::Parameter> &parameters);
84
86 // Overrides
88
90 std::shared_ptr<rmw_request_id_t> srv_header,
91 carma_planning_msgs::srv::PlanTrajectory::Request::SharedPtr req,
92 carma_planning_msgs::srv::PlanTrajectory::Response::SharedPtr resp) override;
93
94 bool get_availability() override;
95
96 std::string get_version_id() override final;
97
98};
99} // namespace stop_and_wait_plugin
TacticalPlugin base class which can be extended by user provided plugins which wish to implement the ...
std::shared_ptr< StopandWait > plugin_
rcl_interfaces::msg::SetParametersResult parameter_update_callback(const std::vector< rclcpp::Parameter > &parameters)
Callback for dynamic parameter updates.
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...
carma_ros2_utils::ClientPtr< carma_planning_msgs::srv::PlanTrajectory > yield_client_
std::string get_version_id() override final
Returns the version id of this plugin.
carma_ros2_utils::CallbackReturn on_configure_plugin()
This method should be used to load parameters and will be called on the configure state transition.
StopandWaitNode(const rclcpp::NodeOptions &)
Node constructor.
bool get_availability() override
Get the availability status of this plugin based on the current operating environment....
Stuct containing the algorithm configuration values for the stop_and_wait_plugin.