OpenNI, kinect power

Hi,

Is it possible to switch off kinect for power safe, then switch ON when it is neccessary ?

This an example, but doesn't work:

from org.myrobotlab.service import Runtime
 
openni = Runtime.createAndStart("Kinect", "OpenNi")
python.subscribe(openni.getName(),"publishOpenNIData")
 
openni.startUserTracking()
 
def kinectPower(val):
  openni.enableDepth(val)
  openni.enableIR(val)
  openni.enableRGB(val)
 
def onOpenNIData(data):
global skeleton
 
if data:
skeleton = data.skeleton
 
 
kinectPower(False)
sleep(10)
kinectPower(True)
 
Mats's picture

Kinect power on/off

You could try to use a relay or FET and drive it from one of the I/O pins on the Arduino.

 

dom14's picture

Yes good idea Matts. But, is

Yes good idea Matts.

But, is it possible to remove service (Runtime.createAndStart("Kinect", "OpenNi")) and put again when it is neccessary ?

 

Mats's picture

Yes

# Start the OpenNi service as kinect

kinect = Runtime.start("kinect","OpenNi")

# Stop the service

kinect.releaseService()