29 #include <console_bridge/console.h>
30 #include <octomap/octomap.h>
47 const auto& s1 =
static_cast<const Box&
>(geom1);
48 const auto& s2 =
static_cast<const Box&
>(geom2);
50 if (std::abs(s1.getX() - s2.getX()) > std::numeric_limits<double>::epsilon())
53 if (std::abs(s1.getY() - s2.getY()) > std::numeric_limits<double>::epsilon())
56 if (std::abs(s1.getZ() - s2.getZ()) > std::numeric_limits<double>::epsilon())
63 const auto& s1 =
static_cast<const Sphere&
>(geom1);
64 const auto& s2 =
static_cast<const Sphere&
>(geom2);
66 if (std::abs(s1.getRadius() - s2.getRadius()) > std::numeric_limits<double>::epsilon())
73 const auto& s1 =
static_cast<const Cylinder&
>(geom1);
74 const auto& s2 =
static_cast<const Cylinder&
>(geom2);
76 if (std::abs(s1.getRadius() - s2.getRadius()) > std::numeric_limits<double>::epsilon())
79 if (std::abs(s1.getLength() - s2.getLength()) > std::numeric_limits<double>::epsilon())
86 const auto& s1 =
static_cast<const Cone&
>(geom1);
87 const auto& s2 =
static_cast<const Cone&
>(geom2);
89 if (std::abs(s1.getRadius() - s2.getRadius()) > std::numeric_limits<double>::epsilon())
92 if (std::abs(s1.getLength() - s2.getLength()) > std::numeric_limits<double>::epsilon())
99 const auto& s1 =
static_cast<const Capsule&
>(geom1);
100 const auto& s2 =
static_cast<const Capsule&
>(geom2);
102 if (std::abs(s1.getRadius() - s2.getRadius()) > std::numeric_limits<double>::epsilon())
105 if (std::abs(s1.getLength() - s2.getLength()) > std::numeric_limits<double>::epsilon())
112 const auto& s1 =
static_cast<const Plane&
>(geom1);
113 const auto& s2 =
static_cast<const Plane&
>(geom2);
115 if (std::abs(s1.getA() - s2.getA()) > std::numeric_limits<double>::epsilon())
118 if (std::abs(s1.getB() - s2.getB()) > std::numeric_limits<double>::epsilon())
121 if (std::abs(s1.getC() - s2.getC()) > std::numeric_limits<double>::epsilon())
124 if (std::abs(s1.getD() - s2.getD()) > std::numeric_limits<double>::epsilon())
131 const auto& s1 =
static_cast<const Mesh&
>(geom1);
132 const auto& s2 =
static_cast<const Mesh&
>(geom2);
134 if (s1.getVertexCount() != s2.getVertexCount())
137 if (s1.getFaceCount() != s2.getFaceCount())
140 if (s1.getFaces() != s2.getFaces())
143 if (s1.getVertices() != s2.getVertices())
150 const auto& s1 =
static_cast<const ConvexMesh&
>(geom1);
151 const auto& s2 =
static_cast<const ConvexMesh&
>(geom2);
153 if (s1.getVertexCount() != s2.getVertexCount())
156 if (s1.getFaceCount() != s2.getFaceCount())
159 if (s1.getFaces() != s2.getFaces())
162 if (s1.getVertices() != s2.getVertices())
169 const auto& s1 =
static_cast<const SDFMesh&
>(geom1);
170 const auto& s2 =
static_cast<const SDFMesh&
>(geom2);
172 if (s1.getVertexCount() != s2.getVertexCount())
175 if (s1.getFaceCount() != s2.getFaceCount())
178 if (s1.getFaces() != s2.getFaces())
181 if (s1.getVertices() != s2.getVertices())
188 const auto& s1 =
static_cast<const Octree&
>(geom1);
189 const auto& s2 =
static_cast<const Octree&
>(geom2);
191 const std::shared_ptr<const octomap::OcTree>& octree1 = s1.
getOctree();
192 const std::shared_ptr<const octomap::OcTree>& octree2 = s2.getOctree();
194 if (octree1->getTreeType() != octree2->getTreeType())
197 if (octree1->size() != octree2->size())
200 if (octree1->getTreeDepth() != octree2->getTreeDepth())
203 if (octree1->memoryUsage() != octree2->memoryUsage())
206 if (octree1->memoryFullGrid() != octree2->memoryFullGrid())
213 const auto& s1 =
static_cast<const PolygonMesh&
>(geom1);
214 const auto& s2 =
static_cast<const PolygonMesh&
>(geom2);
216 if (s1.getVertexCount() != s2.getVertexCount())
219 if (s1.getFaceCount() != s2.getFaceCount())
222 if (s1.getFaces() != s2.getFaces())
225 if (s1.getVertices() != s2.getVertices())
232 const auto& s1 =
static_cast<const CompoundMesh&
>(geom1);
233 const auto& s2 =
static_cast<const CompoundMesh&
>(geom2);
235 if (s1.getMeshes().size() != s2.getMeshes().size())
238 for (std::size_t i = 0; i < s1.getMeshes().size(); ++i)
240 if (!
isIdentical(*s1.getMeshes()[i], *s2.getMeshes()[i]))
248 CONSOLE_BRIDGE_logError(
"This geometric shape type (%d) is not supported",
static_cast<int>(geom1.
getType()));