/****************************************************************************
* *
* OpenNI 1.x Alpha *
* Copyright (C) 2011 PrimeSense Ltd. *
* *
* This file is part of OpenNI. *
* *
* OpenNI is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as published *
* by the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* OpenNI 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 Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with OpenNI. If not, see <http://www.gnu.org/licenses/>. *
* *
****************************************************************************/
/*
* 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.
*/
/**
* @file SceneDrawer.cpp
* @author 马冬亮
* @brief 绘制骨骼图像, 由于效率因素, 大量函数内联实现.
*
* @details 本程序使用了OpenNI例程中显示骨骼的部分, 对OpenGL有部分修改.
*/
#include "../include/SceneDrawer.h"
#include <iostream>
#include <cmath>
#include <limits>
#include <map>
#include <GL/glut.h>
#include "../include/AppConfig.h"
#include "../include/TrackerViewer.h"
#include "../include/ControlRobot.h"
#include "../include/MyLogger.h"
/**
* @brief 机器人控制.
* @ingroup SceneDrawer
*/
extern NsLib::ControlRobot g_controlRobot;
namespace NsLib
{
////////////////////////////////////////////////////////////////////////////////
// 追踪设置
////////////////////////////////////////////////////////////////////////////////
/**
* @brief 追踪用户的数量, 由于我们的嵌入式开发板性能有限, 只能追踪一个用户.
* @ingroup SceneDrawer
*/
#define MAX_TRACK_USER (1)
/**
* @brief Kinect捕获关节的确认度阀值.
* @ingroup SceneDrawer
*/
#define JOINT_CONFIDENCE (0.35)
////////////////////////////////////////////////////////////////////////////////
// 调试开关
////////////////////////////////////////////////////////////////////////////////
/**
* @brief 调试信息总开关.
* @ingroup SceneDrawer
*/
//#define DEBUG_MSG_ON
#ifdef DEBUG_MSG_ON
/**
* @brief 用于分割调试信息.
* @ingroup SceneDrawer
*/
#define DEBUG_MSG_SPLITER
/**
* @brief 输出左臂的调试信息.
* @ingroup SceneDrawer
*/
#define DEBUG_MSG_LEFT_ARM
/**
* @brief 输出右臂的调试信息.
* @ingroup SceneDrawer
*/
#define DEBUG_MSG_RIGHT_ARM
/**
* @brief 输出左腿的调试信息.
* @ingroup SceneDrawer
*/
#define DEBUG_MSG_LEFT_LEG
/**
* @brief 输出右腿的调试信息.
* @ingroup SceneDrawer
*/
#define DEBUG_MSG_RIGHT_LEG
/**
* @brief 输出机器人姿势.
* @ingroup SceneDrawer
*/
#define DEBUG_MSG_POSE
#endif // DEBUG_MSG_ON
////////////////////////////////////////////////////////////////////////////////
// 姿势检测阀值
////////////////////////////////////////////////////////////////////////////////
/**
* @brief 机器人下蹲的角度阀值.
* @ingroup SceneDrawer
*/
#define ROBOT_POSE_SQUAT_THRESHOLD (75)
/**
* @brief 机器人向前走角度阀值.
* @ingroup SceneDrawer
*/
#define ROBOT_POSE_WALK_FRONT_THRESHOLD (75)
/**
* @brief 机器人向后走角度阀值.
* @ingroup SceneDrawer
*/
#define ROBOT_POSE_WALK_BACK_THRESHOLD (120)
/**
* @brief 机器人向后左角度阀值.
* @ingroup SceneDrawer
*/
#define ROBOT_POSE_WALK_LEFT_THRESHOLD (75)
/**
* @brief 机器人向后右角度阀值.
* @ingroup SceneDrawer
*/
#define ROBOT_POSE_WALK_RIGHT_THRESHOLD (75)
////////////////////////////////////////////////////////////////////////////////
// 滤波阀值
////////////////////////////////////////////////////////////////////////////////
/**
* @brief 左肩膀过滤阀值.
* @ingroup SceneDrawer
*/
#define FILTER_LEFT_SHOULDER (25)
/**
* @brief 左肘过滤阀值.
* @ingroup SceneDrawer
*/
#define FILTER_LEFT_ELBOW (50)
/**
* @brief 左手过滤阀值.
* @ingroup SceneDrawer
*/
#define FILTER_LEFT_HAND (50)
/**
* @brief 右肩膀过滤阀值.
* @ingroup SceneDrawer
*/
#define FILTER_RIGHT_SHOULDER (25)
/**
* @brief 右肘过滤阀值.
* @ingroup SceneDrawer
*/
#define FILTER_RIGHT_ELBOW (50)
/**
* @brief 右手过滤阀值.
* @ingroup SceneDrawer
*/
#define FILTER_RIGHT_HAND (50)
/**
* @brief 左髋过滤阀值.
* @ingroup SceneDrawer
*/
#define FILTER_LEFT_HIP (50)
/**
* @brief 左膝过滤阀值.
* @ingroup SceneDrawer
*/
#define FILTER_LEFT_KNEE (50)
/**
* @brief 左脚过滤阀值.
* @ingroup SceneDrawer
*/
#define FILTER_LEFT_FOOT (50)
/**
* @brief 右髋过滤阀值.
* @ingroup SceneDrawer
*/
#define FILTER_RIGHT_HIP (50)
/**
* @brief 右膝过滤阀值.
* @ingroup SceneDrawer
*/
#define FILTER_RIGHT_KNEE (50)
/**
* @brief 右脚过滤阀值.
* @ingroup SceneDrawer
*/
#define FILTER_RIGHT_FOOT (50)
////////////////////////////////////////////////////////////////////////////////
// OpenNI使用
////////////////////////////////////////////////////////////////////////////////
static std::map<XnUInt32, std::pair<XnCalibrationStatus,
XnPoseDetectionStatus> > s_Errors;
void XN_CALLBACK_TYPE MyCalibrationInProgress(xn::SkeletonCapability& capability,
XnUserID id,
XnCalibrationStatus calibrationError,
void* pCookie)
{
s_Errors[id].first = calibrationError;
}
void XN_CALLBACK_TYPE MyPoseInProgress(xn::PoseDetectionCapability& capability,
const XnChar* strPose,
XnUserID id,
XnPoseDetectionStatus poseError,
void* pCookie)
{
s_Errors[id].second = poseError;
}
unsigned int getClosestPowerOfTwo(unsigned int n)
{
unsigned int m = 2;
while(m < n) m<<=1;
return m;
}
GLuint initTexture(void** buf, int& width, int& height)
{
GLuint texID = 0;
glGenTextures(1,&texID);
没有合适的资源?快使用搜索试试~ 我知道了~
Kinect体感机器人上位机源码
共984个文件
html:141个
h:33个
png:18个
5星 · 超过95%的资源 需积分: 0 156 下载量 102 浏览量
2017-04-26
13:45:43
上传
评论 10
收藏 2.77MB ZIP 举报
温馨提示
Kinect体感机器人,详见博文:https://blog.csdn.net/MDL13412/article/details/8023811
资源推荐
资源详情
资源评论
收起资源包目录
Kinect体感机器人上位机源码 (984个子文件)
0003885899c4a42c46162a4b8f32dd1b8541f2 3KB
0053a4296dd20141d5b8bd229c2f4118fb1f31 2KB
00828fefb4408feff39bf9c8cf018179cc9364 82B
00afa26aadb22643871d647cf42d12d2c3e88b 96B
0115066eb56379edaea185401b12393166abac 107B
0129bfe36d6570907d58c0630521ab2a3ceaa3 980B
014cfccfde94aeacec8bf7f14921efc8d0b9d4 2KB
018628b5b45cb4301037485a29d7d74ac22138 697B
01d07ee02920191f2e841b08d38eaafb775894 4KB
02c1e4a5ebd998414f692510f4696602273568 3KB
0453dba0d5a7890d4bcab11698ffacb48d6b36 2KB
04998dbeccc589e4cffb831622d97cef1381ff 2KB
04e58ee0ca4a6425b126fc93e019c416785d3b 632B
055e3690d29d70e2ffc7439a06174aec0b2605 415B
05911ae8a04bccd2ae34882a1207767f42293e 2KB
05932e74ffe9b50e7fc5263cf308fe87891069 100B
06dfee01679a02f8a1013af0eaa6b136d21d61 2KB
070e73d510e221c5a5290d078f36f48f57e85b 3KB
07a16207e67c95fe2ee17e7016e6d08ac7ac99 176B
07b0ec591f3445de7f094bcfbc13a960a0e7a4 124B
080baa80cf598f1ed0759669ca399763dee059 69B
0828639c05344caf6e818126c3cd558492d9e6 68B
0878e741febc055441e0c594e488f103cd753b 477B
088278e096e9e2397b425a030e789cfe1c5de1 45B
097041559a43c48bbfb9a73b72b1d2d8b889bb 71B
09e86fec97a03c50e3f3d71c44569e5df3bebc 45B
0a669a0f77785944f020f2e6877d69902c5b60 3KB
0a6fa8a7ea839b0adbcf76d3749651b24ba42c 1KB
0ab6fb4ea432c9e21a7f6c2739d32af282555c 685B
0b55b8ba8c2c772d48c68e046c10023e5357e4 90B
0bdf90f94d6bddbb3bc8e9d605d5b57f052954 71B
0c2fd4bae96b6bb5a1e6ea87a0da714ac199b4 1KB
0c96c375b3e11dddd0f4d9241d969720e65a7d 45B
0cb95b1abcb3fb3abb67dd77873bda48156c61 7KB
0cd14cc2f9844f11d324e1eeb95dc80c17f115 3KB
0d05df90e74849f7304f0cf7bd921a7077fd36 280B
0d13f2b8d121b3a9c0f737b6bce056c813d6bf 1KB
0db51dd4dadced58947090b056e16d210d0c89 209B
0dbc09cf6ac3fd74e4c275e8c483a9c2217853 892B
0df17c05e1cc9e571545bfb0da55e46a8140fb 3KB
0e5a68fa2071f6d0df05681a35b3d16a290930 159B
0e64f86d7c75b72076fafa1ba70c0e720212f1 1KB
0ecd97b823212f2a3411a5e285e4a130a25bcb 45B
0f2682f303ee25df2fdf05741357c422e89ef1 2KB
0f5829b6e7089a1b4fda1c4890ec5b093fdd96 123B
0f62c617a72cd7d71f7e96f8b4837a4ab15ea9 5KB
0f73fff91360523b3589210af21792e53f0294 387B
0fe90250f9f1778095ce9a4a7175aad1e901b4 108B
Init-0.0.0.1 156B
Init-0.0.0.1 41B
107a60fcef08b62ae9e1286c38d2f3779bea58 1KB
108c393b2b505c18bd2add28bb7555efdb9063 176B
109bea340d107f3ed65d92c9f0d390cd4064c0 2KB
10a6dbd64f1b758c93ba862b0d8ce88da72032 720B
10bf8ad03b3d470d503e82770f3aa41d82762c 1KB
10e50b66d45617d4db76db468bed5b4e4caba7 2KB
10ea453045fdc6a901e0bc83785619980bd0b5 2KB
13000f1d59710c4435591dd223b33987d0f216 96B
1347bdccf1a53a0d7af85bf4e5179fcb4f3694 2KB
137a92bc3929303df96852497481f3a75c1069 86B
13824a85c4e4d0ce81c7917059b59bfd6ea0d0 387B
13a4dc8a2413654a8b55b3df867cba1adf7007 2KB
13ba67dda0da783d2fddd65c32ac7a97cd2e35 3KB
13cafecdb722bfb937fe286fc510c81af92f46 629B
14fd729d91c53fe790e04f871e0a5549b3bd4c 2KB
1502e7af8a3e35ffeca940740b82804800ebe1 176B
153e258a13481cbc24618c239107d9f0992494 2KB
157240dbd14fb346d5d97aef0633e098935018 617B
1578481716805a2f834942faa75c076654dcd0 68B
157a585beeabb58a82ced2d28e7e9493df8c3e 1KB
158ba3ab7005f828addcceeac74bd0d0853e7f 71B
164182368a86907e9e5820ef8141d2e9c96c3c 2KB
1751bb9f9b85db328e1b45ff575e90de0b1db3 5KB
176eef5323c7426ba15b214cce564b6799e971 100B
182158ecf59ada55f79cb0521b16eb68e3c0b7 45B
184c219207ddc7386d5fcb0da2591d12d191b8 388B
18b92865d1c7c11d0e7a58ccffaaabc1fcbb2c 658B
18f838bff05af6cba7661de5297f065b4275b5 1KB
1969f8b9a33f87018aa350601742c2b86ebcf7 596B
19d8e6a74a24b5d5ef6f52c121956d3a68ef6a 1KB
1a4782e840bc88cceb5e1582e9e5853725bc22 2KB
1ab9ec16291b21aeab5da0a098ad29aaae4f84 161B
1b546a1667831a001f5915b50d8dbee446ef08 8KB
1ce22f94b0bc9c336dc90ce16a409da55886db 4KB
1d87ceace884e5be239c96591f311efefbd565 1KB
1daf6fc19c390a12733c1c6d8a74d9a64287e9 6KB
1df1bf93dc39ff0e60a3a0391182822f996e33 2KB
1e0b2a106eb90484233bf1366901234cef19c9 2KB
1e177f31ce4b7f19abe76f5d46afc796ea08ce 1KB
1e51b2a09e85d96c0892190b47ad1ba0c8c878 12KB
1e5a164bad716fee863973f46de195020a331c 98B
1e8214cd24a3474226b4724bddb7d779f935b0 614B
1ecb06bd7fdd372ece066a817227ebc29ab354 2KB
1eecbee9ad2a795ddc033d11304b1de6cefcc9 4KB
1f20cee69ac05e2b93ed7ef7ad6778188ea814 296B
1f48f19bbe1f178d95397b98075bdd6d989328 210B
1f663e28379f4ebeb106c90670da87054341f4 415B
1fda03429e7b5bae032d42ea4134f5e5ce02d8 2KB
Init-Version-0.0.0.2 41B
20ff7bca8d9bce385b77f1ac4538d974b92f71 951B
共 984 条
- 1
- 2
- 3
- 4
- 5
- 6
- 10
资源评论
- 梦泽大地2017-11-13写的很好,很实用,还有源码。。。感谢分享
- Araragi菌2018-04-01这波可以,支持
凝霜
- 粉丝: 590
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功