Page 1 of 1

Pybullet not rendering correctly

Posted: Sun Feb 24, 2019 10:01 am
by paulscon
Hi PyBullet community!

Sorry for the newb question, but after a serious 3 hour Googling session have not been able to answer this question by myself.

Am currently experiencing issues getting PyBullet to render meshes in the example browser. Have been following the quickstart guides code from page 3. Copy/pasted it into Pycharm.

however upon running the example script, it does not load the model & this is all I see:

Image


System infomation

macOS x 10.14.3 Mojave

python 3.7

pybullet build time: Feb 24 2019 17:55:02
Version = 3.3 INTEL-10.4.14
Vendor = Intel Inc.
Renderer = Intel HD Graphics 3000 OpenGL Engine
b3Printf: Selected demo: Physics Server
startThreads creating 1 threads.
starting thread 0
started thread 0
MotionThreadFunc thread started

Re: Pybullet not rendering correctly

Posted: Sun Feb 24, 2019 10:04 am
by paulscon
python code from the Quickstart guide is as follows:

Code: Select all


import pybullet as p
import time
import pybullet_data
physicsClient = p.connect(p.GUI)#or p.DIRECT for non-graphical version
p.setAdditionalSearchPath(pybullet_data.getDataPath()) #optionally
p.setGravity(0,0,-10)
planeId = p.loadURDF("plane.urdf")
cubeStartPos = [0,0,1]
cubeStartOrientation = p.getQuaternionFromEuler([0,0,0])
boxId = p.loadURDF("r2d2.urdf",cubeStartPos, cubeStartOrientation)
for i in range (10000):
    p.stepSimulation()
    time.sleep(1./240.)
cubePos, cubeOrn = p.getBasePositionAndOrientation(boxId)
print(cubePos,cubeOrn)
p.disconnect()



Re: Pybullet not rendering correctly

Posted: Sun Feb 24, 2019 10:06 am
by paulscon
proof the URDF files are there:

Image

Re: Pybullet not rendering correctly

Posted: Sun Feb 24, 2019 10:09 am
by paulscon
more system info:

Image

Re: Pybullet not rendering correctly

Posted: Sun Feb 24, 2019 10:12 am
by paulscon
My understanding is that I should see R2D2 just chilling there- if that is not correct?

Re: Pybullet not rendering correctly

Posted: Tue Feb 26, 2019 12:44 am
by Erwin Coumans
Do the regular Bullet examples work? For example, what do you see if you run
~~~~~~~
python3 -m pybullet_envs.examples.testBike
~~~~~~~
(its implementation is testBike.py)

I see this, on Mojave 10.14.3:

bike.png
When I run your script, it shows the R2D2 indeed, on the ground plane.

Re: Pybullet not rendering correctly

Posted: Wed Feb 27, 2019 3:14 am
by paulscon
Hi Erwin,

On my system, running your example script yields the following result :

Image

With the camera panning from left to right.

~

Since the last post have also tried a few things:

-Containerising Pybullet - learnt from your Github post this is not currently possible!
-Created a conda virtual env running python 3.6 on OS X Mojave, including all the relevant packages to run pybullet. Unfortunately no luck here either!
-Dual booted into Ubuntu 18, installed Pybullet (on a python 3.6 env) and it worked perfectly!

Thinking it might be some kind of OS x mojave issue. Not smart enough to solve this I am afraid!

Going to continue development in Ubuntu & appreciate your help mate!

Re: Pybullet not rendering correctly

Posted: Wed Feb 27, 2019 3:16 am
by paulscon
As a quick question, might there be someway to turn off hardware acceleration (If this is currently the case) as thinking this might have something to do with it?

Re: Pybullet not rendering correctly

Posted: Wed Feb 27, 2019 4:22 pm
by Erwin Coumans
This is likely some Intel OpenGL driver issue
~~~~~~
Version = 3.3 INTEL-10.4.14
Vendor = Intel Inc.
Renderer = Intel HD Graphics 3000 OpenGL Engine
~~~~~~~

Re: Pybullet not rendering correctly

Posted: Mon Apr 01, 2019 10:39 pm
by paulscon
just posting this here for anyone else that experiences the issue.

The workaround for me at least was to run it on Ubuntu on my mac in dual boot.

Works perfectly as can be seen here

Image