Buran Motion Planning Framework
|
5 #include <unordered_map>
7 #include <unordered_set>
11 #include "base/collider.h"
13 #include "solid_collider.h"
14 #include "solid_sync_collider.h"
46 PathFinder(
const std::shared_ptr<bmpf::Scene> &scene,
bool showTrace,
int threadCnt = 1);
55 std::vector<std::vector<double>>
56 findPath(
const std::vector<double> &startState,
const std::vector<double> &endState,
int &errorCode);
63 virtual bool findTick(std::vector<double> &state) = 0;
70 virtual void prepare(
const std::vector<double> &startState,
const std::vector<double> &endState) = 0;
87 virtual void paint(
const std::vector<double> &state,
bool onlyRobot);
96 bool divideCheckPathSegment(
const std::vector<double> &prevPoint, std::vector<double> nextPoint,
int checkCnt);
104 int divideCheckPath(std::vector<std::vector<double>> path,
int checkCnt);
110 static void infoPath(
const std::vector<std::vector<double>> &path);
117 static Json::Value
getJSONPath(std::vector<std::vector<double>> path);
123 static std::vector<std::vector<double>>
getPathFromJSON(
const Json::Value& json);
130 static void savePathToFile(std::vector<std::vector<double>> path,
const std::string &filename);
138 static std::vector<std::vector<double>>
loadPathFromFile(
const std::string &filename, std::string &scenePath);
146 static std::vector<std::vector<std::vector<double>>>
155 static std::vector<std::vector<double>>
splitPath(std::vector<std::vector<double>> path,
unsigned long partCnt);
164 bool simpleCheckPath(
const std::vector<std::vector<double>> &path,
double maxDist);
172 bool checkState(
const std::vector<double> &state);
197 static std::vector<double>
getPathStateFromTM(std::vector<std::vector<double>> &path,
double tm);
273 std::chrono::time_point<std::chrono::system_clock>
_startTime;
int divideCheckPath(std::vector< std::vector< double >> path, int checkCnt)
Definition: path_finder.cpp:148
std::chrono::time_point< std::chrono::system_clock > _startTime
Definition: path_finder.h:273
static std::vector< std::vector< std::vector< double > > > loadPathsFromFile(const std::string &filename, std::string &scenePath)
Definition: path_finder.cpp:296
std::vector< double > _startState
Definition: path_finder.h:265
void deleteObjectFromScene(long robotNum)
Definition: path_finder.cpp:94
std::vector< double > & getStartState()
Definition: path_finder.h:309
static double calculatePathLength(std::vector< std::vector< double >> path)
Definition: path_finder.cpp:267
const std::shared_ptr< bmpf::Collider > & getCollider() const
Definition: path_finder.h:339
bool checkState(const std::vector< double > &state)
проверяет доступность состояния Проверяет доступность углов, после проверяет состояние на коллизии
Definition: path_finder.cpp:105
int getErrorCode() const
Definition: path_finder.h:321
static void savePathToFile(std::vector< std::vector< double >> path, const std::string &filename)
Definition: path_finder.cpp:280
bool checkCollision(const std::vector< double > &state)
Definition: path_finder.cpp:198
std::vector< std::vector< double > > _buildedPath
Definition: path_finder.h:269
std::vector< std::vector< double > > findPath(const std::vector< double > &startState, const std::vector< double > &endState, int &errorCode)
Definition: path_finder.cpp:47
double _calculationTimeInSeconds
Definition: path_finder.h:277
static std::vector< std::vector< double > > loadPathFromFile(const std::string &filename, std::string &scenePath)
Definition: path_finder.cpp:334
std::vector< double > getRandomState()
Definition: path_finder.cpp:185
static const int ERROR_CAN_NOT_FIND_PATH
Definition: path_finder.h:38
void addObjectToScene(std::string path)
Definition: path_finder.cpp:85
bool simpleCheckPath(const std::vector< std::vector< double >> &path, double maxDist)
Definition: path_finder.cpp:164
bool _ready
Definition: path_finder.h:253
double _pathLength
Definition: path_finder.h:230
static std::vector< std::vector< double > > getPathFromJSON(const Json::Value &json)
Definition: path_finder.cpp:356
bool divideCheckPathSegment(const std::vector< double > &prevPoint, std::vector< double > nextPoint, int checkCnt)
Definition: path_finder.cpp:125
virtual bool findTick(std::vector< double > &state)=0
std::shared_ptr< bmpf::Collider > _collider
Definition: path_finder.h:246
PathFinder(const std::shared_ptr< bmpf::Scene > &scene, bool showTrace, int threadCnt=1)
Definition: path_finder.cpp:12
static void infoPath(const std::vector< std::vector< double >> &path)
Definition: path_finder.cpp:397
void setReady(bool ready)
Definition: path_finder.h:303
static Json::Value getJSONPath(std::vector< std::vector< double >> path)
Definition: path_finder.cpp:375
double getPathLength() const
Definition: path_finder.h:285
static std::vector< std::vector< double > > splitPath(std::vector< std::vector< double >> path, unsigned long partCnt)
Definition: path_finder.cpp:409
int _errorCode
Definition: path_finder.h:234
bool _showTrace
Definition: path_finder.h:242
virtual void buildPath()=0
Базовый класс для всех планировщиков
Definition: path_finder.h:28
const std::vector< std::vector< double > > & getBuildedPath() const
Definition: path_finder.h:327
std::vector< double > getPathStateFromTM(double tm)
получить состояние по времени две соседние точки считаются разделёнными единичным временным интервало...
Definition: path_finder.cpp:218
virtual void prepare(const std::vector< double > &startState, const std::vector< double > &endState)=0
std::vector< double > _endState
Definition: path_finder.h:261
bool getThreadCnt() const
Definition: path_finder.h:297
void updateCollider()
Definition: path_finder.cpp:114
std::vector< double > & getEndState()
Definition: path_finder.h:315
bool _threadCnt
Definition: path_finder.h:257
virtual void paint(const std::vector< double > &state, bool onlyRobot)
Definition: path_finder.cpp:207
bool isReady() const
Definition: path_finder.h:291
static const int NO_ERROR
Definition: path_finder.h:34
double getCalculationTimeInSeconds() const
Definition: path_finder.h:345
const std::shared_ptr< bmpf::Scene > & getScene() const
Definition: path_finder.h:333
std::shared_ptr< bmpf::Scene > _scene
Definition: path_finder.h:238