From c31fd246bc6845bf21388f4fd9a0b222bf60c7f4 Mon Sep 17 00:00:00 2001 From: Michael Ripperger Date: Mon, 16 Dec 2024 10:14:54 -0600 Subject: [PATCH 1/8] Add issue templates (#1082) --- .github/ISSUE_TEMPLATE/bug_report.md | 26 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 +++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000000..92d0662b331 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,26 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Version** +What version of `tesseract` are you using? Post a tag (e.g., `0.25.0`) or commit hash (e.g., `5ad42b6`) + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Describe the steps to reproduce the behavior: + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Operating System** +Ubuntu 22.04 + +**Relevant log output** +Paste relevant log output (no screenshots) into a Markdown block (i.e., \```...\```) diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000000..bbcbbe7d615 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. From 30ce2fe1c694155d3731dd5e6e59b3a175ef39c9 Mon Sep 17 00:00:00 2001 From: Michael Ripperger Date: Mon, 16 Dec 2024 10:46:16 -0600 Subject: [PATCH 2/8] Update bug report issue template (#1084) * Update bug report issue template * Updated Windows version specifications --- .github/ISSUE_TEMPLATE/bug_report.md | 60 ++++++++++++++++++++++------ 1 file changed, 47 insertions(+), 13 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 92d0662b331..2d7fcde8536 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -5,22 +5,56 @@ title: '' labels: '' assignees: '' ---- +body: + - type: input + attributes: + label: Version + description: What version of `tesseract` are you using? + placeholder: Post a tag (e.g., `0.25.0`) or commit hash (e.g., `5ad42b6`) + validations: + required: True -**Version** -What version of `tesseract` are you using? Post a tag (e.g., `0.25.0`) or commit hash (e.g., `5ad42b6`) + - type: dropdown + attributes: + label: OS Version + description: What OS version are you running? + options: + - Ubuntu 20.04 + - Ubuntu 22.04 + - Ubuntu 24.04 + - MacOS 12 + - MacOS 14 + - Windows (MSVC 2019) + - Windows (MSVC 2022) + - Other (please specify in the bug description) + validations: + required: True -**Describe the bug** -A clear and concise description of what the bug is. + - type: textarea + attributes: + label: Describe the bug + placeholder: | + A clear and concise description of the bug + validations: + required: True -**To Reproduce** -Describe the steps to reproduce the behavior: + - type: textarea + attributes: + label: To Reproduce + placeholder: | + Describe the steps to reproduce the behavior -**Expected behavior** -A clear and concise description of what you expected to happen. + - type: textarea + attributes: + label: Expected behavior + value: | + A clear and concise description of what you expected to happen. -**Operating System** -Ubuntu 22.04 + - type: textarea + attributes: + label: Relevant log output + placeholder: | + Paste log output here + render: bash -**Relevant log output** -Paste relevant log output (no screenshots) into a Markdown block (i.e., \```...\```) +--- From e96e28117742684a9a0d3f518c8f8452074b9792 Mon Sep 17 00:00:00 2001 From: Michael Ripperger Date: Mon, 16 Dec 2024 10:49:05 -0600 Subject: [PATCH 3/8] Update bug_report.md (#1085) --- .github/ISSUE_TEMPLATE/bug_report.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 2d7fcde8536..e6a1354f62d 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,4 +1,3 @@ ---- name: Bug report about: Create a report to help us improve title: '' @@ -56,5 +55,3 @@ body: placeholder: | Paste log output here render: bash - ---- From 0898dc0bb102c2905c0a317d2f5c1295120fa1fe Mon Sep 17 00:00:00 2001 From: Michael Ripperger Date: Mon, 16 Dec 2024 10:53:35 -0600 Subject: [PATCH 4/8] Changed file extension of bug report to yml (#1086) --- .github/ISSUE_TEMPLATE/{bug_report.md => bug-report.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/ISSUE_TEMPLATE/{bug_report.md => bug-report.yml} (100%) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug-report.yml similarity index 100% rename from .github/ISSUE_TEMPLATE/bug_report.md rename to .github/ISSUE_TEMPLATE/bug-report.yml From 6aabd9f462601afb3a33c0704c88d218cfc032dc Mon Sep 17 00:00:00 2001 From: Michael Ripperger Date: Mon, 16 Dec 2024 11:10:19 -0600 Subject: [PATCH 5/8] Fix issue templates (#1087) * Fixed bug report * Converted feature request template to YAML * Minor updates to issue templates --- .github/ISSUE_TEMPLATE/bug-report.yml | 24 ++++++++-------- .github/ISSUE_TEMPLATE/feature-request.yml | 32 ++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 -------------- 3 files changed, 44 insertions(+), 32 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/feature-request.yml delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index e6a1354f62d..3ad882cc8f9 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -1,9 +1,5 @@ -name: Bug report -about: Create a report to help us improve -title: '' -labels: '' -assignees: '' - +name: Bug Report +description: Create a report to help us improve body: - type: input attributes: @@ -26,8 +22,8 @@ body: - Windows (MSVC 2019) - Windows (MSVC 2022) - Other (please specify in the bug description) - validations: - required: True + validations: + required: True - type: textarea attributes: @@ -40,18 +36,22 @@ body: - type: textarea attributes: label: To Reproduce - placeholder: | + placeholder: | Describe the steps to reproduce the behavior + validations: + required: True - type: textarea attributes: label: Expected behavior - value: | + placeholder: | A clear and concise description of what you expected to happen. + validations: + required: True - type: textarea attributes: label: Relevant log output placeholder: | - Paste log output here - render: bash + Paste any relevant log output here (will be rendered as shell text) + render: shell diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml new file mode 100644 index 00000000000..3c90dccf65e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -0,0 +1,32 @@ +name: Feature Request +description: Suggest an idea for this project +body: + - type: textarea + attributes: + label: Is your feature request related to a problem? Please describe. + placeholder: | + A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + validations: + required: True + + - type: textarea + attributes: + label: Describe the solution you'd like + placeholder: | + A clear and concise description of what you want to happen. + validations: + required: True + + - type: textarea + attributes: + label: Describe alternatives you've considered + placeholder: | + A clear and concise description of any alternative solutions or features you've considered. + validations: + required: True + + - type: textarea + attributes: + label: Additional context + placeholder: | + Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index bbcbbe7d615..00000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: '' -assignees: '' - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. From 4de12afca33cb1626c98e0d1e7125a5c06fa4c2b Mon Sep 17 00:00:00 2001 From: Levi Armstrong Date: Sun, 15 Dec 2024 11:59:34 -0600 Subject: [PATCH 6/8] Fix use of compound mesh in FCL --- .../bullet/src/bullet_utils.cpp | 3 ++- .../fcl/fcl_collision_object_wrapper.h | 15 +++++++++++++ .../tesseract_collision/fcl/fcl_utils.h | 7 +++---- .../fcl/src/fcl_collision_object_wrapper.cpp | 8 +++++++ tesseract_collision/fcl/src/fcl_utils.cpp | 21 +++++++------------ .../collision_compound_mesh_sphere_unit.hpp | 4 ++-- 6 files changed, 38 insertions(+), 20 deletions(-) diff --git a/tesseract_collision/bullet/src/bullet_utils.cpp b/tesseract_collision/bullet/src/bullet_utils.cpp index 21dc4e338ba..c5aaf8a558a 100644 --- a/tesseract_collision/bullet/src/bullet_utils.cpp +++ b/tesseract_collision/bullet/src/bullet_utils.cpp @@ -472,10 +472,11 @@ CollisionObjectWrapper::CollisionObjectWrapper(std::string name, { if (m_shapes[j]->getType() == tesseract_geometry::GeometryType::COMPOUND_MESH) { + int shape_index = shape_id++; const auto& meshes = std::static_pointer_cast(m_shapes[j])->getMeshes(); for (const auto& mesh : meshes) { - std::shared_ptr subshape = createShapePrimitive(mesh, this, shape_id++); + std::shared_ptr subshape = createShapePrimitive(mesh, this, shape_index); if (subshape != nullptr) { manage(subshape); diff --git a/tesseract_collision/fcl/include/tesseract_collision/fcl/fcl_collision_object_wrapper.h b/tesseract_collision/fcl/include/tesseract_collision/fcl/fcl_collision_object_wrapper.h index 860c03016a3..3d901c9e105 100644 --- a/tesseract_collision/fcl/include/tesseract_collision/fcl/fcl_collision_object_wrapper.h +++ b/tesseract_collision/fcl/include/tesseract_collision/fcl/fcl_collision_object_wrapper.h @@ -64,8 +64,23 @@ class FCLCollisionObjectWrapper : public fcl::CollisionObject */ void updateAABB(); + /** + * @brief Set the shape index. This is the geometries index in the urdf. + * @param index The index + */ + void setShapeIndex(int index); + + /** + * @brief Get the shape index. This is the geometries index in the urdf. + * @return The shape index + */ + int getShapeIndex() const; + protected: double contact_distance_{ 0 }; /**< @brief The contact distance threshold. */ + + /** @brief The shape index, which is the geometries index in the urdf. */ + int shape_index_{ -1 }; }; } // namespace tesseract_collision::tesseract_collision_fcl diff --git a/tesseract_collision/fcl/include/tesseract_collision/fcl/fcl_utils.h b/tesseract_collision/fcl/include/tesseract_collision/fcl/fcl_utils.h index 8803c4a6b94..9ad71682ce2 100644 --- a/tesseract_collision/fcl/include/tesseract_collision/fcl/fcl_utils.h +++ b/tesseract_collision/fcl/include/tesseract_collision/fcl/fcl_utils.h @@ -113,10 +113,9 @@ class CollisionObjectWrapper void setCollisionObjectsTransform(const Eigen::Isometry3d& pose) { world_pose_ = pose; - for (unsigned i = 0; i < collision_objects_.size(); ++i) + for (auto& co : collision_objects_) { - CollisionObjectPtr& co = collision_objects_[i]; - co->setTransform(pose * shape_poses_[i]); + co->setTransform(pose * shape_poses_[static_cast(co->getShapeIndex())]); co->updateAABB(); // This a tesseract function that updates abb to take into account contact distance } } @@ -168,7 +167,7 @@ class CollisionObjectWrapper * @param co fcl collision shape * @return links collision shape index */ - int getShapeIndex(const fcl::CollisionObjectd* co) const; + static int getShapeIndex(const fcl::CollisionObjectd* co); protected: std::string name_; // name of the collision object diff --git a/tesseract_collision/fcl/src/fcl_collision_object_wrapper.cpp b/tesseract_collision/fcl/src/fcl_collision_object_wrapper.cpp index b452e488779..c6f823c6c70 100644 --- a/tesseract_collision/fcl/src/fcl_collision_object_wrapper.cpp +++ b/tesseract_collision/fcl/src/fcl_collision_object_wrapper.cpp @@ -54,4 +54,12 @@ void FCLCollisionObjectWrapper::updateAABB() } } +void FCLCollisionObjectWrapper::setShapeIndex(int index) { shape_index_ = index; } + +int FCLCollisionObjectWrapper::getShapeIndex() const +{ + assert(shape_index_ >= 0); + return shape_index_; +} + } // namespace tesseract_collision::tesseract_collision_fcl diff --git a/tesseract_collision/fcl/src/fcl_utils.cpp b/tesseract_collision/fcl/src/fcl_utils.cpp index b2cac88505d..b310ef484d4 100644 --- a/tesseract_collision/fcl/src/fcl_utils.cpp +++ b/tesseract_collision/fcl/src/fcl_utils.cpp @@ -246,8 +246,8 @@ bool collisionCallback(fcl::CollisionObjectd* o1, fcl::CollisionObjectd* o2, voi ContactResult contact; contact.link_names[0] = cd1->getName(); contact.link_names[1] = cd2->getName(); - contact.shape_id[0] = static_cast(cd1->getShapeIndex(o1)); - contact.shape_id[1] = static_cast(cd2->getShapeIndex(o2)); + contact.shape_id[0] = CollisionObjectWrapper::getShapeIndex(o1); + contact.shape_id[1] = CollisionObjectWrapper::getShapeIndex(o2); contact.subshape_id[0] = static_cast(fcl_contact.b1); contact.subshape_id[1] = static_cast(fcl_contact.b2); contact.nearest_points[0] = fcl_contact.pos; @@ -307,8 +307,8 @@ bool distanceCallback(fcl::CollisionObjectd* o1, fcl::CollisionObjectd* o2, void ContactResult contact; contact.link_names[0] = cd1->getName(); contact.link_names[1] = cd2->getName(); - contact.shape_id[0] = cd1->getShapeIndex(o1); - contact.shape_id[1] = cd2->getShapeIndex(o2); + contact.shape_id[0] = CollisionObjectWrapper::getShapeIndex(o1); + contact.shape_id[1] = CollisionObjectWrapper::getShapeIndex(o2); contact.subshape_id[0] = static_cast(fcl_result.b1); contact.subshape_id[1] = static_cast(fcl_result.b2); contact.nearest_points[0] = fcl_result.nearest_points[0]; @@ -365,6 +365,7 @@ CollisionObjectWrapper::CollisionObjectWrapper(std::string name, collision_geometries_.push_back(subshape); auto co = std::make_shared(subshape); co->setUserData(this); + co->setShapeIndex(static_cast(i)); co->setTransform(shape_poses_[i]); co->updateAABB(); collision_objects_.push_back(co); @@ -380,6 +381,7 @@ CollisionObjectWrapper::CollisionObjectWrapper(std::string name, collision_geometries_.push_back(subshape); auto co = std::make_shared(subshape); co->setUserData(this); + co->setShapeIndex(static_cast(i)); co->setTransform(shape_poses_[i]); co->updateAABB(); collision_objects_.push_back(co); @@ -389,16 +391,9 @@ CollisionObjectWrapper::CollisionObjectWrapper(std::string name, } } -int CollisionObjectWrapper::getShapeIndex(const fcl::CollisionObjectd* co) const +int CollisionObjectWrapper::getShapeIndex(const fcl::CollisionObjectd* co) { - auto it = std::find_if(collision_objects_.begin(), collision_objects_.end(), [&co](const CollisionObjectPtr& c) { - return c.get() == co; - }); - - if (it != collision_objects_.end()) - return static_cast(std::distance(collision_objects_.begin(), it)); - - return -1; + return static_cast(co)->getShapeIndex(); } } // namespace tesseract_collision::tesseract_collision_fcl diff --git a/tesseract_collision/test_suite/include/tesseract_collision/test_suite/collision_compound_mesh_sphere_unit.hpp b/tesseract_collision/test_suite/include/tesseract_collision/test_suite/collision_compound_mesh_sphere_unit.hpp index 0c2caee3d74..84812daf7e7 100644 --- a/tesseract_collision/test_suite/include/tesseract_collision/test_suite/collision_compound_mesh_sphere_unit.hpp +++ b/tesseract_collision/test_suite/include/tesseract_collision/test_suite/collision_compound_mesh_sphere_unit.hpp @@ -177,7 +177,7 @@ inline void runTest(DiscreteContactManager& checker) EXPECT_NEAR(result_vector[0].normal[2], idx[2] * -1.0, 0.001); // Compound mesh so check shape id - EXPECT_EQ(result_vector[0].shape_id[static_cast(idx[0])], 1); + EXPECT_EQ(result_vector[0].shape_id[static_cast(idx[0])], 0); //////////////////////////////////////////////// // Test object is out side the contact distance @@ -235,7 +235,7 @@ inline void runTest(DiscreteContactManager& checker) EXPECT_NEAR(result_vector[0].normal[2], idx[2] * -1.0, 0.001); // Compound mesh so check shape id - EXPECT_EQ(result_vector[0].shape_id[static_cast(idx[0])], 1); + EXPECT_EQ(result_vector[0].shape_id[static_cast(idx[0])], 0); ///////////////////////////////////////////// // Test collision against second shape From 8a00cc850b4005542145634459fde91be9e5fead Mon Sep 17 00:00:00 2001 From: Levi Armstrong Date: Mon, 16 Dec 2024 18:45:57 -0600 Subject: [PATCH 7/8] Update Mac CI to use mac-13 --- .github/workflows/mac.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 07e6c63ad44..7aeba4f767b 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -35,7 +35,7 @@ jobs: fail-fast: false matrix: config: - - runner: macos-12 + - runner: macos-13 vcpkg_triplet: x64-osx-dynamic-release arch: x64 homebrew_root: /usr/local From 6757445ad86a5e4af3309301d797627b8b6d99ef Mon Sep 17 00:00:00 2001 From: Roelof Oomen Date: Wed, 18 Dec 2024 15:28:07 +0100 Subject: [PATCH 8/8] Simplify shape_id counter --- tesseract_collision/bullet/src/bullet_utils.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tesseract_collision/bullet/src/bullet_utils.cpp b/tesseract_collision/bullet/src/bullet_utils.cpp index c5aaf8a558a..04dc3ac9d49 100644 --- a/tesseract_collision/bullet/src/bullet_utils.cpp +++ b/tesseract_collision/bullet/src/bullet_utils.cpp @@ -467,16 +467,14 @@ CollisionObjectWrapper::CollisionObjectWrapper(std::string name, // effect when negative setCollisionShape(compound.get()); - int shape_id{ 0 }; for (std::size_t j = 0; j < m_shapes.size(); ++j) { if (m_shapes[j]->getType() == tesseract_geometry::GeometryType::COMPOUND_MESH) { - int shape_index = shape_id++; const auto& meshes = std::static_pointer_cast(m_shapes[j])->getMeshes(); for (const auto& mesh : meshes) { - std::shared_ptr subshape = createShapePrimitive(mesh, this, shape_index); + std::shared_ptr subshape = createShapePrimitive(mesh, this, static_cast(j)); if (subshape != nullptr) { manage(subshape); @@ -487,7 +485,7 @@ CollisionObjectWrapper::CollisionObjectWrapper(std::string name, } else { - std::shared_ptr subshape = createShapePrimitive(m_shapes[j], this, shape_id++); + std::shared_ptr subshape = createShapePrimitive(m_shapes[j], this, static_cast(j)); if (subshape != nullptr) { manage(subshape);