closed loop with obj files

Official Python bindings with a focus on reinforcement learning and robotics.
Post Reply
chrischii
Posts: 4
Joined: Fri Dec 25, 2020 6:11 pm

closed loop with obj files

Post by chrischii »

Hi all,
first of all Merry Xmas!

I am new to pybullet and want to perform a collision detection self contact and contact with several closed loop systems installed next to each other.The geometry is created in Creo and exported as obj files.

I read now tons of sites and have several questions:


1. I came to the conclusion, that the urdf file import in not possible for closed loop systems. Is that correct?
2. Because of 1, I have generated a .py file where I define a CollisionShape for each component like shown below

Code: Select all

                 p0 = p.createCollisionShape(p.GEOM_MESH,
							   halfExtents=[0, 0, 0],
							   fileName="obj/part0.obj",
							   collisionFramePosition=shift0,
							   meshScale=meshScale)
I assembled the individual shapes to

Code: Select all

    mla = p.createMultiBody(body_Mass,p0,visualShapeId,basePosition,baseOrientation,
                        linkMasses=link_Masses,
                        linkCollisionShapeIndices=linkCollisionShapeIndices,
                        linkVisualShapeIndices=linkVisualShapeIndices,
                        linkPositions=linkPositions,
                        linkOrientations=linkOrientations,
                        linkInertialFramePositions=linkInertialFramePositions,
                        linkInertialFrameOrientations=linkInertialFrameOrientations,
                        linkParentIndices=indices,
                        linkJointTypes=jointTypes,
                        linkJointAxis=axis)	
Is there a way to define and pin a base part, similar to the import option "useFixedBase" for urdf import? If not, how can I specify which part should be the base and how can I fix it?

3. If I use pybullet headles, how can I detect collisions / get an output somewhere, e.g. textfile

Thanks in advance for your help
chrischii
Posts: 4
Joined: Fri Dec 25, 2020 6:11 pm

Re: closed loop with obj files

Post by chrischii »

Problem partially solved.
closed loop is not possible for urdf, but creating a constraint after importing the urdf works.
bluefish_
Posts: 8
Joined: Sun Jan 23, 2022 11:24 am

Re: closed loop with obj files

Post by bluefish_ »

This is very late, but I think changing the mass to be 0 of any link is equal to making it fixed? specifically for fixing a base or setting something as a base I think you need to make it the base link so that the urdf importer knows.
Btw thank you! Your answer is very helpful to me! I'm also trying to simulate something potentially with a closed loop and was wondering how that could be done in either createMultiBody() or urdf.
Post Reply