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
Object frame changes
Re: Object frame changes
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:
Cheers
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)