force frame of reference for gazebo ros bumper
Hi,
I wanted to use the gazebo_ros_bumpers and retrieve the force vector for each contact. However, when drawing the vectors, it appears to me they are not in a correct reference frame.
I think, according to the comments in the source file (gazebo_ros_bumper.cpp), that the contact data (force, normal, point) are all given in the "user requested" frame of reference. I am using diamondback but this seems not to have changed in trunk version of the file. see :
I can see some coordinate frame change for the data in the source code but I cannot understand why some are using RotateVector (example force and torque)
// rotate into user specified frame. frame_rot is identity if world is used.
Vector3 force = frame_rot.RotateVector( Vector3(contact.forces[k]. body1Force.x,
and some others are converted by RotateVectorReverse (position and normal).
// rotate normal into user specified frame. frame_rot is identity if world is used.
Vector3 normal = frame_rot.RotateVectorReverse( Vector3(contact.normals[k].x,
with frame_rot the rotation transformation from local to global frame. To what I could read, forces and position are given by ODE in global coordinate system, so forces would need the same reverse transformation that position and normal require, but I may have missed something.
Changing both transformation to reverse seemed to show better force orientation when displayed but I cannot be totally sure as contact points are "varying a lot" due to bouncy contacts.
If any one has comments on this, it sure could help confirm the issue (or not), and I could then file a bug if required.
Comments

