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

Simplify the logic for applying link wrenches #127

Closed
diegoferigo opened this issue Feb 1, 2020 · 4 comments · Fixed by #158
Closed

Simplify the logic for applying link wrenches #127

diegoferigo opened this issue Feb 1, 2020 · 4 comments · Fixed by #158

Comments

@diegoferigo
Copy link
Member

As soon as ignitionrobotics/ign-gazebo#509 will be merged, we can simplify a lot the logic to apply link wrenches introduced in #124.

@diegoferigo diegoferigo changed the title Simplify the logic to apply of link wrenches Simplify the logic for applying link wrenches Feb 1, 2020
@traversaro
Copy link
Member

traversaro commented Feb 1, 2020

As usual, pay attention to the details on how this quantities are expressed, see https://bitbucket.org/ignitionrobotics/ign-gazebo/pull-requests/509/added-link-addworldwrench/diff#comment-134092323 .
cc @paolo-viceconte

@raffaello-camoriano
Copy link
Collaborator

As usual, pay attention to the details on how this quantities are expressed, see https://bitbucket.org/ignitionrobotics/ign-gazebo/pull-requests/509/added-link-addworldwrench/diff#comment-134092323 .
cc @paolo-viceconte

So at the current stage AddWorldForce is not compliant with screw theory standards. What about other uses of wrenches in gazebo-ign, are they compliant?
Please let us know if they clarify whether the application point is the link CoM. Thank you!

@diegoferigo diegoferigo added this to the v1.0 milestone Feb 5, 2020
@diegoferigo
Copy link
Member Author

As usual, pay attention to the details on how this quantities are expressed

Yes thanks for pointing it out. Using the low-level component, the wrench is applied to the frame of the link. Instead, using these helpers, forces are applied to the center of mass.

In general, the CoM is more intuitive since it is not dependent on how the model has been designed. As soon as the upstream PR get merged and we port our code to use the Link helper, we should also change the Python documentation from link frame to CoM (before freezing the APIs 🙂).

@diegoferigo
Copy link
Member Author

The new ScenarI/O APIs of #158 refactored also the logic for applying link wrenches:

bool Link::applyWorldForce(const std::array<double, 3>& force,
const double duration)
{
return this->applyWorldWrench(force, {0, 0, 0}, duration);
}
bool Link::applyWorldTorque(const std::array<double, 3>& torque,
const double duration)
{
return this->applyWorldWrench({0, 0, 0}, torque, duration);
}
bool Link::applyWorldWrench(const std::array<double, 3>& force,
const std::array<double, 3>& torque,
const double duration)

Now all the methods call Link::applyWorldWrench that applies a wrench to the CoM of the link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment