bulletphysics / bullet3

Bullet Physics SDK: real-time collision detection and multi-physics simulation for VR, games, visual effects, robotics, machine learning etc.
http://bulletphysics.org
Other
12.51k stars 2.87k forks source link

Unexpected Error: module 'pybullet' has no attribute 'loadMJKF' #2939

Closed LJKS closed 4 years ago

LJKS commented 4 years ago
import pybullet as p

import os

self.client = p.connect(p.DIRECT)
p.setGravity(gravX=0,gravY=0,gravZ=9.8, physicsClientId=self.client)
full_path = os.path.join(os.path.dirname(__file__), "..", "..", "assets", "mjcf", 'ant.xml')
p.loadMJKF(full_path, flags=pybullet.URDF_USE_SELF_COLLISION|pybullet.URDF_USE_SELF_COLLISION_EXCLUDE_ALL_PARENTS)

results in Error: File "antsumo.py", line 10, in init p.loadMJKF(full_path, flags=pybullet.URDF_USE_SELF_COLLISION|pybullet.URDF_USE_SELF_COLLISION_EXCLUDE_ALL_PARENTS) AttributeError: module 'pybullet' has no attribute 'loadMJKF'

Probably I'm just stupid, but I can't explain this to myself right now as I'm just following the Quickstart Walkthrough.

Pybullet Gyms seem to call loadMJCF not on the imported pybullet module, but rather on the return of 'p.connect(...)' which seems weird to me though, as this is supposed to be just an int from what I understand.

Sorry for the confusion and thanks for all the effort!

erwincoumans commented 4 years ago

loadMJKF is a spelling mistake, please check the docs.