LoginSignup
0
0

More than 3 years have passed since last update.

Ubuntu 16.04にLeapMotionを導入

Posted at

1.まずLeapにユーザー登録。

2.その後、SDKをインストール

https://developer.leapmotion.com/sdk/v2
今回は、Leap Motion SDK v2.3.1 を選択した
ダウンロードしたディレクトリに移動後

3.SDK展開

$ tar xvzf Leap_Motion_SDK_Linux_2.3.1.tgz 
$ cd LeapDeveloperKit_2.3.1+31549_linux/
$ sudo dpkg -i Leap-2.3.1+31549-x64.deb

ここでエラー発生

(データベースを読み込んでいます ... 現在 498964 個のファイルとディレクトリがインストールされています。)
Leap-2.3.1+31549-x64.deb を展開する準備をしています ...
Failed to stop leapd.service: Unit leapd.service not loaded.
leap (2.3.1+31549) で (2.3.1+31549 に) 上書き展開しています ...
'/etc/init.d/leapd' を削除しました
leap (2.3.1+31549) を設定しています ...
Leap Motion installed under /usr/bin and /usr/sbin
Failed to start leapd.service: Unit leapd.service not found.
dpkg: パッケージ leap の処理中にエラーが発生しました (--install):
サブプロセス インストール済みの post-installation スクリプト はエラー終了ステータス 5 を返しました
ureadahead (0.100.0-19) のトリガを処理しています ...
処理中にエラーが発生しました:
leap

$ cd /lib/systemd/system
$ sudo vim leapd.service

下記をコピペ

/lib/systemd/system/leapd.service
[Unit]
Description=LeapMotion Daemon
After=syslog.target

[Service]
Type=simple
ExecStart=/usr/sbin/leapd

[Install]
WantedBy=multi-user.target
$ sudo ln -s /lib/systemd/system/leapd.service /etc/systemd/system/leapd.service
$ systemctl daemon-reload

再チャレンジ。

$ sudo dpkg -i Leap-2.3.1+31549-x64.deb

無事成功

$ sudo dpkg -r leap

4.leapを起動!

$ sudo leapd

失敗した。下記がエラー

Configuration file not found
Resetting /var//.Leap Motion/config.json.
[Critical] WebSocket server failed to start
[Critical] Secure WebSocket server failed to start
[Critical] Have you tried running as root/Administrator?
[Info] Leap Motion Controller detected: LP43642036937
[Info] Firmware is up to date.

デーモンの状態を確認

$ sudo service leapd status

● leapd.service - LeapMotion Daemon
Loaded: loaded (/lib/systemd/system/leapd.service; linked; vendor preset: enabled)
Active: active (running) since 月 2019-11-04 18:03:08 JST; 17min ago
Main PID: 14150 (leapd)
CGroup: /system.slice/leapd.service
└─14150 /usr/sbin/leapd
11月 04 18:03:08 kpc systemd[1]: Started LeapMotion Daemon.
11月 04 18:03:08 kpc leapd[14150]: Configuration file not found
11月 04 18:03:08 kpc leapd[14150]: Resetting /var//.Leap Motion/config.json.
11月 04 18:03:08 kpc leapd[14150]: [Info] WebSocket server started
11月 04 18:03:08 kpc leapd[14150]: [Info] Secure WebSocket server started
11月 04 18:03:14 kpc leapd[14150]: [Info] Leap Motion Controller detected: LP43642036937
11月 04 18:03:14 kpc leapd[14150]: [Info] Firmware is up to date.

動いているようだ・・・?
試しに、LeapControlPanelを起動してみる。

$ LeapControlPanel

すると、「汚れが検出されました」のメッセージとともに、左上にアイコンが小さく出ているような・・・
それをクリックすると、やっと「Diagnostic Visualizer」を発見。

しかし何も検出しない・・・

[18:03:08] [Info] WebSocket server started
[18:03:08] [Info] Secure WebSocket server started
[18:03:14] [Info] Leap Motion Controller detected: LP43642036937
[18:03:14] [Info] Firmware is up to date.
[18:26:39] [Info] Tracking optimized for head-mounted device
[18:26:40] [Info] Tracking optimized for up-facing device
[18:27:38] [Info] Connected to Leap Daemon
[18:27:38] [Info] Tracking resumed
[18:27:46] [Warning] Smudge detected. Your Leap Motion Controller may function better if you clean the window.

ウィンドーをきれいにしろとな。左上のapp名に被って表示されているからか。
本来ならば、右上にアイコンが緑色のランプで表示されるらしい。

いろいろ試すうちに、オレンジ色のランプから緑に変わった。
しかし、なんにしろappの上にアイコンが表示されててクリックできないので、一回再起動しよう・・・

PC再起動。

$ sudo leapd
$ LeapControlPanel

手が映った!!!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0