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

7 years ago

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

 

# Start the OpenNi service as kinect

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

# Stop the service

kinect.releaseService()