From b55d76acbcd9e2b2806e5a0973946136813820aa Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Mon, 26 Dec 2016 22:36:53 -0800 Subject: [PATCH] clarify field names in vrEvent.py --- examples/pybullet/vrEvent.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/pybullet/vrEvent.py b/examples/pybullet/vrEvent.py index df80e461b..20a9bd509 100644 --- a/examples/pybullet/vrEvent.py +++ b/examples/pybullet/vrEvent.py @@ -9,6 +9,7 @@ CONTROLLER_ID = 0 POSITION=1 BUTTONS=6 + #assume that the VR physics server is already started before p.connect(p.SHARED_MEMORY) p.setInternalSimFlags(0)#don't load default robot assets etc @@ -31,18 +32,18 @@ while True: events = p.getVREvents() for e in (events): - if (e[BUTTONS][33]&2): + if (e[BUTTONS][33]&p.VR_BUTTON_WAS_TRIGGERED): prev[e[CONTROLLER_ID]] = e[POSITION] - if (e[BUTTONS][32]&2): + if (e[BUTTONS][32]&p.VR_BUTTON_WAS_TRIGGERED): widths[e[CONTROLLER_ID]]=widths[e[0]]+1 if (widths[e[CONTROLLER_ID]]>20): widths[e[CONTROLLER_ID]] = 1 - if (e[BUTTONS][1]&2): + if (e[BUTTONS][1]&p.VR_BUTTON_WAS_TRIGGERED): p.resetSimulation() #p.setGravity(0,0,-10) p.removeAllUserDebugItems() p.loadURDF("plane.urdf") - if (e[BUTTONS][33]==1): + if (e[BUTTONS][33]==p.VR_BUTTON_IS_DOWN): pt = prev[e[CONTROLLER_ID]] #print(prev[e[0]])