Nav2 Navigation Stack - kilted  kilted
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 "rclcpp/rclcpp.hpp"
23 #include "rclcpp_lifecycle/lifecycle_node.hpp"
24 #include "nav2_route/types.hpp"
25 
26 namespace nav2_route
27 {
28 
34 {
35 public:
36  using Ptr = std::shared_ptr<GraphFileLoader>;
37 
41  GraphFileLoader() = default;
42 
46  virtual ~GraphFileLoader() = default;
47 
52  virtual void configure(
53  const rclcpp_lifecycle::LifecycleNode::SharedPtr node) = 0;
54 
64  virtual bool loadGraphFromFile(
65  Graph & graph,
66  GraphToIDMap & graph_to_id_map,
67  std::string filepath) = 0;
68 };
69 } // namespace nav2_route
70 
71 #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.
GraphFileLoader()=default
Constructor.
virtual ~GraphFileLoader()=default
Virtual destructor.
virtual void configure(const rclcpp_lifecycle::LifecycleNode::SharedPtr node)=0
Configure the graph file loader, but do not store the node.