Buran Motion Planning Framework
path_finding_server.h
1 #pragma once
2 
3 #include "base_server.h"
4 
9 class PathFindingServer : public BaseServer {
10 public:
14  static const int COMMAND_IS_READY = 0;
18  static const int COMMAND_START_FIND_PATH = 1;
22  static const int COMMAND_FIND_PATH_RESULT = 2;
23 
30  void processCommand(int clientSocket, int command, Json::Value jsonData) override;
31 
40  static void startFindPath(PathFindingServer *pfs, std::shared_ptr<bmpf::PathFinder> pf, int clientSocket,
41  std::vector<double> start, std::vector<double> end);
42 
47  void onSocketConnected(int clientSocket) override;
48 
54  virtual std::shared_ptr<bmpf::PathFinder> createPathFinder(int clientSocket) = 0;
55 
56 protected:
60  std::unordered_map<int, std::vector<std::vector<double>>> paths;
64  std::unordered_map<int, bool> pathFindingReady;
68  std::unordered_map<int, std::shared_ptr<bmpf::PathFinder>> pfs;
69 };
BaseServer
Базовый класс для всех серверов Для реализации сервера, необходимо переопределить две чисто виртуальн...
Definition: base_server.h:26
PathFindingServer::COMMAND_START_FIND_PATH
static const int COMMAND_START_FIND_PATH
Definition: path_finding_server.h:18
PathFindingServer
Базовый класс для всех серверов планирования для использования необходимо переопределить в потомке cr...
Definition: path_finding_server.h:9
PathFindingServer::startFindPath
static void startFindPath(PathFindingServer *pfs, std::shared_ptr< bmpf::PathFinder > pf, int clientSocket, std::vector< double > start, std::vector< double > end)
Definition: path_finding_server.cpp:11
PathFindingServer::COMMAND_FIND_PATH_RESULT
static const int COMMAND_FIND_PATH_RESULT
Definition: path_finding_server.h:22
PathFindingServer::COMMAND_IS_READY
static const int COMMAND_IS_READY
Definition: path_finding_server.h:14
PathFindingServer::pathFindingReady
std::unordered_map< int, bool > pathFindingReady
Definition: path_finding_server.h:64
PathFindingServer::processCommand
void processCommand(int clientSocket, int command, Json::Value jsonData) override
Definition: path_finding_server.cpp:54
PathFindingServer::onSocketConnected
void onSocketConnected(int clientSocket) override
Definition: path_finding_server.cpp:33
PathFindingServer::paths
std::unordered_map< int, std::vector< std::vector< double > > > paths
Definition: path_finding_server.h:60
PathFindingServer::pfs
std::unordered_map< int, std::shared_ptr< bmpf::PathFinder > > pfs
Definition: path_finding_server.h:68
PathFindingServer::createPathFinder
virtual std::shared_ptr< bmpf::PathFinder > createPathFinder(int clientSocket)=0