Astra & OpenNI2 under Arm Platform (Raspberry Pi 2 ubuntu 14.04)

Hallo guys,

I am a geek from china, i’d like to use Astra as a primary sensor on my AGV to do some gmapping stuff.

Now There is very tricky problem for me at the moment, hope u guys can help me :slight_smile:

firstly, i have tried OpenNI2 git clone
GitHub - structureio/OpenNI2: OpenNI2 and github.com/orbbec/OpenNI2.git
after compile & start,
it wouldn’t find the astra sensor,
so i do some little hack on Source/Drivers/PS1080/Sensor/XnDeviceEnumeration.cpp
[huruiduan@sanji:orbbec_openni2]$ git df
diff --git a/Source/Drivers/PS1080/Sensor/XnDeviceEnumeration.cpp b/Source/Drive
index 5cfda9e…f9f39a7 100644
— a/Source/Drivers/PS1080/Sensor/XnDeviceEnumeration.cpp
+++ b/Source/Drivers/PS1080/Sensor/XnDeviceEnumeration.cpp
@@ -37,6 +37,7 @@ XnDeviceEnumeration::XnUsbId XnDeviceEnumeration::ms_supported
{ 0x1D27, 0x0600 },
{ 0x1D27, 0x0601 },
{ 0x1D27, 0x0609 },

  •   { 0x2bc5, 0x0401 },
    

};

add the vender and product id info, so it works,
but only works with depth stream, the color stream is stuck.

my build environment is ubuntu 14.04 x64 version,
and my goal platform is arm version, which i have tried Astra & OpenNI2 under Raspberry Pi 2,
also only works with depth stream.
so how can i get the color stream works?

i have tried OpenNI-2-Linux-Arm-Orbbec3D.zip and OpenNI-2-Raspbian-Raspberry Pi2-Orbbec3D.zip with no luck,
first of all, these package are not source code, only some header and library, and the binary runs even worse than the hacked OpenNI2.

my Raspberry Pi 2 is installed with ubuntu 14.04 by following guide ARM/RaspberryPi - Ubuntu Wiki

ps:

i have also tried https://github.com/orbbec/astra.git under x64 ubuntu 14.04
i use cmake 3.4.3 but always get error,

[huruiduan@sanji:build]$ ~/sw/cmake-3.4.3-Linux-x86_64/bin/cmake …
flags -Wall -fPIC -std=c++11
CMake Error at vendor/CMakeLists.txt:1 (add_subdirectory):
The source directory

/work/astra/vendor/shinyprofiler

does not contain a CMakeLists.txt file.

CMake Error at src/plugins/openni_sensor/CMakeLists.txt:50 (include_directories):
include_directories given empty-string as include directory.

– Found Astra includes in /work/astra/include
– Found Astra lib dir:
– Found Astra libraries: Astra;AstraAPI;AstraUL
– Found Astra TOML:
– Found Astra plugins:
– Found Astra plugin TOML:
Setting rpath to $ORIGIN/…/lib
– Found SFML … in /usr/include
– Found SFML … in /usr/include
– Found SFML … in /usr/include
– Found SFML … in /usr/include
– Found SFML … in /usr/include
– Found SFML … in /usr/include
CMAKE_INSTALL_PREFIX : /work/astra/build/sdk
CMAKE_SYSTEM_NAME: Linux
– Configuring incomplete, errors occurred!
See also “/work/astra/build/CMakeFiles/CMakeOutput.log”.
See also “/work/astra/build/CMakeFiles/CMakeError.log”.

it seems there are no files under vendor/shinyprofiler/, did i clone the wrong git branch?

If you want to compile OpenNI2 from github.com/orbbec/OpenNI2.git, you need to use the orbbec_dev branch, which adds the orbbec driver. You also need to use the orbbec.ini provided. The pre-compiled OpenNI2 binaries include an additional filter (not found in the github source) that is necessary for correct depth data results. If OpenNI2 compiled from source (of the correct branch) works fine for you, you can use it too.

For compiling Astra SDK, update the .gitmodules per https://github.com/orbbec/astra/pull/4/files and then make sure you do:
git submodule update --init --recursive
The vendor/shinyprofiler and some other things will then work.

Thank you josh,

i tried check out origin/orbbec-dev and compile with no problem (x64 ubuntu 14.04)

but when i run NiViewer, still only get depth stream

, no color stream.

any idea?

[huruiduan@sanji:orbbec_openni2]$ git log
commit c9286a1863d64de8824709b72290161c9c164fee
Date: Wed Sep 30 10:32:25 2015 -0700

Change order of field definitions in XnSensor.h to make XCode 7 happy. Build

Are you using an Astra Pro? If so, see Color Image Not Firing On Frame Event - #2 by josh

Otherwise, try right clicking and changing the color stream resolution. Also make sure the orbbec.ini provided in the repository ends up in the OpenNI2/Drivers/ folder beside liborbbec.so.

great!
it works, i was missing to add orbbec.ini,
thank u josh, very very much!

1 Like

Hey Huruiduan,
It’s good that you got it working. Is it possible for you to put a tutorial on what are the things you did for your goal? That would help me as well as many others.

Thanks,
Prasanna