Conscience Core
CscPlaceCartography.h
Go to the documentation of this file.
1 //
2 // CscPlaceCartography.hpp
3 // ConscienceRobotManager
4 //
5 // Created by Iliès Zaoui on 14/07/2019.
6 // Copyright © 2020 Conscience Robotics. All rights reserved.
7 //
8 
9 #ifndef CscPlaceCartography_h
10 #define CscPlaceCartography_h
11 
12 #include "CscCommon.h"
13 #include "Axiomes/Csc3dTypes.h"
14 
15 #include <mutex>
16 #include <unordered_set>
17 
18 using std::mutex, std::unordered_set;
19 using namespace conscience_core::axiomes;
20 
21 class CscWorldPlace;
22 namespace conscience_core::lidar {
23 
24 const string PLACE_TAG_FROM_CARTOGRAPHY = "FromCartography";
25 
27 public:
28  static CscPlaceCartography *latestFromStorage();
29  static CscPlaceCartography *fromDirectory(const fs::path &dirPath);
34  static CscPlaceCartography *fromFile(const fs::path &filePath);
35  static CscPlaceCartography *empty();
36 
38 
39  bool loadLatestFromStorage(bool logResult = true);
40  void loadFromDirectory(const fs::path &dirPath);
41  void loadFromPointsFile(const fs::path &filePath);
42  CscWorldPlace* toWorldPlace() const;
43  static CscWorldPlace *pointCloudToWorldPlace(const vector<const CscPoint3d *> &points);
44 
48  void loadFromPoints(const vector<const CscPoint3d *> &placePoints);
49 
50  void saveToStorage();
51 
57  void saveToFile(const fs::path &filePath);
58 
63  vector<CscPoint3d *> *getAllPoints() const;
64 
65  unsigned long long getLastUpdatedTimestamp() const;
66 
67 private:
69 
73  void clearNoLock();
74 
75  vector<const CscPoint3d *> allPoints;
76  std::unique_ptr<CscLogger> logger;
77  inline static int cartographyPlaceModelIdCounter = std::numeric_limits<int>::max();
78  unsigned long long lastUpdatedTimestamp = 0;
79 
80  mutable mutex pointsMutex;
81 };
82 
83 }
84 
85 #endif
conscience_core::axiomes
Definition: Csc2dTypes.cpp:9
conscience_core::lidar
Definition: CscEntityReflexion.h:42
conscience_core::lidar::CscPlaceCartography
Definition: CscPlaceCartography.h:26
conscience_core::lidar::PLACE_TAG_FROM_CARTOGRAPHY
const string PLACE_TAG_FROM_CARTOGRAPHY
Definition: CscPlaceCartography.h:24
logger
static std::unique_ptr< CscLogger > logger
Definition: gltfHelpers.cpp:6
CscCommon.h
Csc3dTypes.h
CscWorldPlace
Definition: CscWorldPlace.h:43