Nav2 Navigation Stack - rolling  main
ROS 2 Navigation Stack
Public Member Functions | Protected Attributes | List of all members
nav2_route::DistanceScorer Class Reference

Scores edges by the distance traversed, weighted by speed limit metadata to optimize for time to goal, when %-based speed limits are set. More...

#include <nav2_route/include/nav2_route/plugins/edge_cost_functions/distance_scorer.hpp>

Inheritance diagram for nav2_route::DistanceScorer:
Inheritance graph
[legend]
Collaboration diagram for nav2_route::DistanceScorer:
Collaboration graph
[legend]

Public Member Functions

 DistanceScorer ()=default
 Constructor.
 
virtual ~DistanceScorer ()=default
 destructor
 
void configure (const nav2::LifecycleNode::SharedPtr node, const std::shared_ptr< tf2_ros::Buffer > tf_buffer, std::shared_ptr< nav2_costmap_2d::CostmapSubscriber > costmap_subscriber, const std::string &name) override
 Configure.
 
bool score (const EdgePtr edge, const RouteRequest &route_request, const EdgeType &edge_type, float &cost) override
 Main scoring plugin API. More...
 
std::string getName () override
 Get name of the plugin for parameter scope mapping. More...
 
- Public Member Functions inherited from nav2_route::EdgeCostFunction
 EdgeCostFunction ()=default
 Constructor.
 
virtual ~EdgeCostFunction ()=default
 Virtual destructor.
 
virtual void prepare ()
 Prepare for a new cycle, by resetting state, grabbing data to use for all immediate requests, or otherwise prepare for scoring.
 

Protected Attributes

std::string name_
 
std::string speed_tag_
 
float weight_
 

Additional Inherited Members

- Public Types inherited from nav2_route::EdgeCostFunction
using Ptr = std::shared_ptr< nav2_route::EdgeCostFunction >
 

Detailed Description

Scores edges by the distance traversed, weighted by speed limit metadata to optimize for time to goal, when %-based speed limits are set.

Definition at line 33 of file distance_scorer.hpp.

Member Function Documentation

◆ getName()

std::string nav2_route::DistanceScorer::getName ( )
overridevirtual

Get name of the plugin for parameter scope mapping.

Returns
Name

Implements nav2_route::EdgeCostFunction.

Definition at line 57 of file distance_scorer.cpp.

Referenced by configure().

Here is the caller graph for this function:

◆ score()

bool nav2_route::DistanceScorer::score ( const EdgePtr  edge,
const RouteRequest route_request,
const EdgeType &  edge_type,
float &  cost 
)
overridevirtual

Main scoring plugin API.

Parameters
edgeThe edge pointer to score, which has access to the start/end nodes and their associated metadata and actions
costof the edge scored
Returns
bool if this edge is open valid to traverse

Implements nav2_route::EdgeCostFunction.

Definition at line 43 of file distance_scorer.cpp.


The documentation for this class was generated from the following files: