Class EdgeScorer

Class Documentation

class EdgeScorer

An class to encapsulate edge scoring logic for plugins and different user specified algorithms to influence graph search. It has access to the edge, which in turn has access to the parent and child node of the connection. It also contains action and arbitrary user-defined metadata to enable edge scoring logic based on arbitrary properties of the graph you select (e.g. some regions have a multiplier, some actions are discouraged with higher costs like having to go through a door, edges with reduced speed limits are proportionally less preferred for optimality relative to the distance the edge represents to optimize time to goal)

Public Functions

explicit EdgeScorer(rclcpp_lifecycle::LifecycleNode::SharedPtr node, const std::shared_ptr<tf2_ros::Buffer> tf_buffer, const std::shared_ptr<nav2_costmap_2d::CostmapSubscriber> costmap_subscriber)

Constructor.

~EdgeScorer() = default

Destructor.

bool score(const EdgePtr edge, const RouteRequest &route_request, const EdgeType &edge_type, float &score)

Score the edge with the set of plugins.

Parameters:
  • edge – Ptr to edge for scoring

  • goal_pose – Pose Stamped of desired goal

  • score – of edge

  • final_edge – whether this edge brings us to the goal or not

Returns:

If edge is valid

int numPlugins() const

Provide the number of plugisn in the scorer loaded.

Returns:

Number of scoring plugins

Protected Attributes

pluginlib::ClassLoader<EdgeCostFunction> plugin_loader_
std::vector<EdgeCostFunction::Ptr> plugins_