Skip to content

Commit 422564c

Browse files
rjoomenclaude
andcommitted
Update the OMPL validators to the parallel-array transform setter
Gather the active set into thread-local buffers and call the id-typed parallel-array setter, restoring active-only and fail-loud semantics while keeping the Coal/FCL batching. Replaces the whole-map call. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent f714f44 commit 422564c

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

motion_planners/ompl/src/continuous_motion_validator.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,19 @@ bool ContinuousMotionValidator::continuousCollisionCheck(const ompl::base::State
149149
TESSERACT_THREAD_LOCAL tesseract::common::LinkIdTransformMap state1;
150150
manip_->calcFwdKin(state1, finish_joints);
151151

152-
cm->setCollisionObjectsTransform(state0, state1);
152+
TESSERACT_THREAD_LOCAL tesseract::common::VectorIsometry3d poses0;
153+
TESSERACT_THREAD_LOCAL tesseract::common::VectorIsometry3d poses1;
154+
poses0.clear();
155+
poses1.clear();
156+
poses0.reserve(link_ids_.size());
157+
poses1.reserve(link_ids_.size());
158+
for (const auto& id : link_ids_)
159+
{
160+
poses0.push_back(state0.at(id));
161+
poses1.push_back(state1.at(id));
162+
}
163+
164+
cm->setCollisionObjectsTransform(link_ids_, poses0, poses1);
153165

154166
tesseract::collision::ContactResultMap contact_map;
155167
cm->contactTest(contact_map, tesseract::collision::ContactTestType::FIRST);

motion_planners/ompl/src/state_collision_validator.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,13 @@ bool StateCollisionValidator::isValid(const ompl::base::State* state) const
7777
TESSERACT_THREAD_LOCAL tesseract::common::LinkIdTransformMap state1;
7878
manip_->calcFwdKin(state1, finish_joints);
7979

80-
cm->setCollisionObjectsTransform(state1);
80+
TESSERACT_THREAD_LOCAL tesseract::common::VectorIsometry3d poses;
81+
poses.clear();
82+
poses.reserve(link_ids_.size());
83+
for (const auto& id : link_ids_)
84+
poses.push_back(state1.at(id));
85+
86+
cm->setCollisionObjectsTransform(link_ids_, poses);
8187

8288
tesseract::collision::ContactResultMap contact_map;
8389
cm->contactTest(contact_map, tesseract::collision::ContactTestType::FIRST);

0 commit comments

Comments
 (0)