19#include <carma_planning_msgs/msg/maneuver_parameters.hpp>
20#include <rclcpp/rclcpp.hpp>
28 double max_priority = std::numeric_limits<double>::lowest();
29 for (
auto it = plugin_priorities.begin(); it != plugin_priorities.end(); it++)
31 if (it->second > max_priority)
33 max_priority = it->second;
38 for (
auto it = plugin_priorities.begin(); it != plugin_priorities.end(); it++)
41 RCLCPP_INFO_STREAM(rclcpp::get_logger(
"arbitrator"),
"FixedPriorityCostFunction: " <<
"Plugin: " << it->first <<
" Normalized Cost: " <<
plugin_costs_[it->first]);
47 double total_cost = 0.0;
48 for (
auto it = plan.maneuvers.begin(); it != plan.maneuvers.end(); it++)
#define GET_MANEUVER_PROPERTY(mvr, property)
Macro definition to enable easier access to fields shared across the maneuver types.
double compute_total_cost(const carma_planning_msgs::msg::ManeuverPlan &plan)
Compute the unit cost over distance of a given maneuver plan.
FixedPriorityCostFunction(const std::map< std::string, double > &plugin_priorities)
Constructor for FixedPriorityCostFunction.
std::map< std::string, double > plugin_costs_
double compute_cost_per_unit_distance(const carma_planning_msgs::msg::ManeuverPlan &plan)
Compute the unit cost over distance of a given maneuver plan.
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.
double get_plan_end_distance(const carma_planning_msgs::msg::ManeuverPlan &)
Get the end distance of the first maneuver in the plan.
double get_plan_start_distance(const carma_planning_msgs::msg::ManeuverPlan &)
Get the start distance of the first maneuver in the plan.