Buran Motion Planning Framework
path_optimising_server.h
1 #pragma once
2 
3 #include "base_server.h"
4 #include "optimize_path_median.h"
5 
10 public:
14  static const int COMMAND_IS_READY = 0;
18  static const int COMMAND_START_OPTIMIZE_PATH = 1;
22  static const int COMMAND_OPTIMIZE_PATH = 2;
23 
30  void processCommand(int clientSocket, int command, Json::Value jsonData) override;
31 
39  static void startOptimisePath(
40  PathOptimisingServer *pos, std::shared_ptr<bmpf::MedianPathOptimizer> po, int clientSocket,
41  std::vector<std::vector<double>> path
42  );
43 
48  void onSocketConnected(int clientSocket) override;
49 
50 
64  const std::shared_ptr<bmpf::Scene> &scene, bool showTrace,
65  unsigned int maxOpenSetSize, int gridSize, unsigned int maxNodeCnt,
66  int checkCnt,
67  int filterDivideCnt, int optimizeLoopCnt, int threadCnt = 1
68  ) {
69  _scene = scene;
70  _checkCnt = checkCnt;
71  _showTrace = showTrace;
72  _maxOpenSetSize = maxOpenSetSize;
73  _gridSize = gridSize;
74  _maxNodeCnt = maxNodeCnt;
75  _threadCnt = threadCnt;
76  _filterDivideCnt = filterDivideCnt;
77  _optimizeLoopCnt = optimizeLoopCnt;
78  }
79 
80 
81 protected:
85  std::unordered_map<int, std::vector<std::vector<double>>> paths;
89  std::unordered_map<int, bool> pathOptimisingReady;
93  std::unordered_map<int, std::shared_ptr<bmpf::MedianPathOptimizer>> pfs;
97  std::shared_ptr<bmpf::Scene> _scene;
105  unsigned int _maxOpenSetSize;
113  unsigned int _maxNodeCnt;
130 
131 };
BaseServer
Базовый класс для всех серверов Для реализации сервера, необходимо переопределить две чисто виртуальн...
Definition: base_server.h:26
PathOptimisingServer::_filterDivideCnt
int _filterDivideCnt
Definition: path_optimising_server.h:125
PathOptimisingServer::_checkCnt
int _checkCnt
Definition: path_optimising_server.h:121
PathOptimisingServer::_gridSize
int _gridSize
Definition: path_optimising_server.h:109
PathOptimisingServer::COMMAND_OPTIMIZE_PATH
static const int COMMAND_OPTIMIZE_PATH
Definition: path_optimising_server.h:22
PathOptimisingServer::pathOptimisingReady
std::unordered_map< int, bool > pathOptimisingReady
Definition: path_optimising_server.h:89
PathOptimisingServer::COMMAND_IS_READY
static const int COMMAND_IS_READY
Definition: path_optimising_server.h:14
PathOptimisingServer::PathOptimisingServer
PathOptimisingServer(const std::shared_ptr< bmpf::Scene > &scene, bool showTrace, unsigned int maxOpenSetSize, int gridSize, unsigned int maxNodeCnt, int checkCnt, int filterDivideCnt, int optimizeLoopCnt, int threadCnt=1)
Definition: path_optimising_server.h:63
PathOptimisingServer::_maxOpenSetSize
unsigned int _maxOpenSetSize
Definition: path_optimising_server.h:105
PathOptimisingServer::onSocketConnected
void onSocketConnected(int clientSocket) override
Definition: path_optimising_server.cpp:34
PathOptimisingServer::_scene
std::shared_ptr< bmpf::Scene > _scene
Definition: path_optimising_server.h:97
PathOptimisingServer::_showTrace
bool _showTrace
Definition: path_optimising_server.h:101
PathOptimisingServer::processCommand
void processCommand(int clientSocket, int command, Json::Value jsonData) override
Definition: path_optimising_server.cpp:61
PathOptimisingServer::COMMAND_START_OPTIMIZE_PATH
static const int COMMAND_START_OPTIMIZE_PATH
Definition: path_optimising_server.h:18
PathOptimisingServer::_threadCnt
int _threadCnt
Definition: path_optimising_server.h:117
PathOptimisingServer::_maxNodeCnt
unsigned int _maxNodeCnt
Definition: path_optimising_server.h:113
PathOptimisingServer::_optimizeLoopCnt
int _optimizeLoopCnt
Definition: path_optimising_server.h:129
PathOptimisingServer::paths
std::unordered_map< int, std::vector< std::vector< double > > > paths
Definition: path_optimising_server.h:85
PathOptimisingServer::pfs
std::unordered_map< int, std::shared_ptr< bmpf::MedianPathOptimizer > > pfs
Definition: path_optimising_server.h:93
PathOptimisingServer::startOptimisePath
static void startOptimisePath(PathOptimisingServer *pos, std::shared_ptr< bmpf::MedianPathOptimizer > po, int clientSocket, std::vector< std::vector< double >> path)
Definition: path_optimising_server.cpp:12
PathOptimisingServer
Сервер оптимизации пути
Definition: path_optimising_server.h:9