资源简介
Kinect体感机器人,详见博文:https://blog.csdn.net/MDL13412/article/details/8023811
代码片段和文件信息
/*
* Copyright (C) 2012 NsLib
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not write to the Free
* Software Foundation Inc. 675 Mass Ave Cambridge MA 02139 USA.
*/
#include
#include
#include “include/AppConfig.h“
#include “include/CheckHelper.h“
#include “include/TrackerViewer.h“
#include “include/Communication.h“
#include “include/ControlRobot.h“
#define CONFIG_xml_PATH “./Config.xml“
NsLib::ControlRobot g_controlRobot;
//#define MOCK_COMMUNICATION
int main(int argc char **argv)
{
// 解析命令行参数并配置程序
NsAppConfig().init(argc argv);
// PC机与机器人的通信设施
#ifdef MOCK_COMMUNICATION
NsLib::MockCommunication communication;
#else
NsLib::SerialPortCommunication communication;
#endif
if (!NsLib::CheckInitError(communication.init()
“Can‘t init communication“))
return 1;
// 机器人控制设施
if (!NsLib::CheckInitError(g_controlRobot.init(&communication)
“Can‘t init robot controller“))
return 1;
XnStatus result;
xn::Context context;
xn::scriptNode scriptNode;
xn::Enumerationerrors errors;
// 使用xml文件配置OpenNI库
result = context.InitFromxmlFile(CONFIG_xml_PATH scriptNode &errors);
if (XN_STATUS_NO_NODE_PRESENT == result)
{
XnChar strError[1024];
errors.ToString(strError 1024);
NsLog()->error(strError);
return 1;
}
else if (!NsLib::CheckOpenNIError(result “Open config xml fialed“))
return 1;
NsLib::TrackerViewer::createInstance(context scriptNode);
NsLib::TrackerViewer &trackerViewer = NsLib::TrackerViewer::getInstance();
if (!trackerViewer.init())
return 1;
trackerViewer.run();
NsLib::TrackerViewer::destroyInstance(trackerViewer);
return 0;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2012-06-30 21:05 KinectControlRobot\
文件 144 2012-06-25 23:42 KinectControlRobot\.dep.inc
目录 0 2012-06-30 21:13 KinectControlRobot\.git\
文件 23 2012-04-14 17:54 KinectControlRobot\.git\HEAD
目录 0 2012-04-14 17:54 KinectControlRobot\.git\branches\
文件 96 2012-04-14 17:54 KinectControlRobot\.git\config
目录 0 2012-04-14 17:54 KinectControlRobot\.git\hooks\
文件 21736 2012-06-30 21:13 KinectControlRobot\.git\index
目录 0 2012-04-14 20:09 KinectControlRobot\.git\logs\
文件 2669 2012-06-30 21:13 KinectControlRobot\.git\logs\HEAD
目录 0 2012-04-14 17:54 KinectControlRobot\.git\logs\refs\
目录 0 2012-04-15 14:53 KinectControlRobot\.git\logs\refs\heads\
文件 156 2012-04-15 14:53 KinectControlRobot\.git\logs\refs\heads\Init-0.0.0.1
文件 2669 2012-06-30 21:13 KinectControlRobot\.git\logs\refs\heads\master
目录 0 2012-06-30 21:13 KinectControlRobot\.git\ob
目录 0 2012-04-14 20:09 KinectControlRobot\.git\ob
文件 5374 2012-04-14 20:09 KinectControlRobot\.git\ob
文件 108 2012-04-14 20:09 KinectControlRobot\.git\ob
目录 0 2012-04-15 11:44 KinectControlRobot\.git\ob
文件 268 2012-04-14 20:09 KinectControlRobot\.git\ob
文件 1919 2012-04-14 20:09 KinectControlRobot\.git\ob
文件 66 2012-04-15 11:44 KinectControlRobot\.git\ob
目录 0 2012-06-24 20:43 KinectControlRobot\.git\ob
文件 65 2012-04-15 11:44 KinectControlRobot\.git\ob
文件 473 2012-04-14 20:09 KinectControlRobot\.git\ob
文件 386 2012-06-24 20:43 KinectControlRobot\.git\ob
文件 2263 2012-04-14 20:09 KinectControlRobot\.git\ob
目录 0 2012-04-14 20:09 KinectControlRobot\.git\ob
文件 45 2012-04-14 20:09 KinectControlRobot\.git\ob
目录 0 2012-06-30 21:13 KinectControlRobot\.git\ob
文件 1687 2012-06-25 23:43 KinectControlRobot\.git\ob
............此处省略5336个文件信息
- 上一篇:试题管理系统 大学毕业论文 带完整源码
- 下一篇:Kinect体感机器人中文报告
评论
共有 条评论