Hello
I am trying to load an SDF file into the pybullet environment. However, it comes up with the
"error: Cannot load SDF file."
My code is as follows:
import pybullet as p
import time
import pybullet_data
physicsClient = p.connect(p.GUI)
p.setAdditionalSearchPath(pybullet_data.getDataPath())
p.setGravity(0,0,-10)
planeId = p.loadSDF("plane_stadium.sdf")
boxId = p.loadSDF("free_loop.sdf")
for i in range (3000):
p.stepSimulation()
time.sleep(1./240.)
p.disconnect()
I have made sure that the files are in the correct directory.
The free_loop.sdf file has a closed loop structure ( wherein the links are connected in a loop)
I wonder, if it is not possible to load an SDF file into pybullet which has a closed structure (unlike the tree structure of URDF format)?
Is there any easy workaround to this? Any example would be appreciated.
Thank you!
Simulating closed loop structure in PyBullet
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: Simulating closed loop structure in PyBullet
SDF and URDF files need to be tree structure/ open loop.
PyBullet provides user constraints to close loops.
See our Minitaur example how to add such constraint.
https://github.com/bulletphysics/bullet ... ur.py#L391
See createConstraint in the examples and PyBullet Quickstart Guide.
https://docs.google.com/document/d/10sX ... e70wns7io3
PyBullet provides user constraints to close loops.
See our Minitaur example how to add such constraint.
https://github.com/bulletphysics/bullet ... ur.py#L391
See createConstraint in the examples and PyBullet Quickstart Guide.
https://docs.google.com/document/d/10sX ... e70wns7io3