Nav2 Navigation Stack - lyrical  lyrical
ROS 2 Navigation Stack
graph_file_loader.hpp
1 // Copyright (c) 2025 Joshua Wallace
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef NAV2_ROUTE__INTERFACES__GRAPH_FILE_LOADER_HPP_
16 #define NAV2_ROUTE__INTERFACES__GRAPH_FILE_LOADER_HPP_
17 
18 #include <string>
19 #include <memory>
20 
21 
22 #include "nav2_ros_common/lifecycle_node.hpp"
23 #include "nav2_route/types.hpp"
24 
25 namespace nav2_route
26 {
27 
33 {
34 public:
35  using Ptr = std::shared_ptr<GraphFileLoader>;
36 
40  GraphFileLoader() = default;
41 
45  virtual ~GraphFileLoader() = default;
46 
51  virtual void configure(
52  const nav2::LifecycleNode::SharedPtr node) = 0;
53 
63  virtual bool loadGraphFromFile(
64  Graph & graph,
65  GraphToIDMap & graph_to_id_map,
66  std::string filepath) = 0;
67 };
68 } // namespace nav2_route
69 
70 #endif // NAV2_ROUTE__INTERFACES__GRAPH_FILE_LOADER_HPP_
A plugin interface to parse a file into the graph.
virtual bool loadGraphFromFile(Graph &graph, GraphToIDMap &graph_to_id_map, std::string filepath)=0
Method to load the graph from the filepath.
virtual void configure(const nav2::LifecycleNode::SharedPtr node)=0
Configure the graph file loader, but do not store the node.
GraphFileLoader()=default
Constructor.
virtual ~GraphFileLoader()=default
Virtual destructor.