From ac28f50fa5741f7b3c72a2a13490ae5377f3a8cf Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Wed, 1 Mar 2017 13:01:02 -0800 Subject: [PATCH] vrhand.py first try to connect to SHARED_MEMORY if that fails use GUI fallback --- examples/pybullet/vrhand.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/pybullet/vrhand.py b/examples/pybullet/vrhand.py index de407f3b0..44651c65e 100644 --- a/examples/pybullet/vrhand.py +++ b/examples/pybullet/vrhand.py @@ -11,6 +11,8 @@ import pybullet as p #first try to connect to shared memory (VR), if it fails use local GUI c = p.connect(p.SHARED_MEMORY) +if (c<0): + c = p.connect(p.GUI) #p.resetSimulation() p.setGravity(0,0,-10) print(c) @@ -51,7 +53,7 @@ def convertSensor(x): b = (v-minV)/float(maxV-minV) return (1.0-b) -ser = serial.Serial(port='COM3',baudrate=115200,parity=serial.PARITY_ODD,stopbits=serial.STOPBITS_TWO,bytesize=serial.SEVENBITS) +ser = serial.Serial(port='COM9',baudrate=115200,parity=serial.PARITY_ODD,stopbits=serial.STOPBITS_TWO,bytesize=serial.SEVENBITS) if (ser.isOpen()): while True: events = p.getVREvents()