Pybullet not rendering correctly

Official Python bindings with a focus on reinforcement learning and robotics.
Post Reply
paulscon
Posts: 8
Joined: Sun Feb 24, 2019 9:41 am

Pybullet not rendering correctly

Post 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
Last edited by paulscon on Sun Feb 24, 2019 10:12 am, edited 1 time in total.
paulscon
Posts: 8
Joined: Sun Feb 24, 2019 9:41 am

Re: Pybullet not rendering correctly

Post 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()


paulscon
Posts: 8
Joined: Sun Feb 24, 2019 9:41 am

Re: Pybullet not rendering correctly

Post by paulscon »

proof the URDF files are there:

Image
paulscon
Posts: 8
Joined: Sun Feb 24, 2019 9:41 am

Re: Pybullet not rendering correctly

Post by paulscon »

more system info:

Image
paulscon
Posts: 8
Joined: Sun Feb 24, 2019 9:41 am

Re: Pybullet not rendering correctly

Post by paulscon »

My understanding is that I should see R2D2 just chilling there- if that is not correct?
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Pybullet not rendering correctly

Post 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
bike.png (358.08 KiB) Viewed 12888 times
When I run your script, it shows the R2D2 indeed, on the ground plane.
paulscon
Posts: 8
Joined: Sun Feb 24, 2019 9:41 am

Re: Pybullet not rendering correctly

Post 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!
Last edited by paulscon on Wed Feb 27, 2019 4:58 am, edited 2 times in total.
paulscon
Posts: 8
Joined: Sun Feb 24, 2019 9:41 am

Re: Pybullet not rendering correctly

Post 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?
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Pybullet not rendering correctly

Post 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
~~~~~~~
paulscon
Posts: 8
Joined: Sun Feb 24, 2019 9:41 am

Re: Pybullet not rendering correctly

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