add hand.py/hand.ino used to create this VR glove, using MuJoCo Haptix MPL hand (Apache 2 license)
https://www.youtube.com/watch?v=VMJyZtHQL50 added b3InitSyncBodyInfoCommand, to retrieve body info, when connecting to a server with existing bodies pybullet will call this b3InitSyncBodyInfoCommand automatically after connecting Avoid overriding the py.setVRCameraState setting in VR
This commit is contained in:
32
examples/pybullet/hand.ino
Normal file
32
examples/pybullet/hand.ino
Normal file
@@ -0,0 +1,32 @@
|
||||
//arduino script for vr glove, sending analogue 'finger' readings
|
||||
//to be used with pybullet and hand.py
|
||||
|
||||
|
||||
int sensorPin0 = A0;
|
||||
int sensorPin1 = A1;
|
||||
int sensorPin2 = A2;
|
||||
int sensorPin3 = A3;
|
||||
|
||||
void setup() {
|
||||
// put your setup code here, to run once:
|
||||
Serial.begin(115200);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
// put your main code here, to run repeatedly:
|
||||
int sensorValue0 = analogRead(sensorPin0);
|
||||
int sensorValue1 = analogRead(sensorPin1);
|
||||
int sensorValue2 = analogRead(sensorPin2);
|
||||
int sensorValue3 = analogRead(sensorPin3);
|
||||
|
||||
Serial.print(",");
|
||||
Serial.print(sensorValue0);
|
||||
Serial.print(",");
|
||||
Serial.print(sensorValue1);
|
||||
Serial.print(",");
|
||||
Serial.print(sensorValue2);
|
||||
Serial.print(",");
|
||||
Serial.print(sensorValue3);
|
||||
Serial.println(",");
|
||||
delay(10);
|
||||
}
|
||||
Reference in New Issue
Block a user