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.
|
Implementation of the CostFunction interface. More...
#include <fixed_priority_cost_function.hpp>
Public Member Functions | |
FixedPriorityCostFunction (const std::map< std::string, double > &plugin_priorities) | |
Constructor for FixedPriorityCostFunction. More... | |
double | compute_total_cost (const carma_planning_msgs::msg::ManeuverPlan &plan) |
Compute the unit cost over distance of a given maneuver plan. More... | |
double | compute_cost_per_unit_distance (const carma_planning_msgs::msg::ManeuverPlan &plan) |
Compute the unit cost over distance of a given maneuver plan. More... | |
Public Member Functions inherited from arbitrator::CostFunction | |
virtual double | compute_total_cost (const carma_planning_msgs::msg::ManeuverPlan &plan)=0 |
Compute the cost of a given maneuver plan. More... | |
virtual double | compute_cost_per_unit_distance (const carma_planning_msgs::msg::ManeuverPlan &plan)=0 |
Compute the unit cost over distance of a given maneuver plan. More... | |
virtual | ~CostFunction () |
Virtual destructor provided for memory safety. More... | |
Private Attributes | |
std::map< std::string, double > | plugin_costs_ |
Implementation of the CostFunction interface.
Implements costs by associating a fixed priority number with each plugin (as specified by configuration). This priority is then normalized across all plugins, and then an inverse is computed to arrive at the cost per unit distance for that plugins.
e.g. Three plugins with priority 20, 10, and 5 will respectively have costs 0, 0.5, 0.75 per unit distance.
Definition at line 37 of file fixed_priority_cost_function.hpp.
arbitrator::FixedPriorityCostFunction::FixedPriorityCostFunction | ( | const std::map< std::string, double > & | plugin_priorities | ) |
Constructor for FixedPriorityCostFunction.
plugin_priorities | with plugin_name, priority_value mappings |
Definition at line 25 of file fixed_priority_cost_function.cpp.
References plugin_costs_.
|
virtual |
Compute the unit cost over distance of a given maneuver plan.
plan | The plan to evaluate |
Implements arbitrator::CostFunction.
Definition at line 58 of file fixed_priority_cost_function.cpp.
References compute_total_cost(), arbitrator_utils::get_plan_end_distance(), and arbitrator_utils::get_plan_start_distance().
|
virtual |
Compute the unit cost over distance of a given maneuver plan.
plan | The plan to evaluate |
Implements arbitrator::CostFunction.
Definition at line 45 of file fixed_priority_cost_function.cpp.
References arbitrator_utils::get_maneuver_end_distance(), GET_MANEUVER_PROPERTY, arbitrator_utils::get_maneuver_start_distance(), and plugin_costs_.
Referenced by compute_cost_per_unit_distance().
|
private |
Definition at line 60 of file fixed_priority_cost_function.hpp.
Referenced by FixedPriorityCostFunction(), and compute_total_cost().