19#include <rclcpp/rclcpp.hpp>
21#include <carma_planning_msgs/msg/trajectory_plan.hpp>
22#include <carma_planning_msgs/msg/trajectory_plan_point.hpp>
23#include <carma_planning_msgs/msg/plugin.hpp>
24#include <carma_planning_msgs/msg/maneuver.hpp>
25#include <boost/shared_ptr.hpp>
26#include <carma_ros2_utils/carma_lifecycle_node.hpp>
27#include <boost/geometry.hpp>
28#include <carma_planning_msgs/srv/plan_trajectory.hpp>
35 void Servicer::call(carma_planning_msgs::srv::PlanTrajectory::Request::SharedPtr req, carma_planning_msgs::srv::PlanTrajectory::Response::SharedPtr& resp)
37 std::shared_future<carma_planning_msgs::srv::PlanTrajectory::Response::SharedPtr> resp_future =
client->async_send_request(req);
39 auto future_status = resp_future.wait_for(std::chrono::milliseconds(500));
41 if (future_status == std::future_status::ready) {
42 resp = resp_future.get();
44 RCLCPP_DEBUG_STREAM(rclcpp::get_logger(
"intersection_transit_maneuvering"),
"Responsible tactical plugin was called and got trajectory size: " << resp->trajectory_plan.trajectory_points.size());
48 RCLCPP_DEBUG(rclcpp::get_logger(
"intersection_transit_maneuvering"),
"Failed to call the responsible tactical plugin from intersection_transit_maneuvering");
55 void Servicer::set_client( carma_ros2_utils::ClientPtr<carma_planning_msgs::srv::PlanTrajectory> srv_client)
void call(carma_planning_msgs::srv::PlanTrajectory::Request::SharedPtr req, carma_planning_msgs::srv::PlanTrajectory::Response::SharedPtr &resp)
Method that uses the ros::Service::call() definition as specified in the ROS API.
carma_ros2_utils::ClientPtr< carma_planning_msgs::srv::PlanTrajectory > client
Servicer()
Construct a new Servicer object.
void set_client(carma_ros2_utils::ClientPtr< carma_planning_msgs::srv::PlanTrajectory > srv_client)
set the trajectory service client