-
Notifications
You must be signed in to change notification settings - Fork 478
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
Force Torque sensor (ForceTorqueSensor.cc) does not take into account sensor pose #940
Comments
Original comment by Silvio Traversaro (Bitbucket: traversaro). Just to articulate more on this issue: the SDF format documentation states that a ForceTorque sensor is described in SDF by a <force_torque> tag [1], that has an optional tag. This tag has "parent" as a default value (so it is reasonable to suppose that the other possible value for it is "child"). Apparently this frame tag is not taken into account in the ForceTorqueSensor [2], that simply returns the body2force/torque elements of the JointWrench object returned by GetForceTorque(). From the JointWrench [3] documentation apparently this body2force/torque is expressed in the joint Frame, while in GetForceTorque() documentation [4] it appears that it is the ForceTorque applied by the body2 on body1 expressed in the child Frame. It is also not clear to me the point with respect to which the torque is expressed, but I assume that this point is the joint origin. I can commit time to fix this issue (and prepare a regression test) as soon as the semantics of the <force_torque> tag (and relative ) and of GetForceTorque() method are clarified. [1] : http://gazebosim.org/sdf/dev.html#force_torque354 [2] : https://github.com/osrf/gazebo/blob/master/gazebo/sensors/ForceTorqueSensor.cc [3] : http://gazebosim.org/api/dev/classgazebo_1_1physics_1_1JointWrench.html [4] : http://gazebosim.org/api/dev/classgazebo_1_1physics_1_1Joint.html#a924807d32ef42bd741911ff33e7f3d53 |
Original comment by Nate Koenig (Bitbucket: Nathan Koenig). Indeed, the The |
Original comment by Silvio Traversaro (Bitbucket: traversaro). Thanks for the reply. Given that the To completely define a real 6-axis Force Torque sensor, assuming that a link frame is appropriately placed to match the sensor orientation, two additional information are needed:
|
Original comment by Nate Koenig (Bitbucket: Nathan Koenig). Thanks for the correction, the ForceTorque sensor is a child of You are also correct about the point about which the torque is expressed. The joint origin is the assumed point. Your last bullet point would require another SDF tag. It's easy to add a tag. Do you have a suggestion for a name? To recap, we have:
|
Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters). To me, it makes the most sense to use the |
Original comment by Nate Koenig (Bitbucket: Nathan Koenig). Could you explain the use of |
Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters). Typically the
As an initial implementation, I would say we should express the wrench on the child link and in a frame offset from the joint frame. I think that's the simplest and most consistent approach that doesn't involve any new parameters. I would try implementing that first and see if it's sufficient, and add new parameters if there's a compelling reason to do so. |
Original comment by John Hsu (Bitbucket: hsu, GitHub: hsu). I think I like the
|
Original comment by Silvio Traversaro (Bitbucket: traversaro). I'll try to argue why having a parameter describing the direction of the force/torque is really handy in real use cases. The use case I was thinking of is not the simulation of Joint Torque sensors (i.e. strain gauges mounted on a link near to a joint), but simulation of 6-axis Force/Torque (FT) sensors mounted in the middle of a link. Consider for example the case of this FT sensor mounted in the middle of the end/effector link of an industrial robot (a typical setup for force control): To properly simulate this setup, we have to describe the 6-axis F/T sensor as a fixed joint (i.e. in gazebo a revolute joint with 0 max and min limits). The direction of the measured force/torque depends on internal F/T sensor configuration and on how the F/T sensor is mounted on the robot, but it is safe to assume that this cannot be changed on the real robot (for example for backward compatibility with existing software). If is not possible to specify Force/Torque direction in the SDF sensor description, it is then necessary to account for this real/simulation mismatch in the middleware interface (if any) or user software. This is not convenient because it is then impossible to test exactly the same software in simulation and on the real robot. Furthermore this will make the SDF an incomplete description of the robot, that requires additional information to properly describe the real world robot. |
Original comment by Nate Koenig (Bitbucket: Nathan Koenig). @scpeters Your suggestion would only move the frame of the force-torque sensor, it would not specify the @traversaro , can you suggest SDF tags that you'd like to add or remove? |
Original comment by Silvio Traversaro (Bitbucket: traversaro). I suggest to name the additional child tag A more verbose alternative could be Its value must be one of the following:
|
Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters). @traversaro Thanks for the detailed explanation. I had been thinking that you could switch the parent/child relationship of the joint to change the directionality of the sensor, but that's not a good idea now that I think about it. I like |
Original comment by Silvio Traversaro (Bitbucket: traversaro). @scpeters yes, requiring to invert the joint to change the direction of the sensor would be quite tedious to do if you import the model from urdf (that is a requirement for us because our inertial parameter identification software outputs its results in a urdf model). I did a first try on solving this issue in my branch issue_940: https://bitbucket.org/traversaro/gazebo/commits/branch/issue_940 (measure_direction support is commented out because it need a change in sdformat). I prepared a test under
The output of a test run when bullet fails : http://pastebin.com/raw.php?i=dZNZT2Fs The output of a test run when bullet succeeds : http://pastebin.com/raw.php?i=bNvpy14s |
Original comment by Silvio Traversaro (Bitbucket: traversaro). I have created an initial couple of PRs both for sdformat and gazebo.
|
Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters). There seems to be a race condition in bullet that causes it to pass / fail different parts of the test randomly. The simbody and dart failures appear consistent, probably related to incorrect reference frames.
|
Original comment by Silvio Traversaro (Bitbucket: traversaro). In this case we have to update also the semantics of Apparently it is considering only link sensor, not joint sensors as the We have to mention that for joint sensors the sensor pose is relative to the joint frame, not to the parent link frame. |
Original comment by Silvio Traversaro (Bitbucket: traversaro). Given that the two pull requests (https://bitbucket.org/osrf/sdformat/pull-request/98/add-new-tag-measure_direction-to/diff and https://osrf-migration.github.io/gazebo-gh-pages/#!/osrf/gazebo/pull-request/1076/add-proper-flexibility-to-force_torque) to solve this issue have been merged I guess we can close this issue. In the next days I will open new issues to track the bugs in I forgot I was not the original author of the issue. @arocchi the issue was solved, can you close it? |
Original comment by Alessio Rocchi (Bitbucket: arocchi).
|
Original comment by Nate Koenig (Bitbucket: Nathan Koenig).
|
Original report (archived issue) by Alessio Rocchi (Bitbucket: arocchi).
Force readings from the force torque sensor should be expressed wrt the sensor pose, instead of the child link pose.
The text was updated successfully, but these errors were encountered: