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_config.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#ifndef __ARBITRATOR_INCLUDE_ARBITRATOR_CONFIG_HPP__
17#define __ARBITRATOR_INCLUDE_ARBITRATOR_CONFIG_HPP__
18
19#include <iostream>
20#include <vector>
21
22#include <rclcpp/rclcpp.hpp>
23#include <memory>
24#include <map>
25#include <string>
26
27
28namespace arbitrator
29{
30 // Stream operator for map data structure
31 std::ostream &operator<<(std::ostream &output, const std::map<std::string, double> &map)
32 {
33 output << "Map { " << std::endl;
34 for (auto const& pair : map)
35 {
36 output << pair.first << ": " << pair.second << std::endl;
37 }
38 output << "}";
39 return output;
40 }
41
45 struct Config
46 {
47 double min_plan_duration = 6.0; // The minimum amount of time in seconds that an arbitrated plan must cover for the
48 // system to proceed with execution
49 double target_plan_duration = 15.0; // The nominal amount of time in seconds that an arbitrated plan should cover for the
50 // system to operate at best performance
51 double planning_frequency = 1.0; // The planning frequency (hz) for generation for arbitrated plans
52 int beam_width = 3; // The width of the search beam to use for arbitrator planning, 1 =
53 // greedy search, as it approaches infinity the search approaches breadth-first search
54 bool use_fixed_costs = false; // Use fixed priority cost function over using the cost system for
55 // evaluating maneuver plans
56 std::map<std::string, double> plugin_priorities = {}; // The priorities associated with each plugin during the planning
57 // process, values will be normalized at runtime and inverted into costs
58
59 // Stream operator for this config
60 friend std::ostream &operator<<(std::ostream &output, const Config &c)
61 {
62 output << "Arbitrator::Config { " << std::endl
63 << "min_plan_duration: " << c.min_plan_duration << std::endl
64 << "target_plan_duration: " << c.target_plan_duration << std::endl
65 << "planning_frequency: " << c.planning_frequency << std::endl
66 << "beam_width: " << c.beam_width << std::endl
67 << "use_fixed_costs: " << c.use_fixed_costs << std::endl
68 << "plugin_priorities: " << c.plugin_priorities << std::endl
69 << "}" << std::endl;
70 return output;
71 };
72 };
73
74} // namespace abitrator
75
76#endif
std::ostream & operator<<(std::ostream &output, const std::map< std::string, double > &map)
friend std::ostream & operator<<(std::ostream &output, const Config &c)
std::map< std::string, double > plugin_priorities