Skip to content

Commit

Permalink
Add restitution coefficient support for bouncing
Browse files Browse the repository at this point in the history
Signed-off-by: Diego Ferigo <diego.ferigo@iit.it>
  • Loading branch information
diegoferigo committed Oct 21, 2020
1 parent 068425f commit f370ea6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions dartsim/src/SDFFeatures.cc
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,16 @@ Identity SDFFeatures::ConstructSdfCollision(
math::Vector3d fdir1 = odeFriction->Get<math::Vector3d>("fdir1");
aspect->setFirstFrictionDirection(math::eigen3::convert(fdir1));
}

const auto &surfaceBounce = _collision.Element()
->GetElement("surface")
->GetElement("bounce");

if (surfaceBounce->HasElement("restitution_coefficient"))
{
aspect->setRestitutionCoeff(
surfaceBounce->Get<double>("restitution_coefficient"));
}
#else
// We are setting the friction coefficient of a collision element
// to be the coefficient for the whole link. If there are multiple collision
Expand Down

0 comments on commit f370ea6

Please sign in to comment.