1 #ifndef PMPL_CD_INFO_H_
2 #define PMPL_CD_INFO_H_
8 #include <unordered_map>
28 typedef std::pair<const Body*, const Body*>
BodyKey;
29 typedef std::pair<const MultiBody*, const MultiBody*>
MultiBodyKey;
31 typedef std::map<BodyKey, double>
BodyMap;
34 typedef typename BodyMap::const_iterator
iterator;
50 const double _clearance);
120 double m_minClearance{std::numeric_limits<double>::infinity()};
122 BodyKey m_closestPair{
nullptr,
nullptr};
153 CDInfo(
const bool _retAllInfo =
false);
157 void ResetVars(
const bool _retAllInfo =
false);
std::map< BodyKey, double > BodyMap
Definition: CDInfo.h:31
void SetClearance(const Body *const _a, const Body *const _b, const double _clearance)
Definition: CDInfo.cpp:46
iterator begin() const noexcept
Definition: CDInfo.cpp:122
MultiBodyKey GetClosestMultiBodies() const noexcept
Get the multibody pair which had the lowest clearance value.
Definition: CDInfo.cpp:112
iterator end() const noexcept
Definition: CDInfo.cpp:129
BodyKey GetClosestBodies() const noexcept
Get the body pair which had the lowest clearance value.
Definition: CDInfo.cpp:105
std::pair< const MultiBody *, const MultiBody * > MultiBodyKey
Definition: CDInfo.h:29
std::pair< const Body *, const Body * > BodyKey
Definition: CDInfo.h:28
void Merge(const CDClearanceMap &_other)
Definition: CDInfo.cpp:32
BodyMap::const_iterator iterator
Definition: CDInfo.h:34
double GetClearance(const Body *const _a, const Body *const _b) const noexcept
Definition: CDInfo.cpp:79
std::map< MultiBodyKey, double > MultiBodyMap
Definition: CDInfo.h:32
void Clear()
Reset the structure.
Definition: CDInfo.cpp:68
double GetMinClearance() const noexcept
Get the lowest reported clearance.
Definition: CDInfo.cpp:98
Definition: MultiBody.h:65
std::vector< CollisionPair > m_trianglePairs
All colliding triangle pairs.
Definition: CDInfo.h:181
mathtool::Vector3d m_objectPoint
Closest point on closest obstacle to Robot.
Definition: CDInfo.h:179
bool m_retAllInfo
Consider all collisions or only the first?
Definition: CDInfo.h:173
mathtool::Vector3d m_robotPoint
Closest point on Robot to closest obstacle.
Definition: CDInfo.h:178
CDClearanceMap m_clearanceMap
Map of detected clearances.
Definition: CDInfo.h:183
double m_minDist
Distance between Robot and closest obstacle.
Definition: CDInfo.h:176
int m_collidingObstIndex
Index for first discovered obstacle collision.
Definition: CDInfo.h:174
std::pair< int, int > CollisionPair
Definition: CDInfo.h:146
int m_nearestObstIndex
Index for closest obstacle.
Definition: CDInfo.h:175
CDInfo(const bool _retAllInfo=false)
Definition: CDInfo.cpp:155
bool operator<(const CDInfo &_cdInfo) const noexcept
Definition: CDInfo.cpp:177
void ResetVars(const bool _retAllInfo=false)
Definition: CDInfo.cpp:162