Nav2 Navigation Stack - kilted  kilted
ROS 2 Navigation Stack
node_basic.hpp
1 // Copyright (c) 2020, Samsung Research America
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. Reserved.
14 
15 #ifndef NAV2_SMAC_PLANNER__NODE_BASIC_HPP_
16 #define NAV2_SMAC_PLANNER__NODE_BASIC_HPP_
17 
18 #include "nav2_smac_planner/constants.hpp"
19 #include "nav2_smac_planner/node_hybrid.hpp"
20 #include "nav2_smac_planner/node_lattice.hpp"
21 #include "nav2_smac_planner/node_2d.hpp"
22 #include "nav2_smac_planner/types.hpp"
23 #include "nav2_smac_planner/collision_checker.hpp"
24 
25 namespace nav2_smac_planner
26 {
27 
32 template<typename NodeT>
33 class NodeBasic
34 {
35 public:
40  explicit NodeBasic(const uint64_t new_index)
41  : graph_node_ptr(nullptr),
42  index(new_index)
43  {
44  }
45 
51  void populateSearchNode(NodeT * & node);
52 
59  void processSearchNode();
60 
61  typename NodeT::Coordinates pose; // Used by NodeHybrid and NodeLattice
62  NodeT * graph_node_ptr;
63  MotionPrimitive * prim_ptr; // Used by NodeLattice
64  uint64_t index;
65  unsigned int motion_index;
66  bool backward;
67  TurnDirection turn_dir;
68 };
69 
70 } // namespace nav2_smac_planner
71 
72 #endif // NAV2_SMAC_PLANNER__NODE_BASIC_HPP_
NodeBasic implementation for priority queue insertion.
Definition: node_basic.hpp:34
NodeBasic(const uint64_t new_index)
A constructor for nav2_smac_planner::NodeBasic.
Definition: node_basic.hpp:40
void populateSearchNode(NodeT *&node)
Take a NodeBasic and populate it with any necessary state cached in the queue for NodeT.
void processSearchNode()
Take a NodeBasic and populate it with any necessary state cached in the queue for NodeTs.
Definition: node_basic.cpp:21
A struct of all motion primitive data.
Definition: types.hpp:179