InMoov head tracking with the Oculus Rift

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ambroise's picture

woua amazing i would like to

woua amazing i would like to do that

could you give us a tutorial? for to do 

kwatters's picture

Quick Start with OculusRift head tracking.

This video shows using the Yaw and Pitch from the Oculus Rift.  Here is a simple  python script to show how to get that information and map it to an InMoov servo.    Basically, create the OculusRift service.  Then in a loop, I poll the values for the yaw and pitch.  The Yaw maps to the inmoov head.rothead servo , and the Pitch maps to the head.neck servo.    I do some minor scaling of the output values so they are scaled in a reasonable range to send to the servos   (servos rotate from 0 - 180 degrees, so I add 90 to the Yaw value to put the center at 90.)    The pitch, I found I needed to amplify the value a little bit to make the neck move up and down.   The InMoov head only has 2 degrees of freedom,  (up/down  & left/right)  so, I omit the "Roll" from the rift.

import time
rift = Runtime.createAndStart("rift", "OculusRift")
lloyd = Runtime.createAndStart("lloyd", "InMoov")
# the mega
leftPort = "COM10"
for i in range(0,100000):
  yaw = rift.getYaw() + 90
  pitch = amp*rift.getPitch() + 45