OpenNI

Ubuntu 10.10 (32bit)

since 2011-01-08

SSE3 非対応のマシンで実行しようとして苦労する。。

OpenNI bin

http://www.openni.org/downloadfiles/openni-binaries/21-stable

OpenNI Alpha Build for Ununtu 10.10 x86 (32-bit) v1.0.0.23 Uploaded: 06.01.11 File Size: 6 MB

$ mkdir openni-bin
$ cd openni-bin/
$ tar xvfj ~/Downloads/OpenNI-Bin-Ubuntu-x86-1.0.0.23.tar.bz2 

install.sh があるが、怖いのでドキュメント見る:

$ chromium-browser Documentation/html/index.html 

Getting started には Visual Studio のことしか書いてない。

やってみる:

$ sudo ./install.sh 
copying shared libraries...OK
copying executables...OK
copying include files...OK
creating database directory...OK
registering module 'libnimMockNodes.so'..../install.sh: line 62:  8994 Illegal instruction     niReg -r $INSTALL_LIB/$module

だめだ。。

ふと https://github.com/OpenNI/OpenNI の README を読み返して分かった:

* At the moment, the default is to compile the code with SSE3 support (this is also true for the supplied binaries). 
  If you have a CPU without such support, please remove the sse compiler flags from the make files.
  (A good hint for this error is that you encounter an "illegal instructions" messages)

念のために作業マシンで cat /proc/cpuinfo する。sse3 がない。。

OpenNI github master

やってみる。

sudo apt-get install libusb-1.0-0-dev
sudo apt-get install freeglut3-dev
sudo apt-get install doxygen
sudo apt-get install graphviz
git clone https://github.com/OpenNI/OpenNI.git
cd OpenNI
cd Platform/Linux-x86/CreateRedist
./RedistMaker

下記のエラー。無視する:

sh: C:\Program Files\HTML Help Workshop\hhc.exe: not found
error: failed to run html help compiler on index.hhp
$ cd ../Redist
$ sudo ./install.sh 
copying shared libraries...OK
copying executables...OK
copying include files...OK
creating database directory...OK
registering module 'libnimMockNodes.so'..../install.sh: line 62:  8674 Illegal instruction     niReg -r $INSTALL_LIB/$module

いいのか?

情報を探す。見つかった:

http://tclip.blog38.fc2.com/blog-entry-103.html

http://www.keyboardmods.com/2010/12/howto-kinect-openninite-skeleton.html

いろいろ入れないといけないらしいが、そもそも niReg のエラーは放置できない気がする。。

OpenNI SSE2 build

OpenNI-インストール - tueda http://bit.ly/h7zfxj

にかかれていた。

CommonMakefile 直して再コンパイル。

git clone https://github.com/OpenNI/OpenNI.git

Platform/Linux-x86/Build/CommonMakefile を修正:

diff --git a/Platform/Linux-x86/Build/CommonMakefile b/Platform/Linux-x86/Build/
CommonMakefile
index cbe0ae3..48eae05 100644
--- a/Platform/Linux-x86/Build/CommonMakefile
+++ b/Platform/Linux-x86/Build/CommonMakefile
@@ -24,7 +24,7 @@
 
 # some defaults
 ifndef SSE_GENERATION
-       SSE_GENERATION = 3
+       SSE_GENERATION = 2
 endif
 
 ifndef CFG
  cd OpenNI
  cd Platform/Linux-x86/CreateRedist
  ./RedistMaker

$ cd ../Redist/
$ sudo ./install.sh 
copying shared libraries...OK
copying executables...OK
copying include files...OK
creating database directory...OK
registering module 'libnimMockNodes.so'...OK
registering module 'libnimCodecs.so'...OK
registering module 'libnimRecorder.so'...OK

*** DONE ***

Sensor github

PSDK という説もあるが。。

これを使ってみる:

(6) git clone https://github.com/boilerbots/Sensor.git
(7) cd Sensor
(8) git checkout kinect
(9) cd Platform/Linux-x86/Build
(10) make && sudo make install

こんな感じに:

(omitted)
creating config dir /usr/etc/primesense...OK
copying shared libraries...OK
copying executables...OK
registering module 'libXnDeviceSensorV2.so' with OpenNI...OK
registering module 'libXnDeviceFile.so' with OpenNI...OK
copying server config file...OK
setting uid of server...OK
creating server logs dir...OK
installing usb rules...OK

*** DONE ***

NITE

http://www.primesense.com/?p=515

http://downloads.primesense.com/NITE-Bin-Ubuntu-x86-1.3.0.17.tar.bz2

$ tar xvfj ~/Downloads/NITE-Bin-Ubuntu-x86-1.3.0.17.tar.bz2 
$ cd Nite-1.3.0.17/

CommonMakefile を chmod 644 して emacs で開き、SSE を 2 にする。

$ cd Data/
$ chmod 644 *.xml 
$ emacs Sample-User.xml &

あちこちに書かれているライセンスキーを貼り付ける。下記も修正:

<MapOutputMode xRes="640" yRes="480" FPS="30"/>

Sample-Scene.xml Sample-Tracking.xml も同じように。

$ sudo niLicense PrimeSense 0KOIk2JeIBYClPWVnMoRKn5cdY4=
$ cd ..
$ sudo ./install.bash 

最初にライセンスキーを聞かれる。

gcc の引数に -msse3 ではなく -msse2 が出てくることを確認。

cd Samples/Bin

いよいよ kinect をつないで:

$ ./Sample-TrackPad 

ドライバ選び

SensorKinect で再挑戦

git clone https://github.com/avin2/SensorKinect.git
lv /usr/include/ni/CommonMakefile 

SSE は 2 になっている。

cd SensorKinect/
cd Platform/Linux-x86/CreateRedist/
./RedistMaker 

失敗したよ:

(omitted)
../../../../Source/XnDeviceSensorV2/XnDeviceSensorIO.cpp: In member function ‘XnStatus XnSensorIO::OpenDevice(const XnChar*)’:
../../../../Source/XnDeviceSensorV2/XnDeviceSensorIO.cpp:105: error: ‘xnUSBOpenDeviceByPath’ was not declared in this scope
../../../../Source/XnDeviceSensorV2/XnDeviceSensorIO.cpp: In function ‘XnStatus Enumerate(XnUInt16, XnUInt16, XnStringsHash&)’:
../../../../Source/XnDeviceSensorV2/XnDeviceSensorIO.cpp:375: error: expected initializer before ‘*’ token
../../../../Source/XnDeviceSensorV2/XnDeviceSensorIO.cpp:378: error: ‘astrDevicePaths’ was not declared in this scope
../../../../Source/XnDeviceSensorV2/XnDeviceSensorIO.cpp:378: error: ‘xnUSBEnumerateDevices’ was not declared in this scope
../../../../Source/XnDeviceSensorV2/XnDeviceSensorIO.cpp:387: error: ‘xnUSBFreeDevicesList’ was not declared in this scope
make[1]: *** [Release/XnDeviceSensorIO.o] エラー 1
make[1]: ディレクトリ `/home/hil/code/SensorKinect/Platform/Linux-x86/Build/XnDeviceSensorV2' から出ます
make: *** [XnDeviceSensorV2] エラー 2
make: ディレクトリ `/home/hil/code/SensorKinect/Platform/Linux-x86/Build' から出ます

真面目に情報収集

http://tclip.blog38.fc2.com/blog-entry-105.html

良さそうのはこの ROS ってやつでしょうか?

https://github.com/ros-pkg-git/Sensor

やってみたが同じ。。

http://d.hatena.ne.jp/tueda_wolf/20110108 とおなじ。。

<html> <hr /> <div class="amazlet-box" style="margin-bottom:0px;"><div class="amazlet-image" style="float:left;margin:0px 12px 1px 0px;"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/B003T9VDJQ/r4wh-22/ref=nosim/" name="amazletlink" target="_blank"><img src="http://ecx.images-amazon.com/images/I/31wUYDad5yL._SL160_.jpg" alt="Xbox 360 Kinect センサー" style="border: none;" /></a></div><div class="amazlet-info" style="line-height:120%; margin-bottom: 10px"><div class="amazlet-name" style="margin-bottom:10px;line-height:120%"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/B003T9VDJQ/r4wh-22/ref=nosim/" name="amazletlink" target="_blank">Xbox 360 Kinect センサー</a><div class="amazlet-powered-date" style="font-size:80%;margin-top:5px;line-height:120%">posted with <a href="http://www.amazlet.com/browse/ASIN/B003T9VDJQ/r4wh-22/ref=nosim/" title="Xbox 360 Kinect センサー" target="_blank">amazlet</a> at 10.12.12</div></div><div class="amazlet-detail">マイクロソフト (2010-11-20)<br />売り上げランキング: 2<br /></div><div class="amazlet-sub-info" style="float: left;"><div class="amazlet-link" style="margin-top: 5px"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/B003T9VDJQ/r4wh-22/ref=nosim/" name="amazletlink" target="_blank">Amazon.co.jp で詳細を見る</a></div></div></div><div class="amazlet-footer" style="clear: left"></div></div> </html>

openni.txt · 最終更新: 2011/02/04 10:21 by Takuya Nishimoto
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0