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.
arbitrator_utils.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2022 LEIDOS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 * use this file except in compliance with the License. You may obtain a copy of
6 * the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 * License for the specific language governing permissions and limitations under
14 * the License.
15 */
16
17#ifndef __ARBITRATOR_INCLUDE_ARBITRATOR_UTILS_HPP__
18#define __ARBITRATOR_INCLUDE_ARBITRATOR_UTILS_HPP__
19
20#include <rclcpp/rclcpp.hpp>
21#include <carma_planning_msgs/msg/maneuver_plan.hpp>
22
33#define GET_MANEUVER_PROPERTY(mvr, property)\
34 (((mvr).type == carma_planning_msgs::msg::Maneuver::INTERSECTION_TRANSIT_LEFT_TURN ? (mvr).intersection_transit_left_turn_maneuver.property :\
35 ((mvr).type == carma_planning_msgs::msg::Maneuver::INTERSECTION_TRANSIT_RIGHT_TURN ? (mvr).intersection_transit_right_turn_maneuver.property :\
36 ((mvr).type == carma_planning_msgs::msg::Maneuver::INTERSECTION_TRANSIT_STRAIGHT ? (mvr).intersection_transit_straight_maneuver.property :\
37 ((mvr).type == carma_planning_msgs::msg::Maneuver::LANE_CHANGE ? (mvr).lane_change_maneuver.property :\
38 ((mvr).type == carma_planning_msgs::msg::Maneuver::LANE_FOLLOWING ? (mvr).lane_following_maneuver.property :\
39 ((mvr).type == carma_planning_msgs::msg::Maneuver::STOP_AND_WAIT ? (mvr).stop_and_wait_maneuver.property :\
40 throw std::invalid_argument("GET_MANEUVER_PROPERTY (property) called on maneuver with invalid type id"))))))))
41
43{
50 rclcpp::Time get_plan_start_time(const carma_planning_msgs::msg::ManeuverPlan&);
51
58 double get_plan_start_distance(const carma_planning_msgs::msg::ManeuverPlan&);
59
66 rclcpp::Time get_plan_end_time(const carma_planning_msgs::msg::ManeuverPlan&);
67
74 double get_plan_end_distance(const carma_planning_msgs::msg::ManeuverPlan&);
75
82 rclcpp::Time get_maneuver_start_time(const carma_planning_msgs::msg::Maneuver&);
83
90 double get_maneuver_start_distance(const carma_planning_msgs::msg::Maneuver&);
91
98 rclcpp::Time get_maneuver_end_time(const carma_planning_msgs::msg::Maneuver&);
99
106 double get_maneuver_end_distance(const carma_planning_msgs::msg::Maneuver&);
107} // namespace arbitrator
108
109#endif //__ARBITRATOR_INCLUDE_ARBITRATOR_UTILS_HPP__
rclcpp::Time get_plan_start_time(const carma_planning_msgs::msg::ManeuverPlan &)
Get the start time of the first maneuver in the plan.
rclcpp::Time get_maneuver_end_time(const carma_planning_msgs::msg::Maneuver &)
Get the end time of the specified maneuver.
double get_maneuver_start_distance(const carma_planning_msgs::msg::Maneuver &)
Get the start distance the specified maneuver.
double get_maneuver_end_distance(const carma_planning_msgs::msg::Maneuver &)
Get the end distance of the specified maneuver.
rclcpp::Time get_plan_end_time(const carma_planning_msgs::msg::ManeuverPlan &)
Get the end time of the first maneuver in the plan.
double get_plan_end_distance(const carma_planning_msgs::msg::ManeuverPlan &)
Get the end distance of the first maneuver in the plan.
rclcpp::Time get_maneuver_start_time(const carma_planning_msgs::msg::Maneuver &)
Get the start time of the specified maneuver.
double get_plan_start_distance(const carma_planning_msgs::msg::ManeuverPlan &)
Get the start distance of the first maneuver in the plan.