Buran Motion Planning Framework
all_directions_path_finder.h
1 #pragma once
2 
3 #include <base/grid_path_finder.h>
4 #include <base/node_grid_path_finder.h>
5 
6 #include <memory>
7 #include <unordered_map>
8 #include <set>
9 #include <utility>
10 #include <unordered_set>
11 
12 #include <future>
13 #include "scene.h"
14 #include "base/path_node.h"
15 
16 namespace bmpf {
47  public:
59  explicit AllDirectionsPathFinder(const std::shared_ptr<bmpf::Scene> &scene,
60  bool showTrace,
61  unsigned int maxOpenSetSize,
62  int gridSize,
63  unsigned int maxNodeCnt,
64  unsigned int kG = 1,
65  unsigned int kD = 0,
66  int threadCnt = 1
67  ) : NodeGridPathFinder(scene, showTrace, gridSize, maxNodeCnt, kG, kD, threadCnt),
68  _maxOpenSetSize(maxOpenSetSize) {
69  _ready = true;
70  };
71 
72  protected:
73 
83  std::shared_ptr<PathNode> _forEachNeighbor(
84  std::shared_ptr<PathNode> currentNode,
85  std::vector<int> &endCoords
86  ) override;
87 
91  unsigned int _maxOpenSetSize;
92 
93  };
94 
105  template<typename F>
106  void loop(std::vector<int> data, int pos, const F &consumer);
107 
115  template<typename F>
116  void loop(std::vector<int> data, int pos, const F &consumer) {
117  if (pos >= data.size()) {
118  consumer(data);
119  } else
120  for (int i = -1; i <= 1; i++) {
121  data[pos] = i;
122  loop(data, pos + 1, consumer);
123  }
124  }
125 
126 }
bmpf::NodeGridPathFinder
Базовый класс для всех планировщиков на сетке с нодами Базовый класс для всех планировщиков на сетке ...
Definition: node_grid_path_finder.h:40
bmpf::AllDirectionsPathFinder
Планировщик со смещениями во все стороны.
Definition: all_directions_path_finder.h:46
bmpf::PathFinder::_ready
bool _ready
Definition: path_finder.h:253
bmpf::AllDirectionsPathFinder::_maxOpenSetSize
unsigned int _maxOpenSetSize
Definition: all_directions_path_finder.h:91
bmpf::AllDirectionsPathFinder::AllDirectionsPathFinder
AllDirectionsPathFinder(const std::shared_ptr< bmpf::Scene > &scene, bool showTrace, unsigned int maxOpenSetSize, int gridSize, unsigned int maxNodeCnt, unsigned int kG=1, unsigned int kD=0, int threadCnt=1)
Definition: all_directions_path_finder.h:59
bmpf::AllDirectionsPathFinder::_forEachNeighbor
std::shared_ptr< PathNode > _forEachNeighbor(std::shared_ptr< PathNode > currentNode, std::vector< int > &endCoords) override
Definition: all_directions_path_finder.cpp:10