[SOLVED] [pybullet] DIRECT and GUI mode issue

Post Reply
mlosch
Posts: 3
Joined: Wed Feb 15, 2017 12:22 pm

[SOLVED] [pybullet] DIRECT and GUI mode issue

Post 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!
Attachments
Visualization of quadruped.urdf after connecting via p.SHARED_MEMORY to the example browser
Visualization of quadruped.urdf after connecting via p.SHARED_MEMORY to the example browser
success_pshared.png (29.57 KiB) Viewed 23357 times
Visualization of quadruped.urdf after connecting via p.GUI
Visualization of quadruped.urdf after connecting via p.GUI
failed_pgui.png (15.89 KiB) Viewed 23357 times
Last edited by mlosch on Tue Feb 21, 2017 1:21 pm, edited 1 time in total.
mlosch
Posts: 3
Joined: Wed Feb 15, 2017 12:22 pm

Re: [pybullet] DIRECT and GUI mode issue

Post by mlosch »

Can anybody test and confirm this issue?
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: [pybullet] DIRECT and GUI mode issue

Post 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") 
benelot
Posts: 350
Joined: Sat Jul 04, 2015 10:33 am
Location: Bern, Switzerland
Contact:

Re: [pybullet] DIRECT and GUI mode issue

Post 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.
mlosch
Posts: 3
Joined: Wed Feb 15, 2017 12:22 pm

Re: [pybullet] DIRECT and GUI mode issue

Post 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.
Post Reply