Page 1 of 1

[SOLVED] [pybullet] DIRECT and GUI mode issue

Posted: Wed Feb 15, 2017 12:43 pm
by mlosch
Hi,

I have issues loading models in pybullets DIRECT and GUI mode but have no issues in running them in SHARED_MEMORY after starting the example browser.
Seemingly arbitrary objects just cannot be displayed in the interface. Most of the urdf-models that come in the data-directory can not be displayed as well.
An example:

Code: Select all

import pybullet as p
p.connect(p.GUI)
p.loadURDF('data/quadruped/quadruped.urdf') # displays only a tiny black cube at (0,0,0)
Furthermore, checking all links world positions with getLinkPosition(...), they all are centered at (0,0,0).
The same example works perfectly fine when I initially connect to the example browser via SHARED_MEMORY.
Similar issues occur when loading other objects:
  • data/sphere_small.urdf: Nothing is displayed
  • data/mjcf/humanoid.xml: Nothing is displayed
  • data/r2d2.urdf: Only the claw is rendered at (0,0,0)
  • data/kuka_lwr/kuka.urdf: Seems to load each link at (0,0,0)
Loading the plane.urdf works without issues though!

I have tested and confirmed this issue on 2 different computers with Ubuntu 14.04 and 15.10.

What is happening?
I want to use pybullet in DIRECT or GUI mode to use it in conjunction with reinforcement learning, thus do not want to leave the example browser running.

Thanks in advance!

Re: [pybullet] DIRECT and GUI mode issue

Posted: Thu Feb 16, 2017 10:31 am
by mlosch
Can anybody test and confirm this issue?

Re: [pybullet] DIRECT and GUI mode issue

Posted: Sun Feb 19, 2017 1:38 pm
by Erwin Coumans
First of all, there are a few alternatives that still work with SHARED_MEMORY. For example App_SharedMemoryPhysics, which is a small executable that has no OpenGL/GUI. In addition, there is a UDP physics server, headless (without GUI/Graphics etc), you can use pybullet.connect(p.UDP,"127.0.0.1")

I have never seen this issue, pybullet should just work fine using p.GUI or any of the other modes (p.DIRECT, p.UDP, p.SHARED_MEMORY).

From what folder do you run pybullet? You don't need the 'data' prefix, as long as you start pybullet within the Bullet directories, I usually use 'p.loadURDF("quadruped/quadruped.urdf")

How did you compile pybullet? What operating system and compiler version?
On Mac OSX or Linux, can you try using the most up-to-date Bullet revision, preferably using git clone http://github.com/bulletphysics/bullet3 or get latest from https://github.com/bulletphysics/bullet3/releases

build_and_run_cmake_pybullet_double.sh
cd build_cmake/examples/pybullet
python

Code: Select all

import pybullet as p
p.connect(p.GUI)
p.loadURDF("quadruped/quadruped.urdf") 

Re: [pybullet] DIRECT and GUI mode issue

Posted: Sun Feb 19, 2017 2:47 pm
by benelot
Can not confirm this issue. I am using pybullet since day one and I usually made the mistakes by compiling a messed up version (not up-to-date etc.), pybullet was always working fine.

Re: [pybullet] DIRECT and GUI mode issue

Posted: Mon Feb 20, 2017 12:48 pm
by mlosch
Thanks for the helpful comments!
I found the issue: I had used the bpython interpreter (with python 2.7). If I use the regular python interpreter everything works fine!
Very surprised by this issue.