-
Notifications
You must be signed in to change notification settings - Fork 41
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
Add GetJointTransmittedWrench feature #283
Conversation
Codecov Report
@@ Coverage Diff @@
## main #283 +/- ##
==========================================
+ Coverage 75.52% 75.54% +0.02%
==========================================
Files 127 127
Lines 5597 5655 +58
==========================================
+ Hits 4227 4272 +45
- Misses 1370 1383 +13
Continue to review full report at Codecov.
|
@@ -56,6 +56,10 @@ namespace ignition | |||
using AngularVector = Vector<Scalar, (Dim*(Dim-1))/2>; | |||
IGN_PHYSICS_MAKE_ALL_TYPE_COMBOS(AngularVector) | |||
|
|||
template <typename Scalar, std::size_t Dim> | |||
using Wrench = Vector<Scalar, Dim + (Dim*(Dim-1))/2>; | |||
IGN_PHYSICS_MAKE_ALL_TYPE_COMBOS(Wrench) |
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.
is there an advantage to using a single vector over std::pair<LinearVector, AngularVector>
or a struct? I would have trouble remembering if the linear or angular part of the wrench came first.
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.
Switched to a struct in 1bd5c00
Just to understand, why is this needed to create a Force/Torque sensor? Most simulators already directly expose the joint force/torque that the child joint is applying to the parent joint, already including the constraint forces, the applied forces and anything else that could be necessary. I am probably missing something, but I don't see the advantage of computing/reading from the physics engine the "motor" joint force, the constraint force/torque and then adding them back at high level when most physics engines already provide directly this info. |
The current API When thinking of joint force/torque sensing, two applications come to mind: force/impedance control and 6 axis Force/Torque sensor. For the first one, for example we'd use revolute joints and would want to know the "measured" joint torque in the DOF of the joint. For this, I think the
I'm not sure I understand when you say "adding them back at high level". Are you saying users would want the two results added together? |
Sorry, I definitely was not clear. If we want to implement the same semantics described in the last section of http://gazebosim.org/tutorials?tut=force_torque_sensor&cat=sensors, the FT sensor that is mounted so close to the revolute joint so that it is possible to ignore the flange and avoid to model it as a fixed joint, and can be modeled directly as a FT sensor on the revolute joint, is able to read the Force/Torque that is caused by two causes:
If you need to simulate a FT sensor attached to a revolute joint, you need to sum this two contributions. However, I think that alternativly we can just expose |
I've used the term |
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 still reviewing the test but have some suggestions for the API documentation in the meantime
Signed-off-by: Addisu Z. Taddese <[email protected]>
8709364
to
e9c5b3d
Compare
Retargetted to |
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.
still reviewing the test, will get back to it after my next meeting
<diffuse>0.8 0.8 0.8 1</diffuse> | ||
</material> | ||
</visual> | ||
<!-- Using 4 spheres as contact points to ensure stable constraint force readings --> |
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 would expect 3 spheres to be more stable than 4 with planar contact, but this is fine
Signed-off-by: Steve Peters <[email protected]>
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 updated the sign convention and some test comments in 7bd1556
Signed-off-by: Steve Peters <[email protected]>
Thanks for those fixes @scpeters! |
🎉 New feature
Relates to #16, #124, and #143
Summary
This adds a new feature that exposes the transmitted forces on a joint, which are needed for creating a Force/Torque sensor. The computation of the wrench is similar to what's done in Gazebo-classic, but in Gazebo-classic, the wrench is expressed in the child body frame, but applied at the joint origin. Here, the wrench is expressed in the joint frame and applied at the joint origin.
This also adds a new quantity
Wrench
, which is a stacking of Angular and Linear vectors.TODO
RelativeQuantity
that corresponds toWrench
[ ] Ensure that applied force is not included in the computed wrench.Test it
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge