kinect受信用ライブラリ

Committer:
skouki
Date:
Tue Aug 28 04:43:00 2018 +0000
Revision:
0:cb6fcdae7ecf
ver2

Who changed what in which revision?

UserRevisionLine numberNew contents of line
skouki 0:cb6fcdae7ecf 1 #include "kinectRX.h"
skouki 0:cb6fcdae7ecf 2 KinectRX::KinectRX():
skouki 0:cb6fcdae7ecf 3 fep(FEP_TX,FEP_RX,FEP_NUM)
skouki 0:cb6fcdae7ecf 4 {
skouki 0:cb6fcdae7ecf 5 }
skouki 0:cb6fcdae7ecf 6
skouki 0:cb6fcdae7ecf 7
skouki 0:cb6fcdae7ecf 8 void KinectRX::receive_data(){
skouki 0:cb6fcdae7ecf 9 len = 5;
skouki 0:cb6fcdae7ecf 10 while(true){
skouki 0:cb6fcdae7ecf 11 count ++;
skouki 0:cb6fcdae7ecf 12 temp = fep.read(data,len);
skouki 0:cb6fcdae7ecf 13 if(temp == 0) {
skouki 0:cb6fcdae7ecf 14 count = 0;
skouki 0:cb6fcdae7ecf 15 break;
skouki 0:cb6fcdae7ecf 16 }
skouki 0:cb6fcdae7ecf 17 if(count > 10){
skouki 0:cb6fcdae7ecf 18 count = 0;
skouki 0:cb6fcdae7ecf 19 break;
skouki 0:cb6fcdae7ecf 20 }
skouki 0:cb6fcdae7ecf 21 }
skouki 0:cb6fcdae7ecf 22 }
skouki 0:cb6fcdae7ecf 23
skouki 0:cb6fcdae7ecf 24 int KinectRX::get_mode(){
skouki 0:cb6fcdae7ecf 25 return(data[4]);
skouki 0:cb6fcdae7ecf 26 }
skouki 0:cb6fcdae7ecf 27
skouki 0:cb6fcdae7ecf 28 int KinectRX::get_distance(){
skouki 0:cb6fcdae7ecf 29 return(data[0] * 1000 + data[1] * 100 + data[2] * 10 + data[3]);
skouki 0:cb6fcdae7ecf 30 }