-
Notifications
You must be signed in to change notification settings - Fork 486
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
SimbodyLink: add and set force and torque #3262
base: gazebo11
Are you sure you want to change the base?
Conversation
The following methods are now implemented in the SimbodyLink class: - AddForce - AddRelativeForce - AddForceAtWorldPosition - AddForceAtRelativePosition - AddLinkForce - AddTorque - AddRelativeTorque Additionally, the implementation of the SetForce, and SetTorque methods was modified to ensure that setting the force applied to the body do not alter the torque currently applied to the body and vice versa. In order to test the above methods, the AddForce test of the physics_link integration tests is now enabled for Simbody. Solves issue gazebosim#1478.
@scpeters Could you please review this PR? |
{ | ||
gzerr << "Not implemented.\n"; | ||
auto const worldForce = this->WorldPose().Rot().RotateVector(_force); | ||
this->AddTorque(worldForce); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused why we would call AddTorque
from the AddRelativeForce
method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry, this is a mistake I made. Line 519 should be a call to this->AddForce. I fixed this in the latest commit.
The implementation of the SimbodyLink::AddRelativeForce was incorrectly calling the AddTorque method. This commit changes the implementation to call AddForce instead.
Any updates on this? |
sorry I haven't had a chance to finish my review, but I'll try to take a look this week |
@jeduardo211 Can you rebase to the latest gazebo11 dev? |
This PR adds the implementation of methods for applying forces and torques to links when using the Simbody physics engine.
The following methods are now implemented in the SimbodyLink class:
Additionally, the implementation of the SetForce, and SetTorque methods was modified to ensure that setting the force applied to the body do not alter the torque currently applied to the body and vice versa.
In order to test the above methods, the AddForce test of the physics_link integration tests is now enabled for Simbody. Please note that Simbody required an additional step to update the pose of the link and its inertial origin, and thus the AddForce test was modified to reflect this.
Note: The OnWrenchMsg test is still disabled for Simbody.
There is an easy way to enable this test, by adding a "auto_reset_forces" parameter to the SimbodyPhysics and checking the value of this parameter in the SimbodyPhysics::UpdatePhysics method to determine if the forces and torques applied should be cleared before the next step.
However, the SimbodyPhysics class is not following the PIMPL pattern, and thus adding this parameter would introduce breaking changes in the API. Because of this these modifications were not included and the OnWrenchMsg test remains disabled for simbody.
If this change is acceptable please advise and I will create a new PR to enable this test.
Solves issue #1478.