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

dartsim: fdir1 expressed_in frame from SDFormat #224

Merged
merged 7 commits into from
Mar 24, 2021
Merged
Changes from 5 commits
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
12 changes: 11 additions & 1 deletion dartsim/src/SDFFeatures.cc
Original file line number Diff line number Diff line change
Expand Up @@ -773,8 +773,18 @@ Identity SDFFeatures::ConstructSdfCollision(
}
if (odeFriction->HasElement("fdir1"))
{
math::Vector3d fdir1 = odeFriction->Get<math::Vector3d>("fdir1");
auto frictionDirectionElem = odeFriction->GetElement("fdir1");
math::Vector3d fdir1 = frictionDirectionElem->Get<math::Vector3d>();
aspect->setFirstFrictionDirection(math::eigen3::convert(fdir1));

const std::string kExpressedIn = "ignition:expressed_in";
if (frictionDirectionElem->HasAttribute(kExpressedIn))
{
auto skeleton = bn->getSkeleton();
auto directionFrameBodyNode = skeleton->getBodyNode(
frictionDirectionElem->Get<std::string>(kExpressedIn));
aspect->setFirstFrictionDirectionFrame(directionFrameBodyNode);
}
}

const auto &surfaceBounce = _collision.Element()
Expand Down