link orientations in multibody are getting affected by another multibody loaded from stl.

Official Python bindings with a focus on reinforcement learning and robotics.
Post Reply
sai_yg
Posts: 2
Joined: Wed Dec 07, 2022 3:27 pm

link orientations in multibody are getting affected by another multibody loaded from stl.

Post by sai_yg »

I was trying to procedurally creates some utensils and place them inside the sink model I had to load from an stl file.
if I load the sink model first, the link orientations in the bowl multibody are all messed up.
but if I create the procedural multibodies first, and then load the sink mesh from stl. the orientations are as expected.

Code: Select all

mbid = p.createMultiBody(
        # 0,
        # -1,
        # -1,
        # (0,0,0),
        # (0,0,0,1),
        linkMasses=[0]*lns,
        linkCollisionShapeIndices=col_shapes,
        linkVisualShapeIndices=col_shapes,
        linkPositions=col_shape_poses,
        linkOrientations=col_shape_orns,
        linkInertialFramePositions=[(0,0,0)]*lns,#col_shape_poses,
        linkInertialFrameOrientations=[(0,0,0,1)]*lns,#col_shape_orns,
        linkParentIndices=[0]*lns,
        linkJointTypes=[p.JOINT_FIXED]*lns,
        linkJointAxis=[(0,0,0)]*lns,
        physicsClientId=pbClientId)
I also tried by uncommenting the first few arguments.
I'm developing code in jupyter notebook.
the orientations in both cases are also same. I checked the diff in an online tool.
please let me know if you need any additional data.
Attachments
same_orns.png
same_orns.png (181.75 KiB) Viewed 27328 times
sink_later.png
sink_later.png (47.09 KiB) Viewed 27333 times
sink_first.png
sink_first.png (71.99 KiB) Viewed 27333 times
sai_yg
Posts: 2
Joined: Wed Dec 07, 2022 3:27 pm

Re: link orientations in multibody are getting affected by another multibody loaded from stl.

Post by sai_yg »

Update :
1. when loading the sink mesh from stl file, I was not creating a visual shape and using that while creating multibody.
2. made changes and used the same mesh as visual shape, and the issue is resolved now.
when visualShapes are not created for models loaded from file path, there seem to be a problem with orientations for created primitive shapes following that.
Post Reply