-
大小: 1.43MB文件類(lèi)型: .zip金幣: 2下載: 0 次發(fā)布日期: 2023-11-14
- 語(yǔ)言: C/C++
- 標(biāo)簽: leap??motion;??MSP430G2553;??機(jī)械手;??
資源簡(jiǎn)介
針對(duì)目前五指仿人五指機(jī)械手控制方式的局限性,我們?cè)O(shè)計(jì)了一種以操作人員體感手勢(shì)圖像為輸入控制信號(hào),操控五指仿人五指機(jī)械手的手指按照體感手勢(shì)進(jìn)行實(shí)時(shí)地動(dòng)作的機(jī)械手控制系統(tǒng)。系統(tǒng)首次采用Leap Motion作為體感設(shè)備采集手勢(shì)數(shù)據(jù);利用計(jì)算機(jī)程序分析體感數(shù)據(jù),發(fā)現(xiàn)手勢(shì)并進(jìn)行判別;運(yùn)用MSP430單片機(jī)設(shè)定體感手勢(shì)對(duì)應(yīng)的控制指令;五指仿生機(jī)械手按照單片機(jī)的控制指令,完成指定的動(dòng)作。經(jīng)過(guò)實(shí)際裝置測(cè)試,五指仿真機(jī)械手的手指可以按照體感手勢(shì)進(jìn)行實(shí)時(shí)地動(dòng)作。
本項(xiàng)目包含三部分內(nèi)容
(1)基于Leap Motion API所編寫(xiě)的手勢(shì)判斷處理模塊,該程序在Leap API自帶的Gesture之外,可識(shí)別“剪刀”“石頭”“布”“豎起大拇指”等4種手勢(shì)。
(2)Leap Motion上位機(jī)與MSP430G2553單片機(jī)串口通信程序。
(3)MSP430G2553接收上位機(jī)傳來(lái)參數(shù)并產(chǎn)生相應(yīng)PWM波控制舵機(jī)程序。
上位機(jī)開(kāi)發(fā)環(huán)境:Win7+VS2013 語(yǔ)言 C++
單片機(jī)開(kāi)發(fā)環(huán)境:Win7+CCS V5.5 語(yǔ)言 C
本項(xiàng)目受中國(guó)石油大學(xué)(華東)大學(xué)生創(chuàng)新訓(xùn)練項(xiàng)目支持

代碼片段和文件信息
/******************************************************************************\
*?Copyright?(C)?2012-2014?Leap?Motion?Inc.?All?rights?reserved.???????????????*
*?Leap?Motion?proprietary?and?confidential.?Not?for?distribution.??????????????*
*?Use?subject?to?the?terms?of?the?Leap?Motion?SDK?Agreement?available?at???????*
*?https://developer.leapmotion.com/sdk_agreement?or?another?agreement?????????*
*?between?Leap?Motion?and?you?your?company?or?other?organization.?????????????*
\******************************************************************************/
#include?
#include?
#include?“Leap.h“
#include?“COM.h“
using?namespace?Leap;
class?SampleListener?:?public?Listener?{
??public:
????virtual?void?onInit(const?Controller&);
????virtual?void?onConnect(const?Controller&);
????virtual?void?onDisconnect(const?Controller&);
????virtual?void?onExit(const?Controller&);
????virtual?void?onframe(const?Controller&);
????virtual?void?onfocusGained(const?Controller&);
????virtual?void?onfocusLost(const?Controller&);
????virtual?void?onDeviceChange(const?Controller&);
????virtual?void?onServiceConnect(const?Controller&);
????virtual?void?onServiceDisconnect(const?Controller&);
??private:
};
const?std::string?fingerNames[]?=?{“Thumb“?“Index“?“Middle“?“Ring“?“Pinky“};
const?std::string?boneNames[]?=?{“metacarpal“?“Proximal“?“Middle“?“Distal“};
const?std::string?stateNames[]?=?{“STATE_INVALID“?“STATE_START“?“STATE_UPDATE“?“STATE_END“};
void?SampleListener::onInit(const?Controller&?controller)?{
??std::cout?<“Initialized“?<}
void?SampleListener::onConnect(const?Controller&?controller)?{
??std::cout?<“Connected“?<??controller.enableGesture(Gesture::TYPE_CIRCLE);
??controller.enableGesture(Gesture::TYPE_KEY_TAP);
??controller.enableGesture(Gesture::TYPE_SCREEN_TAP);
??controller.enableGesture(Gesture::TYPE_SWIPE);
}
void?SampleListener::onDisconnect(const?Controller&?controller)?{
??//?Note:?not?dispatched?when?running?in?a?debugger.
??std::cout?<“Disconnected“?<}
void?SampleListener::onExit(const?Controller&?controller)?{
??std::cout?<“Exited“?<}
void?SampleListener::onframe(const?Controller&?controller)?{
??//?Get?the?most?recent?frame?and?report?some?basic?information
??const?frame?frame?=?controller.frame();
?/*?std::cout?<“frame?id:?“?<ame.id()
????????????<“?timestamp:?“?<ame.timestamp()
????????????<“?hands:?“?<ame.hands().count()
<“?extended?fingers:?“?<ame.fingers().extended().count()
????????????<“?tools:?“?<ame.tools().count()
????????????<“?gestures:?“?<ame.gestures().count()?<
??/**根據(jù)手指數(shù)量識(shí)別手勢(shì)動(dòng)作**?start?**/
??switch?(frame.fingers().extended().count())
??{
case?0:
{
??std::cout?<“fast“?< ??CmdNum?=?2;
??Write[0]?=?CmdNum;
??WriteFile(hCom?Write?strlen(Write)?&dwTX?NULL);?//發(fā)送字符
??brea
?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----
?????目錄???????????0??2015-06-13?22:31??Leap?Motion上位機(jī)程序\
?????文件????????3089??2015-04-28?22:41??Leap?Motion上位機(jī)程序\COM.h
?????目錄???????????0??2015-06-13?01:14??Leap?Motion上位機(jī)程序\Debug\
?????文件?????1150800??2015-03-21?10:10??Leap?Motion上位機(jī)程序\Debug\Leap.dll
?????文件??????114176??2015-05-05?23:13??Leap?Motion上位機(jī)程序\Debug\Sample.exe
?????文件?????1044892??2015-05-05?23:13??Leap?Motion上位機(jī)程序\Debug\Sample.ilk
?????文件??????343888??2015-05-05?23:13??Leap?Motion上位機(jī)程序\Debug\Sample.obj
?????文件?????1739776??2015-05-05?23:13??Leap?Motion上位機(jī)程序\Debug\Sample.pdb
?????文件????????2751??2015-05-05?23:13??Leap?Motion上位機(jī)程序\Debug\SampleVS2012.log
?????目錄???????????0??2015-06-13?01:14??Leap?Motion上位機(jī)程序\Debug\SampleVS2012.tlog\
?????文件????????1274??2015-05-05?23:13??Leap?Motion上位機(jī)程序\Debug\SampleVS2012.tlog\cl.command.1.tlog
?????文件???????31330??2015-05-05?23:13??Leap?Motion上位機(jī)程序\Debug\SampleVS2012.tlog\CL.read.1.tlog
?????文件????????1180??2015-05-05?23:13??Leap?Motion上位機(jī)程序\Debug\SampleVS2012.tlog\CL.write.1.tlog
?????文件????????2232??2015-05-05?23:13??Leap?Motion上位機(jī)程序\Debug\SampleVS2012.tlog\li
?????文件????????3202??2015-05-05?23:13??Leap?Motion上位機(jī)程序\Debug\SampleVS2012.tlog\li
?????文件????????1196??2015-05-05?23:13??Leap?Motion上位機(jī)程序\Debug\SampleVS2012.tlog\li
?????文件?????????264??2015-05-05?23:13??Leap?Motion上位機(jī)程序\Debug\SampleVS2012.tlog\SampleVS2012.lastbuildstate
?????文件??????797696??2015-05-05?23:13??Leap?Motion上位機(jī)程序\Debug\vc120.idb
?????文件??????512000??2015-05-05?23:13??Leap?Motion上位機(jī)程序\Debug\vc120.pdb
?????文件???????10690??2015-05-05?23:22??Leap?Motion上位機(jī)程序\Sample.cpp
?????文件????????1212??2015-03-21?10:11??Leap?Motion上位機(jī)程序\SampleVS2012.sln
?????文件???????27136??2015-05-05?23:22??Leap?Motion上位機(jī)程序\SampleVS2012.v12.suo
?????文件???????10065??2015-04-28?22:41??Leap?Motion上位機(jī)程序\SampleVS2012.vcxproj
?????文件?????????165??2015-04-27?21:30??Leap?Motion上位機(jī)程序\SampleVS2012.vcxproj.user
?????文件?????????160??2015-06-13?22:33??Leap?Motion上位機(jī)程序\程序說(shuō)明.txt
?????目錄???????????0??2015-06-13?01:14??Leap_G2553\
?????文件?????????464??2014-05-08?16:06??Leap_G2553\.ccsproject
?????文件???????22974??2014-05-08?16:07??Leap_G2553\.cproject
?????目錄???????????0??2015-06-13?01:14??Leap_G2553\.launches\
?????文件????????3848??2015-04-09?10:31??Leap_G2553\.launches\Leap_G2553.launch
?????文件?????????840??2014-05-08?16:06??Leap_G2553\.project
............此處省略46個(gè)文件信息
- 上一篇:CNC雕刻機(jī)控制軟件
- 下一篇:MFC聊天室含源代碼.rar
評(píng)論
共有 條評(píng)論