Buran Motion Planning Framework
multirobot_path_finder.h
1 #pragma once
2 
3 
4 #include "base/path_finder.h"
5 #include "base/node_grid_path_finder.h"
6 #include "one_direction_sync_path_finder.h"
7 #include "one_direction_ordered_path_finder.h"
8 
26 public:
27 
38  const std::shared_ptr<bmpf::Scene> &scene, bool showTrace,
39  unsigned int maxOpenSetSize, int gridSize, unsigned int maxNodeCnt, int threadCnt = 1
40  ) : PathFinder(scene, showTrace, threadCnt),
41  _maxOpenSetSize(maxOpenSetSize), _maxNodeCnt(maxNodeCnt), _gridSize(gridSize),
42  _scaleGridSize(gridSize) {
43  _ready = true;
44  };
45 
51  _pfsNotReadyIndexes.clear();
52  }
53 
59  void paint(const std::vector<double> &state, bool onlyRobot) override;
60 
66  bool findTick(std::vector<double> &state) override;
67 
73  void prepare(const std::vector<double> &startState, const std::vector<double> &endState) override;
74 
78  void buildPath() override;
79 
91  std::vector<std::vector<double>> checkTask(
92  const std::vector<double> &startState, const std::vector<double> &endState,
93  double opacity
94  );
95 
96 
97 protected:
101  std::vector<std::shared_ptr<bmpf::NodeGridPathFinder>> _singleRobotPathFinders;
105  unsigned int _maxNodeCnt;
109  unsigned int _maxOpenSetSize;
122  std::vector<double> _prevState;
126  std::unordered_set<int> _pfsNotReadyIndexes;
130  std::shared_ptr<bmpf::NodeGridPathFinder> _wholeScenePathFinder;
134  std::shared_ptr<bmpf::NodeGridPathFinder> _scaleWholeScenePathFinder;
135 };
MultiRobotPathFinder::_maxOpenSetSize
unsigned int _maxOpenSetSize
Definition: multirobot_path_finder.h:109
MultiRobotPathFinder::_prevState
std::vector< double > _prevState
Definition: multirobot_path_finder.h:122
MultiRobotPathFinder::_maxNodeCnt
unsigned int _maxNodeCnt
Definition: multirobot_path_finder.h:105
MultiRobotPathFinder::MultiRobotPathFinder
MultiRobotPathFinder(const std::shared_ptr< bmpf::Scene > &scene, bool showTrace, unsigned int maxOpenSetSize, int gridSize, unsigned int maxNodeCnt, int threadCnt=1)
Definition: multirobot_path_finder.h:37
MultiRobotPathFinder::paint
void paint(const std::vector< double > &state, bool onlyRobot) override
Definition: multirobot_path_finder.cpp:8
MultiRobotPathFinder::findTick
bool findTick(std::vector< double > &state) override
Definition: multirobot_path_finder.cpp:19
MultiRobotPathFinder::prepare
void prepare(const std::vector< double > &startState, const std::vector< double > &endState) override
Definition: multirobot_path_finder.cpp:49
MultiRobotPathFinder::_gridSize
int _gridSize
Definition: multirobot_path_finder.h:113
MultiRobotPathFinder::_scaleWholeScenePathFinder
std::shared_ptr< bmpf::NodeGridPathFinder > _scaleWholeScenePathFinder
Definition: multirobot_path_finder.h:134
MultiRobotPathFinder::_singleRobotPathFinders
std::vector< std::shared_ptr< bmpf::NodeGridPathFinder > > _singleRobotPathFinders
Definition: multirobot_path_finder.h:101
MultiRobotPathFinder::~MultiRobotPathFinder
virtual ~MultiRobotPathFinder()
Definition: multirobot_path_finder.h:49
bmpf::PathFinder::_ready
bool _ready
Definition: path_finder.h:253
MultiRobotPathFinder::_wholeScenePathFinder
std::shared_ptr< bmpf::NodeGridPathFinder > _wholeScenePathFinder
Definition: multirobot_path_finder.h:130
MultiRobotPathFinder::_scaleGridSize
int _scaleGridSize
Definition: multirobot_path_finder.h:118
bmpf::PathFinder::PathFinder
PathFinder(const std::shared_ptr< bmpf::Scene > &scene, bool showTrace, int threadCnt=1)
Definition: path_finder.cpp:12
MultiRobotPathFinder::checkTask
std::vector< std::vector< double > > checkTask(const std::vector< double > &startState, const std::vector< double > &endState, double opacity)
проверка задания проверка задания, возвращает пустой вектор, если маршрут можно строить штатным образ...
Definition: multirobot_path_finder.cpp:103
bmpf::PathFinder
Базовый класс для всех планировщиков
Definition: path_finder.h:28
MultiRobotPathFinder::_pfsNotReadyIndexes
std::unordered_set< int > _pfsNotReadyIndexes
Definition: multirobot_path_finder.h:126
MultiRobotPathFinder
Definition: multirobot_path_finder.h:25
MultiRobotPathFinder::buildPath
void buildPath() override
Definition: multirobot_path_finder.cpp:123