Can you run Structure sensor on raspberry pi 2?


Has anyone succeed in getting rgb-d from structure sensor on a raspberry pi?
I’m running a raspbian debian os


I think @philnelson got close here in our office. I think there’s also a tutorial somewhere online …


I sure did! It’s pretty straightforward. You just need a fairly recent raspian installation, your Structure Sensor, a USB Hacker Cable, and OpenNI 2 from our Github repo. There are some specific instructions for Linux setup in there. Just follow the instructions there and it will work just fine.


Is it working fine? Getting nice performance out of the Pi?


The depth stream was fast and accurate using the OpenNI 2 sample code. Of course if you need color you’ll have to hook up your own camera and do some work to align the depth+color.


Sorry for the late bump but would you expect the Raspberry Pi 2 Model “B” to work similarly?


No reason it shouldn’t. The only thing that is needed is OpenNI2, so you need a linux distro that can run it.


Hi, I’m using the sensor on a RaspBerry Pi 2 B.
I have a conflict between the raspberry camera and the openni2 that control the structure sensor.
It is quite easy to verify: try to run SimpleRead example program in one console window, then open another console window and run RaspiStill -d (for example). As the camera switch on the structure sensor switch off.
Any help ?


Unfortunately I don’t have a raspberry pi camera here to test with :frowning:


Hi Phil,
it is quite normal to expect to use a camera in combination with your sensor, as it doesn’t integrate an RGB camera, so, please invest 20 $ to buy one :wink:
I found 2 possible workaround for my application:

  1. to use a normal usb camera, because it doesn’t present that problem.
  2. to use 2 raspberry boards, one for the camera and one for the sensor.
    The first solution gives poor results, because of low res and no feature control (ev, shutter, ISO, etc.)
    The second solution is more complex, because of double hw, double sw + synchronization.


@info27 what’s the model number of the camera you’d like to get working?


The normal raspberry camera module (not the pi-noir):

I have updated the software to the last version.
I have tested with raspistill Camera App v1.3.8


Just to make sure, this is the one?


yes, this is the one I’m using.


Ok, it’s been ordered. Will let you know what we find.


@scottthorne: SS is running on Raspberry Pi 2 B.

@info27: raspistill / raspivid are not causing the SS to switch off as reported in your testing. How did you build OpenNI2?



Hi Jim,
I’ll try to do a new installation on a clean system and I’ll let you know.

The error that I receive is:
Wait failed! (timeout is 2000 ms)
waitForStreams: timeout reached


After that error, if I try to exit and restart the program, I receive another error:
Couldn’t open device
DeviceOpen using default: no devices found

To start again I have to disconnect USB cable and reconnect it. After that it starts to work again.


I’ve noticed that the projector is left on when Ctrl-C terminating SimpleRead. Afterwards SimpleRead can sometimes be relaunched successfully, other times the error you mentioned occurs.

However, if you terminate SimpleRead by pressing any alphanumeric key, the projector is turned off, and a relaunch is consistently successful

Let me know if this helps.



Hi Jim, thank you for your effort, even if not very helpfull for my problem.
I’m using your SS with Raspberry.everyday since 2 months.
I have seen that sometimes, without any apparent reason, it stops working.
I have seen that when it stops working, basically it disapear from the USB device list.
The only solution is to disconnect and reconnect the USB.
Easy to check with lsusb command in a terminal windows.

Just to be clear, I describe again the problem that I observe:

  1. I run in one Terminal window one of the OpenNi2 demo programs (SimpleRead for example)
  2. the SimpleRead start to write numbers on the screen (central point distance)
  3. I open another Terminal windows and I open the RaspBerry camera (with raspivid -d for example)
  4. immediatelly the SimpleRead stops with timeout error:
    Wait failed! (timeout is 2000 ms)
    waitForStreams: timeout reached
  5. the projector is switched off
  6. if I run lsusb, the SS is no more present in the list of usb devices

About the apparent conflict that I observe with the camera, I’m wondering if that could be caused by the fect that also the OpenNi2 give the possibility to get data steam from a camera. I can immagine that this is for other 3D sensors that integrate the RGB camera.
I tried to use that functions to get data from the Raspberry camera without success.