Nav2 Navigation Stack - humble  humble
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 <math.h>
19 #include <vector>
20 #include <cmath>
21 #include <iostream>
22 #include <functional>
23 #include <queue>
24 #include <memory>
25 #include <utility>
26 #include <limits>
27 
28 #include "ompl/base/StateSpace.h"
29 
30 #include "nav2_smac_planner/constants.hpp"
31 #include "nav2_smac_planner/node_hybrid.hpp"
32 #include "nav2_smac_planner/node_lattice.hpp"
33 #include "nav2_smac_planner/node_2d.hpp"
34 #include "nav2_smac_planner/types.hpp"
35 #include "nav2_smac_planner/collision_checker.hpp"
36 
37 namespace nav2_smac_planner
38 {
39 
44 template<typename NodeT>
45 class NodeBasic
46 {
47 public:
52  explicit NodeBasic(const unsigned int index)
53  : index(index),
54  graph_node_ptr(nullptr)
55  {
56  }
57 
63  void populateSearchNode(NodeT * & node);
64 
71  void processSearchNode();
72 
73  typename NodeT::Coordinates pose; // Used by NodeHybrid and NodeLattice
74  NodeT * graph_node_ptr;
75  MotionPrimitive * prim_ptr; // Used by NodeLattice
76  unsigned int index, motion_index;
77  bool backward;
78 };
79 
80 } // namespace nav2_smac_planner
81 
82 #endif // NAV2_SMAC_PLANNER__NODE_BASIC_HPP_
NodeBasic implementation for priority queue insertion.
Definition: node_basic.hpp:46
void populateSearchNode(NodeT *&node)
Take a NodeBasic and populate it with any necessary state cached in the queue for NodeT.
NodeBasic(const unsigned int index)
A constructor for nav2_smac_planner::NodeBasic.
Definition: node_basic.hpp:52
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:152