Object frame changes

Typically: "How do I... ", "How can I... " questions
Post Reply
wozxfdha
Posts: 51
Joined: 10 Jun 2021, 09:40

Object frame changes

Post by wozxfdha »

Hi,

I create a model by importing object's mesh file, but the model frame shown in CoppeliaSim is different from the object frame in mesh file.

How can I match the two frames or get the transformation matrix between them? This means a lot to me.

Thanks

coppelia
Site Admin
Posts: 10361
Joined: 14 Dec 2012, 00:25

Re: Object frame changes

Post by coppelia »

Hello,

a CAD file such as DXF, STL, OBJ or Collada do not have reference frame information stored. It is most of the time just a list of triangles, with coordinates relative to the origin.

When importing meshes, the meshes will be correctly placed in absolute terms, and CoppeliaSim will select a local reference frame that you cannot directly control. So what you can do is place a dummy at the origin, then attach it to the imported mesh. Now you can move the mesh, and you can always get the transformation/position/orientation of the dummy via:

Code: Select all

sim.getObjectMatrix(dummyHandle,-1)
sim.getObjectPose(dummyHandle,-1)
sim.getObjectPosition(dummyHandle,-1)
sim.getObjectOrientation(dummyHandle,-1)
sim.getObjectQuaternion(dummyHandle,-1)
Cheers

Post Reply