Skip to content

Commit

Permalink
fix reference frame when setting link vel
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
  • Loading branch information
iche033 committed Feb 19, 2021
1 parent fcdd420 commit ba45184
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tpe/plugin/src/FreeGroupFeatures.cc
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,10 @@ void FreeGroupFeatures::SetFreeGroupWorldLinearVelocity(
auto linkIt = this->links.find(_groupID.id);
if (linkIt != this->links.end() && linkIt->second != nullptr)
{
math::Pose3d linkWorldPose = linkIt->second->link->GetWorldPose();
linkIt->second->link->SetLinearVelocity(
math::eigen3::convert(_linearVelocity));
linkWorldPose.Rot().Inverse() *
math::eigen3::convert( _linearVelocity));
}
}
}
Expand All @@ -175,7 +177,9 @@ void FreeGroupFeatures::SetFreeGroupWorldAngularVelocity(
auto linkIt = this->links.find(_groupID.id);
if (linkIt != this->links.end() && linkIt->second != nullptr)
{
math::Pose3d linkWorldPose = linkIt->second->link->GetWorldPose();
linkIt->second->link->SetAngularVelocity(
linkWorldPose.Rot().Inverse() *
math::eigen3::convert(_angularVelocity));
}
}
Expand Down

0 comments on commit ba45184

Please sign in to comment.