Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support setting max contacts in dart's bullet collision detector #593

Merged
merged 6 commits into from
Dec 20, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
simplified cast
Signed-off-by: Ian Chen <ichen@openrobotics.org>
  • Loading branch information
iche033 committed Dec 19, 2024
commit f708237a61aa5202e72d6e45405db2fe90942ecd
18 changes: 7 additions & 11 deletions dartsim/src/WorldFeatures.cc
Original file line number Diff line number Diff line change
Expand Up @@ -126,22 +126,18 @@ std::size_t WorldFeatures::GetWorldCollisionPairMaxContacts(
auto world = this->ReferenceInterface<dart::simulation::World>(_id);
auto collisionDetector =
world->getConstraintSolver()->getCollisionDetector();
auto odeCollisionDetector =
std::dynamic_pointer_cast<dart::collision::GzOdeCollisionDetector>(

auto gzCollisionDetector =
std::dynamic_pointer_cast<dart::collision::GzCollisionDetector>(
collisionDetector);
if (odeCollisionDetector)
if (gzCollisionDetector)
{
return odeCollisionDetector->GetCollisionPairMaxContacts();
return gzCollisionDetector->GetCollisionPairMaxContacts();
}
else
{
auto bulletCollisionDetector =
std::dynamic_pointer_cast<dart::collision::GzBulletCollisionDetector>(
collisionDetector);
if (bulletCollisionDetector)
{
return bulletCollisionDetector->GetCollisionPairMaxContacts();
}
gzwarn << "Currently max contacts feature is only supported by the "
<< "bullet and ode collision detector in dartsim." << std::endl;
}

return 0u;
Expand Down
Loading