使用Leap Motion遥控机器人做线性或旋转运动的示例参考一年前的博文。
http://blog.csdn.net/zhangrelay/article/details/52356417
效果录像:http://v.youku.com/v_show/id_XMTcwNjg2NTk4NA==.html
--123手势--
---------------------
1. Leap配置
在官网下载Leap_Motion_SDK_Linux_2.3.1.tgz。解压会发现如下文件:
tree -L 3
.
├── Leap-2.3.1+31549-x64.deb
├── Leap-2.3.1+31549-x86.deb
├── LeapSDK
│ ├── docs
│ │ ├── cpp
│ │ ├── csharp
│ │ ├── head_sha.txt
│ │ ├── images
│ │ ├── index.html
│ │ ├── java
│ │ ├── javascript
│ │ ├── Leap_SDK_Release_Notes.html
│ │ ├── objc
│ │ ├── python
│ │ ├── README.txt
│ │ ├── unity
│ │ ├── unreal
│ │ └── version.txt
│ ├── head_sha.txt
│ ├── include
│ │ ├── Leap.h
│ │ ├── Leap.i
│ │ └── LeapMath.h
│ ├── lib
│ │ ├── LeapCSharp.NET3.5.dll
│ │ ├── LeapCSharp.NET4.0.dll
│ │ ├── LeapJava.jar
│ │ ├── Leap.py
│ │ ├── UnityAssets
│ │ ├── x64
│ │ └── x86
│ ├── samples
│ │ ├── JSONViewer.html
│ │ ├── Makefile
│ │ ├── Sample.cpp
│ │ ├── Sample.cs
│ │ ├── Sample.html
│ │ ├── Sample.java
│ │ └── Sample.py
│ ├── util
│ │ ├── LeapScene.cpp
│ │ ├── LeapScene.h
│ │ ├── LeapUtil.cpp
│ │ ├── LeapUtilGL.cpp
│ │ ├── LeapUtilGL.h
│ │ └── LeapUtil.h
│ └── version.txt
├── README
└── README.txt
$ sudo dpkg -i Leap-2.3.1+31549-x64.deb
不报错即可安装完成,如果出错,例如如下:
$ sudo dpkg -i Leap-2.3.1+31549-x64.deb
[sudo] password for relaybot:
Selecting previously unselected package leap.
(Reading database ... 271440 files and directories currently installed.)
Preparing to unpack Leap-2.3.1+31549-x64.deb ...
Unpacking leap (2.3.1+31549) ...
dpkg: dependency problems prevent configuration of leap:
leap depends on libgl1-mesa-glx (>= 7.7.1) | libgl1-mesa-glx-lts-precise (>= 7.7.1) | libgl1-mesa-glx-lts-quantal (>= 7.7.1) | libgl1-mesa-glx-lts-raring (>= 7.7.1) | libgl1-mesa-glx-lts-saucy (>= 7.7.1) | libgl1-mesa-glx-lts-trusty (>= 7.7.1) | libgl1-mesa-glx-lts-utopic (>= 7.7.1) | libgl1-mesa-glx-lts-vivid (>= 7.7.1); however:
Package libgl1-mesa-glx is not installed.
Package libgl1-mesa-glx-lts-precise is not installed.
Package libgl1-mesa-glx-lts-quantal is not installed.
Package libgl1-mesa-glx-lts-raring is not installed.
Package libgl1-mesa-glx-lts-saucy is not installed.
Package libgl1-mesa-glx-lts-trusty is not installed.
Package libgl1-mesa-glx-lts-utopic is not installed.
Package libgl1-mesa-glx-lts-vivid is not installed.
dpkg: error processing package leap (--install):
dependency problems - leaving unconfigured
Processing triggers for ureadahead (0.100.0-16) ...
ureadahead will be reprofiled on next reboot
Errors were encountered while processing:
leap
这时,需要忽略liggl1-mesa-glx,这和系统已经安装的包冲突了。
$ sudo dpkg --ignore-depends=libgl1-mesa-glx -i Leap-2.3.1+31549-x64.deb
$ sudo dpkg --ignore-depends=libgl1-mesa-glx -i Leap-2.3.1+31549-x64.deb
Selecting previously unselected package leap.
(Reading database ... 271440 files and directories currently installed.)
Preparing to unpack Leap-2.3.1+31549-x64.deb ...
Unpacking leap (2.3.1+31549) ...
Setting up leap (2.3.1+31549) ...
Leap Motion installed under /usr/bin and /usr/sbin
leapd start/running, process 4208
Check Leap Motion daemon with:
service leapd status
Open the Leap Motion GUI with:
LeapControlPanel
See /usr/share/Leap/README.linux for more information.
Processing triggers for ureadahead (0.100.0-16) ...
如果需要卸载Leap: $ sudo dpkg -r leap。
更多详细说明请参考:
1. Leap在Linux的安装说明
2. Leap安装故障排除
配置:
$ sudo apt-get install ros-indigo-leap-motion
$ sudo cp Robotdemo_ws/LeapSDK/lib/x64/libLeap.so /usr/local/lib/
.bashrc
export LEAP_SDK=$LEAP_SDK:/home/relaybot/Robotdemo_ws/LeapSDK
export PYTHONPATH=$PYTHONPATH:/home/relaybot/Robotdemo_ws/LeapSDK/lib:/home/relaybot/Robotdemo_ws/LeapSDK/lib/x64
安装:
https://github.com/juancamilog/leap_client
启动:
$ roslaunch leap_client leap_client.launch
$ rviz
Leap Motion在github上还有一些功能包可供参考,可以进一步理解和掌握ROS和Leap Motion的使用。
---------------------
2. 机械手配置
这里,给出一些机械手的示例供参考,选择一款进行实验,仿真和实物皆可,通常而言仿真更为方便。
机械手可以在如下链接进行查找:http://robots.ros.org/
其中很多都有Gazebo模型可以用于仿真学习,当然也可以选择带有机械手的机器人。
http://wiki.ros.org/shadow_robot/Tutorials
---------------------
3. 综合实验
方案提示:
1. 将Leap各个手指关节位姿与机械手位姿进行映射,使得机械手跟随Leap位姿变化进行随动。(任意位姿)
2. 设定一些特征手势,Leap识别当前手势并发送消息给机械手,机械手响应做出对应手势。(特定位姿)
3. 其他有创意的方案也可以。
具体实现过程稍后再做补充。
---------------------