Parasol Planning Library (PPL)
LocalObstacleMap.h
Go to the documentation of this file.
1 #ifndef LOCAL_OBSTACLE_MAP_H_
2 #define LOCAL_OBSTACLE_MAP_H_
3 
4 #ifndef INVALID_VID
5 #define INVALID_VID (std::numeric_limits<size_t>::max())
6 #endif
7 
8 #ifndef INVALID_EID
9 #define INVALID_EID (std::numeric_limits<size_t>::max())
10 #endif
11 
13 #include "ConfigurationSpace/Cfg.h"
15 #include "Utilities/MetricUtils.h"
17 
18 #include <unordered_map>
19 #include <unordered_set>
20 
21 
27 class LocalObstacleMap final {
28 
29  public:
30 
33 
35  typedef size_t VID;
36 
40 
41  typedef std::unordered_set<VID> VertexSet;
42  typedef std::unordered_map<VID, VertexSet> MapType;
43 
47 
48  LocalObstacleMap(StatClass* const _stats);
49 
53 
57  const VertexSet& Get(const VID& _vid) const;
58 
62  template <typename ContainerType>
63  const VertexSet Get(const ContainerType& _c) const;
64 
68  const VertexSet& Inverse(const VID& _vid) const;
69 
74  template <typename ContainerType>
75  const VertexSet Inverse(const ContainerType& _c) const;
76 
84 
85  void Add(const VID& _obst, const VID& _free);
86 
87  template <typename ContainerType>
88  void Add(const ContainerType& _obst, const VID& _free);
89 
90  template <typename ContainerType>
91  void Add(const VID& _obst, const ContainerType& _free);
92 
93  template <typename ContainerType>
94  void Add(const ContainerType& _obst, const ContainerType& _free);
95 
103 
104  void Delete(const VID& _obst = INVALID_VID, const VID& _free = INVALID_VID);
105 
106  template <typename ContainerType>
107  void Delete(const VID& _obst, const ContainerType& _free);
108 
109  template <typename ContainerType>
110  void Delete(const ContainerType& _obst, const VID& _free = INVALID_VID);
111 
112  template <typename ContainerType>
113  void Delete(const ContainerType& _obst, const ContainerType& _free);
114 
116 
117  private:
118 
121 
122  MapType m_map;
123  MapType m_inverse;
124 
125  StatClass* m_stats{nullptr};
126 
127  static constexpr bool s_debug{false};
128 
130 };
131 
132 #endif
#define INVALID_VID
Definition: LocalObstacleMap.h:5
Definition: GenericStateGraph.h:67
Definition: LocalObstacleMap.h:27
std::unordered_set< VID > VertexSet
Definition: LocalObstacleMap.h:41
const VertexSet & Inverse(const VID &_vid) const
Definition: LocalObstacleMap.cpp:37
std::unordered_map< VID, VertexSet > MapType
Definition: LocalObstacleMap.h:42
void Delete(const VID &_obst=INVALID_VID, const VID &_free=INVALID_VID)
Definition: LocalObstacleMap.cpp:111
size_t VID
Definition: LocalObstacleMap.h:35
LocalObstacleMap(StatClass *const _stats)
Definition: LocalObstacleMap.cpp:9
const VertexSet & Get(const VID &_vid) const
Definition: LocalObstacleMap.cpp:15
void Add(const VID &_obst, const VID &_free)
Definition: LocalObstacleMap.cpp:60
GenericStateGraph< Cfg, DefaultWeight< Cfg > > RoadmapType
Definition: LocalObstacleMap.h:34
Definition: MetricUtils.h:29