Nav2 Navigation Stack - rolling  main
ROS 2 Navigation Stack
Public Types | Public Member Functions | List of all members
nav2_route::GraphFileLoader Class Referenceabstract

A plugin interface to parse a file into the graph. More...

#include <nav2_route/include/nav2_route/interfaces/graph_file_loader.hpp>

Inheritance diagram for nav2_route::GraphFileLoader:
Inheritance graph
[legend]

Public Types

using Ptr = std::shared_ptr< GraphFileLoader >
 

Public Member Functions

 GraphFileLoader ()=default
 Constructor.
 
virtual ~GraphFileLoader ()=default
 Virtual destructor.
 
virtual void configure (const nav2::LifecycleNode::SharedPtr node)=0
 Configure the graph file loader, but do not store the node. More...
 
virtual bool loadGraphFromFile (Graph &graph, GraphToIDMap &graph_to_id_map, std::string filepath)=0
 Method to load the graph from the filepath. More...
 

Detailed Description

A plugin interface to parse a file into the graph.

Definition at line 33 of file graph_file_loader.hpp.

Member Function Documentation

◆ configure()

virtual void nav2_route::GraphFileLoader::configure ( const nav2::LifecycleNode::SharedPtr  node)
pure virtual

Configure the graph file loader, but do not store the node.

Parameters
parentpointer to user's node

Implemented in nav2_route::GeoJsonGraphFileLoader.

◆ loadGraphFromFile()

virtual bool nav2_route::GraphFileLoader::loadGraphFromFile ( Graph &  graph,
GraphToIDMap &  graph_to_id_map,
std::string  filepath 
)
pure virtual

Method to load the graph from the filepath.

Parameters
graphThe graph to populate
filepathThe file to parse
idx_mapA map translating nodeid's to graph idxs for use in graph modification services and idx-based route planning requests. This is much faster than using a map the full graph data structure.
Returns
true if graph was successfully loaded

Implemented in nav2_route::GeoJsonGraphFileLoader.


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