tweaks in pybullet/examples for Mac OSX
This commit is contained in:
@@ -48,6 +48,7 @@ p.setRealTimeSimulation(useRealTimeSimulation)
|
||||
trailDuration = 15
|
||||
|
||||
while 1:
|
||||
p.getCameraImage(320,200, flags=p.ER_SEGMENTATION_MASK_OBJECT_AND_LINKINDEX, renderer=p.ER_HARDWARE_OPENGL_RENDERER)
|
||||
if (useRealTimeSimulation):
|
||||
dt = datetime.now()
|
||||
t = (dt.second/60.)*2.*math.pi
|
||||
|
||||
@@ -54,7 +54,7 @@ while (1):
|
||||
viewMatrix = pybullet.computeViewMatrixFromYawPitchRoll(camTargetPos, camDistance, yaw, pitch, roll, upAxisIndex)
|
||||
aspect = pixelWidth / pixelHeight;
|
||||
projectionMatrix = pybullet.computeProjectionMatrixFOV(fov, aspect, nearPlane, farPlane);
|
||||
img_arr = pybullet.getCameraImage(pixelWidth, pixelHeight, viewMatrix,projectionMatrix, shadow=1,flags=pybullet.ER_SEGMENTATION_MASK, lightDirection=[1,1,1],renderer=pybullet.ER_BULLET_HARDWARE_OPENGL)
|
||||
img_arr = pybullet.getCameraImage(pixelWidth, pixelHeight, viewMatrix,projectionMatrix, shadow=1,lightDirection=[1,1,1],renderer=pybullet.ER_BULLET_HARDWARE_OPENGL)
|
||||
stop = time.time()
|
||||
print ("renderImage %f" % (stop - start))
|
||||
|
||||
|
||||
@@ -15,4 +15,5 @@ while (1):
|
||||
blue = p.readUserDebugParameter(blueSlider)
|
||||
alpha = p.readUserDebugParameter(alphaSlider)
|
||||
p.changeVisualShape(sphereUid,-1,rgbaColor=[red,green,blue,alpha])
|
||||
time.sleep(0.01)
|
||||
p.getCameraImage(320,200,flags=p.ER_SEGMENTATION_MASK_OBJECT_AND_LINKINDEX, renderer=p.ER_BULLET_HARDWARE_OPENGL)
|
||||
time.sleep(0.01)
|
||||
|
||||
@@ -3,7 +3,7 @@ import time
|
||||
from pybullet_utils import bullet_client
|
||||
|
||||
|
||||
server = bullet_client.BulletClient(connection_mode=pb.GUI_SERVER)
|
||||
server = bullet_client.BulletClient(connection_mode=pb.SHARED_MEMORY_SERVER)
|
||||
|
||||
|
||||
print ("Connecting to bullet server")
|
||||
|
||||
Reference in New Issue
Block a user