|
| | runSDFTest (checker) |
| | runSDFPositiveDistanceTest (checker) |
| | runSDFPairTest (checker) |
|
checker | addCollisionObject ("sdf_link", 0, sdf_shapes, poses, true) |
|
checker | addCollisionObject ("plane_link", 0, plane_shapes, poses, true) |
|
checker | setActiveCollisionObjects ({ "sdf_link", "plane_link" }) |
|
checker | setCollisionObjectsTransform (location) |
|
| EXPECT_THROW (checker.contactTest(result, ContactRequest(ContactTestType::CLOSEST)), std::runtime_error) |
|
const Eigen::AlignedBox3d | domain (Eigen::Vector3d::Constant(-1.0), Eigen::Vector3d::Constant(1.0)) |
|
| EXPECT_THROW (checker.addCollisionObject("sdf_link", 0, sdf_shapes, poses, true), std::invalid_argument) |
|
checker | addCollisionObject ("sdf_link", 0, CollisionShapesConst{ sdf }, poses, true) |
|
checker | addCollisionObject ("sphere_link", 0, CollisionShapesConst{ std::make_shared< tesseract::geometry::Sphere >(0.1) }, poses, true) |
|
checker | setActiveCollisionObjects ({ "sdf_link", "sphere_link" }) |
|
checker | setDefaultCollisionMargin (0.0) |
|
sphere_tf | translation ().x()=0.45 |
|
checker | setCollisionObjectsTransform ("sphere_link", sphere_tf) |
|
checker | contactTest (result, ContactRequest(ContactTestType::CLOSEST)) |
|
result | flattenMoveResults (result_vector) |
|
| ASSERT_EQ (result_vector.size(), 1) |
|
| EXPECT_NEAR (result_vector[0].distance, -0.15, 1e-3) |
|
| EXPECT_FALSE (sdf->isDiscretized()) |
|
| EXPECT_NEAR (result_vector[0].distance, -0.15, 2e-2) |
|
| EXPECT_EQ (calls, sampled) |
|
void | addCapsuleObjects (DiscreteContactManager &checker) |
|
void | runSDFCapsuleTest (DiscreteContactManager &checker) |
|
void | runSDFBoxTest (DiscreteContactManager &checker) |
| | runSDFCapsuleTest (checker) |
| | runSDFBoxTest (checker) |
|
void | runSDFCurvedPrimitiveTest (DiscreteContactManager &checker, const CollisionShapeConstPtr &primitive, const std::string &primitive_link) |
| | runSDFCurvedPrimitiveTest (checker, std::make_shared< tesseract::geometry::Cylinder >(0.1, 0.2), "cylinder_link") |
| | runSDFCurvedPrimitiveTest (checker, std::make_shared< tesseract::geometry::Cone >(0.1, 0.2), "cone_link") |
| | runSDFTest (checker, makeSparseSphereSDF) |
| | runSDFPositiveDistanceTest (checker, makeSparseSphereSDF) |
|
void | runSDFBandClampTest (DiscreteContactManager &checker) |
| | A narrow band says nothing past its band clamp. With the clamp a margin reaching past the band still measures the true separation, to the surface; without it the saturated values read as a flat distance with no direction.
|
| | runSDFBandClampTest (checker) |
|
| runSDFPairTest (checker, make_sdf, make_sdf) |
| | runSDFPairTest (checker, [] { return sparseSphereSDF(32);}, fineSphereSDF) |
| | runScaledSDFTest (checker, false) |
| | runScaledSDFTest (checker, true) |
|
| for (const auto &geom :{ field, dense }) |
|
| EXPECT_THROW (TesseractSdfCollisionShape(nullptr), std::invalid_argument) |
|
| EXPECT_EQ (shape->getShapeType(), SDF_SHAPE_PROXYTYPE) |
|
| EXPECT_STREQ (shape->getName(), "TesseractSdfCollisionShape") |
|
| EXPECT_NO_THROW (shape->setLocalScaling(btVector3(1, 1, 1))) |
|
| EXPECT_THROW (shape->setLocalScaling(btVector3(2, 2, 2)), std::invalid_argument) |
|
| EXPECT_EQ (shape->getLocalScaling(), btVector3(1, 1, 1)) |
|
btVector3 | inertia (1, 1, 1) |
|
shape | calculateLocalInertia (1, inertia) |
|
| EXPECT_EQ (inertia, btVector3(0, 0, 0)) |
|
shape | processAllTriangles (nullptr, btVector3(-1, -1, -1), btVector3(1, 1, 1)) |
|
const TesseractSdfCollisionShape | nan_shape (tesseract::geometry::createSignedDistanceField(nan_field, Eigen::Vector3d(-1, -1, -1), Eigen::Vector3d(1, 1, 1), Eigen::Vector3i(4, 4, 4))) |
|
| EXPECT_FALSE (nan_shape.queryDistance(btVector3(0, 0, 0), distance)) |
|
| EXPECT_FALSE (nan_shape.queryPoint(btVector3(0, 0, 0), distance, normal)) |
| bool | querySdfShapeContact (const btCollisionShape &shape, const btVector3 &local_point, btScalar max_distance, btScalar &distance, btVector3 &normal) |
| | Distance and normal at a point in an SDF shape's frame, but only if the distance is within max_distance (a contact threshold): the distance is read first and the normal only for points that pass. shape must be a TesseractSdfCollisionShape.
|
| bool | querySdfShapePoint (const btCollisionShape &shape, const btVector3 &local_point, btScalar &distance, btVector3 &normal) |
| | Distance and normal at a point in an SDF shape's frame. shape must be a TesseractSdfCollisionShape.
|
Discrete collision tests for the volumetric SignedDistanceField geometry against a sphere.
A signed distance field for a sphere of radius R centered at the origin is discretized at runtime and added to the Bullet and FCL backends, which both query it in place through the shared implicit solver. A probe is then placed at known locations and the reported contact distance is validated.
- License
- Software License Agreement (Apache License)
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0