dqrobotics / cpp-interface-vrep

Vrep interface for the dqrobotics in C++
GNU Lesser General Public License v3.0
3 stars 5 forks source link

[BUG] get_object_pose anomaly with a global reference frame and with a relative frame #10

Closed AndreiCostinescu closed 1 year ago

AndreiCostinescu commented 1 year ago

Bug description Let A and B be two objects in the simulation. If I get the pose of A (in aPose) and B (in bPose), both relative to the global frame, and I want the pose p of A relative to B, the formula is: auto p = bPose.inv() * aPose;. There is a feature when calling get_object_pose that allows specifying a relative object as a second argument: auto pCheck = vrepInterface.get_object_pose(A, B, OP_BLOCKING);. My assumption was that p == pCheck, however, this is not the observed behavior.

To Reproduce Attached is the code I used. issueReplicator.zip

In the main function, please comment line 67, to only run the relative pose issue test. The output shows a mismatch between the relative pose computation and the relative pose retrieved from the simulation.

Expected behavior The expected output is identical dual quaternion coefficients for both methods.

Environment:

mmmarinho commented 1 year ago

@AndreiCostinescu Thanks for the report. Somehow I didn't get notified of these issues you raised.

Anyways, if I understood the issue you're raising, we have no way to force the relative pose to be equal when computed in CoppeliaSim, which is what vrepInterface.get_object_pose(A, B, OP_BLOCKING); does.

They use a different precision than we do in dqrobotics.