From 947f7d5d0c5c007a2ca779dc20c2f2dd03e8e602 Mon Sep 17 00:00:00 2001 From: gehongbo <1512161085@qq.com> Date: Wed, 4 May 2022 10:16:22 +0800 Subject: [PATCH 1/3] cv --- src/Djitellowhite/Djitellowhite.cpp | 44 ++++++++++++++-------------- src/Djitellowhite/T | Bin 0 -> 31008 bytes src/Djitellowhite/Triplet | Bin 19720 -> 0 bytes src/Djitellowhite/Triplet.cpp | 2 +- src/Djitellowhite/keyboard | Bin 17408 -> 0 bytes src/Djitellowhite/makefile | 21 +++++++++++++ src/Djitellowhite/server | Bin 17176 -> 0 bytes src/Djitellowhite/test | Bin 0 -> 31008 bytes 8 files changed, 44 insertions(+), 23 deletions(-) create mode 100755 src/Djitellowhite/T delete mode 100755 src/Djitellowhite/Triplet delete mode 100755 src/Djitellowhite/keyboard create mode 100644 src/Djitellowhite/makefile delete mode 100755 src/Djitellowhite/server create mode 100755 src/Djitellowhite/test diff --git a/src/Djitellowhite/Djitellowhite.cpp b/src/Djitellowhite/Djitellowhite.cpp index 12ad5ed..9ebb3b5 100644 --- a/src/Djitellowhite/Djitellowhite.cpp +++ b/src/Djitellowhite/Djitellowhite.cpp @@ -78,29 +78,29 @@ void* Tello::udp_response_receiver(void* arg){ void Tello::get_video(sockaddr_in serveraddr){ char tmp[10] = {"streamon"}; - send_message(tmp,serveraddr,0);// 0 -> timeout -// cout << "stream_on successfully!" <stream_on = true; -// -// cout << "vid"; -// VideoCapture cap("udp://@0.0.0.0:11111"); -// cout << "cap"; -// if(!cap.isOpened()){ -// cout << "fuck off"; -// return; -// } + send_message(tmp,serveraddr,0); + cout << "stream_on successfully!" <stream_on = true; + + cout << "vid"; + VideoCapture cap("udp://@0.0.0.0:11111"); + cout << "cap"; + if(!cap.isOpened()){ + cout << "fuck off"; + return; + } -// Mat frame; -// cout << "continue!"; -// while(1){ -// cap>>frame; -// if(frame.empty()) -// break; -// imshow("video",frame); -// waitKey(20); -// -// } -// cap.release(); + Mat frame; + cout << "continue!"; + while(1){ + cap>>frame; + if(frame.empty()) + break; + imshow("video",frame); + waitKey(20); + + } + cap.release(); } diff --git a/src/Djitellowhite/T b/src/Djitellowhite/T new file mode 100755 index 0000000000000000000000000000000000000000..b2cf1f764804d29794150c851830b28ce045ace3 GIT binary patch literal 31008 zcmeHw4Rlo1wf~uXKvYNqO63n&2Jiz#VkUeAD4LKAPK01ef>M=tGfXCAB*~03H+(J8 zXoSZ!rjO_U*;2JNZP!!Edp=Y8bOH4vLKmUbzm2vJd41ZZ_%$Q6#*fly(RsgpK5ouT z=CVp$>%F!9D<>Ype|6lM8> zr+V3xb3p7*Sa>D7RpYn;YOiM+DY!B zdV6HOJ+hvnPU%lYl|M-x{TEArrcx)$C^`8jW2yDl$a<-?T*@m-ZBVLy$E+JpdsVVt zZK=?cO26h1xT31PucIFMWootnC&u$!Ar9Tyw&9mzo1MB9`y{@rtc4MHqW%KOK z#q(#+pIZn2Rqr~D=OC%01hCyCKd#m{{9#)J!wU!1X{ z{5RFnYc5nes1C_cB6(?&#TO$-GSvT_Wk1PuFlP>7i}Ak%{|DcC=V^sCKAKdrmz z=E)N__+>Wj*4XH;w81a38TZGbKb<{~+KgkZ4Su^#yHDHr$8Xc_-8TMz%EtafHhLbn zkuR{(|ALMEWj1;?+xX$fHhP{PP3!$+c48e2*3#3EpRVyLyO+yPVqIQ^2>KJLCl&t+ z@aZg%RndWiv|A7sMt{el-EOHTALBu(m$y4qegN~3^h}y9nNv8g>4#e|;cg z`olGqWsSjRe~outqn{bZ`levB5iz}C(=dc+dcoUP7Wp>1if#$i`GaNNkl7OUF9`b^ z{oaV*y^$GdipyO#1>uN$)yisPPNmm$Q_bbjOw2rgQ^?$6RU$~!v0#%oU@rG>aR+2; z^8-zhhTtams^u%I%>{&^BU*W4ZT`pgPH*A<;RF72n+|^!u zxOpwZHoxwmei};)C%pi6D{5$NLV^kZyU}%d$?ufXnd{xVR)eA7@!_l_Dz?AZu zUZ@$K0(idC@OeXCUjRei#FYdaBVus*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BW^D?IVo`C(cKDYnpO20-KoNblO`qqhO!<8m%iH7kqSEK*f{*nx0X4ssSa^JCv zdX>RO6}aJQM11*8F6A^SB;X^xd!-+hHCLHp;e$;OI*0ng=u AY5)KL diff --git a/src/Djitellowhite/makefile b/src/Djitellowhite/makefile new file mode 100644 index 0000000..156373e --- /dev/null +++ b/src/Djitellowhite/makefile @@ -0,0 +1,21 @@ +obj = Djitellowhite.o keyboard.cpp Triplet.cpp +CXXFLAGS += -c -Wall $(shell pkg-config --cflags opencv4) +LDFLAGS += $(shell pkg-config --libs --static opencv4) +test : $(obj) + $(CXX) -o test $(obj) $(LDFLAGS) + +Djitellowhite.o : Djitellowhite.h + $(CXX) -c Djitellowhite.cpp $(CXXFLAGS) + +keyboard.o : Hardwarelistener.h + $(CXX) -c keyboard.cpp $(CXXFLAGS) + +Triplet : Djitellowhite.h Hardwarelistener.h + $(CXX) -c Triplet.cpp -lpthread $(CXXFLAGS) + +.PHONY : clean +clean : + rm test $(obj) + + + diff --git a/src/Djitellowhite/server b/src/Djitellowhite/server deleted file mode 100755 index 09df8ae37f8fe70c170159a9790f2614f1457879..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17176 zcmeHOe{dAl9e+vq5fm=Lf*@2_QAezkBcXr+8_k6zY-|vOL~RwWQ?N8W0syF1r(-EJIYOWl@yEaIyc>?^0Hr1wj-A8`jlOtvST`~ z;xXlXQcmbwtMcik8e~*7c@)BHcbl^F(nh7vlwwfX{H_)Hcj9eScDpp`MtEtf4GX3m z?`GIhUjEs_-MmS~E7T8rRQ{Q&^onIY;f_@+mi2_Hdcx6UUsYf2s;X5h{E3)dfmleP_6u`{_ z_>X~W__y78IfQ(D%Q2OG^{n2`qSa-!7$?57m6e^Ur`vX0HdYS9p27 zZOHn}pSr=u>6)N;Tt*x?0%yyp1HT}P3Nh}$eGdGL1LwJf!~+VSj=J+YeaM0H96ZgZbvDbk+=evCloMLm?@4z`nBzwkz)0pKl?7(L-2zuOs&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pp | 106 -------------------------- src/Djitellowhite/Djitellowhite.h | 72 ----------------- src/Djitellowhite/Hardwarelistener.h | 6 -- src/Djitellowhite/T | Bin 31008 -> 0 bytes src/Djitellowhite/Triplet.cpp | 45 ----------- src/Djitellowhite/keyboard.cpp | 52 ------------- src/Djitellowhite/libDjitellowhite.so | Bin 18152 -> 0 bytes src/Djitellowhite/makefile | 21 ----- src/Djitellowhite/server.cpp | 58 -------------- src/Djitellowhite/test | Bin 31008 -> 0 bytes 10 files changed, 360 deletions(-) delete mode 100644 src/Djitellowhite/Djitellowhite.cpp delete mode 100644 src/Djitellowhite/Djitellowhite.h delete mode 100644 src/Djitellowhite/Hardwarelistener.h delete mode 100755 src/Djitellowhite/T delete mode 100644 src/Djitellowhite/Triplet.cpp delete mode 100644 src/Djitellowhite/keyboard.cpp delete mode 100755 src/Djitellowhite/libDjitellowhite.so delete mode 100644 src/Djitellowhite/makefile delete mode 100644 src/Djitellowhite/server.cpp delete mode 100755 src/Djitellowhite/test diff --git a/src/Djitellowhite/Djitellowhite.cpp b/src/Djitellowhite/Djitellowhite.cpp deleted file mode 100644 index 9ebb3b5..0000000 --- a/src/Djitellowhite/Djitellowhite.cpp +++ /dev/null @@ -1,106 +0,0 @@ -#include"Djitellowhite.h" -#include -#include - - -#include -#include -#include - -#include -#include - -using namespace cv; -using namespace std; -Tello::Tello(const char* IP) { - this->stream_on=false; - this->host = inet_addr(IP); - cout << "create successfully!" << endl; - -} -Tello::~Tello() {} -void Tello::set_conf(int socket){ - this->sock = socket; -} -void Tello::get_connect(sockaddr_in serveraddr) { - char tmp[10] = {"command"}; - send_message(tmp,serveraddr,0);// 0 -> timeout - cout << "connect successfully!" <host; -} -void Tello::takeoff(sockaddr_in serveraddr) { - char tmp[10] = {"takeoff"}; - send_message(tmp,serveraddr,0);// 0 -> timeout - cout << "takeoff successfully!" < timeout - cout << "land successfully!" <sock,buffer,strlen(buffer),0,(struct sockaddr *)&server_addr, sizeof(server_addr)); - return true; -} -void* Tello::udp_response_receiver(void* arg){ - //int m_SockServer; //创建socket对象 - //sockaddr_in serveraddr; //创建sockaddr_in对象储存自身信息(当有多个端口,可以多个绑定) - //sockaddr_in serveraddrfrom; - - //serveraddr.sin_family = AF_INET; //设置服务器地址家族 - //serveraddr.sin_port = htons(8889); //设置服务器端口号 - //serveraddr.sin_addr.s_addr = inet_addr("0.0.0.0"); - //m_SockServer = socket(AF_INET, SOCK_DGRAM, 0); //创建一个临时变量并赋值给m_SockServer - //int i = bind(m_SockServer, (sockaddr*)&serveraddr, sizeof(serveraddr)); //把名字和套接字绑定 - //std::cout << "bind:" << i << std::endl; - - int socket = *(int *)arg; - - cout << "receive start" << endl; - while(1){ - char buffer[20]; - int iret; - memset(buffer,0,sizeof(buffer)); - - iret = recv(socket, buffer,20,MSG_WAITALL); - if(iret > 0 && iret <10){ - printf("Message from tello: %s\n", buffer); - } - } -} -void Tello::get_video(sockaddr_in serveraddr){ - - char tmp[10] = {"streamon"}; - send_message(tmp,serveraddr,0); - cout << "stream_on successfully!" <stream_on = true; - - cout << "vid"; - VideoCapture cap("udp://@0.0.0.0:11111"); - cout << "cap"; - if(!cap.isOpened()){ - cout << "fuck off"; - return; - } - - Mat frame; - cout << "continue!"; - while(1){ - cap>>frame; - if(frame.empty()) - break; - imshow("video",frame); - waitKey(20); - - } - cap.release(); - - -} diff --git a/src/Djitellowhite/Djitellowhite.h b/src/Djitellowhite/Djitellowhite.h deleted file mode 100644 index b311e46..0000000 --- a/src/Djitellowhite/Djitellowhite.h +++ /dev/null @@ -1,72 +0,0 @@ -#ifndef _DJITELLOWHITE_H -#define _DJITELLOWHITE_H -#include -#include -#include -#include -#include -#include -/*Library for interacting with DJI Ryze Tello drones.*/ - - -//coding = utf - 8 - -/* """C++ wrapper to interact with the Ryze Tello drone using the official Tello api. - Tello API documentation: - [1.3](https://dl-cdn.ryzerobotics.com/downloads/tello/20180910/Tello%20SDK%20Documentation%20EN_1.3.pdf) -*/ - -#define RESPONSE_TIMEOUT 7 //in seconds -#define TAKEOFF_TIMEOUT 20 //in seconds -#define FRAME_GRAB_TIMEOUT 3 -#define TIME_BTW_COMMANDS 0.1 //in seconds -#define TIME_BTW_RC_CONTROL_COMMANDS 0.001 //in seconds -#define RETRY_COUNT 3 //number of retries after a failed command - - -//Video stream, server socket -#define VS_UDP_IP "0.0.0.0" -#define VS_UDP_PORT 11111 - -#define CONTROL_UDP_PORT 8889 -#define STATE_UDP_PORT 8890 - -#define BUFFER_SIZE 1024 -//Constants for video settings -#define BITRATE_AUTO 0 -#define BITRATE_1MBPS 1 -#define BITRATE_2MBPS 2 -#define BITRATE_3MBPS 3 -#define BITRATE_4MBPS 4 -#define BITRATE_5MBPS 5 -#define RESOLUTION_480P "low" -#define RESOLUTION_720P "high" -#define FPS_5 "low" -#define FPS_15 "middle" -#define FPS_30 "high" -#define CAMERA_FORWARD 0 -#define CAMERA_DOWNWARD 1 -//日志模块暂时不写 - -class Tello { -private: - int sock; - bool stream_on; - unsigned long host; -public: - Tello(const char* IP); - ~Tello(); - void set_conf(int socket); - unsigned long gethost(); - void get_connect(sockaddr_in serveraddr); - void takeoff(sockaddr_in serveraddr); - void land(sockaddr_in serveraddr); - bool send_message(char* msg,sockaddr_in server_addr,int timeout = RESPONSE_TIMEOUT); - static void *udp_response_receiver(void* arg); - void get_video(sockaddr_in serveraddr); -}; - - - - -#endif diff --git a/src/Djitellowhite/Hardwarelistener.h b/src/Djitellowhite/Hardwarelistener.h deleted file mode 100644 index 176cde8..0000000 --- a/src/Djitellowhite/Hardwarelistener.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _HARDWARELISTENER_H -#define _HARDWARELISTENER_H - -int listenkeyboard(); -int scanKeyboard(); -#endif diff --git a/src/Djitellowhite/T b/src/Djitellowhite/T deleted file mode 100755 index b2cf1f764804d29794150c851830b28ce045ace3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 31008 zcmeHw4Rlo1wf~uXKvYNqO63n&2Jiz#VkU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=fU)()alfk` -using namespace std; -int main(void){ - Tello T("192.168.10.1"); - int socket_fd, err; - - if((socket_fd = socket(PF_INET,SOCK_DGRAM,IPPROTO_UDP))==-1) - { - cout << "initialized error" << endl; - cout << 0; - return -1; - } - - //cout << 1 << socket_fd; - T.set_conf(socket_fd); - - pthread_t thread_receive; - err = pthread_create(&thread_receive,nullptr,T.udp_response_receiver,&socket_fd); - sleep(3); - struct sockaddr_in serveraddr; - memset(&serveraddr,0,sizeof(serveraddr)); - serveraddr.sin_family=AF_INET; - serveraddr.sin_addr.s_addr=T.gethost(); - serveraddr.sin_port=htons(CONTROL_UDP_PORT); - - - - if(err!=0) - { - cout << err << " " << "can't create thread"; - } - - T.get_connect(serveraddr); - //sleep(1); - //T.takeoff(serveraddr); - T.get_video(serveraddr); - sleep(5); - //T.land(serveraddr); - - pthread_join(thread_receive,NULL); - listenkeyboard(); - return 0; -} diff --git a/src/Djitellowhite/keyboard.cpp b/src/Djitellowhite/keyboard.cpp deleted file mode 100644 index 3006537..0000000 --- a/src/Djitellowhite/keyboard.cpp +++ /dev/null @@ -1,52 +0,0 @@ -#include -#include -#include "Hardwarelistener.h" -#include -using namespace std; -int scanKeyboard() -{ - - int in; - - struct termios new_settings; - struct termios stored_settings; - //设置终端参数 - tcgetattr(0,&stored_settings); - new_settings = stored_settings; - new_settings.c_lflag &= (~ICANON); - new_settings.c_cc[VTIME] = 0; - tcgetattr(0,&stored_settings); - new_settings.c_cc[VMIN] = 1; - tcsetattr(0,TCSANOW,&new_settings); - in = getchar(); - tcsetattr(0,TCSANOW,&stored_settings); - - return in; - -} - -//测试函数 -int listenkeyboard(){ - while(1){ - switch(scanKeyboard()) - { - case (int)'w': - cout << "forward"<< endl; - break; - case (int)'s': - cout << "back" << endl; - break; - case (int)'a': - cout << "left" <N+|;A>n7Zw_KW;il z+cA}~0Ji=ED|998HE6p%x+8A-lx~kHw|5`xC@z;<_%yH6?G-x@b9KC!>hQ{Vk`Ed) zcdcy{P&-0>(WhI=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?^AdaU2RsN3Dk-!+RC-|7^aVw_N2EX9_t9ltuEoUp{8Uc8d?|$38~N;NVE!X zsH+{$6h$tUlpy&lfoUp_F(HeGqX9C|wT`GIymIdIqUvplfu%|!928!peSxK^7uvB< zzzPU&xK&TKtw;&9Ipssmy2^s3sAp`-%|SU!gq; zEI(x7=UAp5jWgl>3+C~$b)G#x?=qdkikjl~m{*pA!|Ti#x6k`FOt)xlwsW_C59GAf z!uGtc!_>e!g9`1Bl;Dr;dB0^nFj8TAe$Hmf`$ABWg?u>6AAzAg8n)->ai;X#M1}j$ zdQ4j(qdgzy`MI5GgS1xtCmrs;hD9eTf%)Aod)`-ITB+M-eeKq6<}sH&?>{hQ{bKe{y6kzM zf~h<>HU?#XOuy~6*NZ%#rVsE2p!UIb?DD%Vd*1h8%KM|N&*zc(7qvZ~f8o&*P4{S) zi7TAq?;#+J?Rg)C=~HZ|sk{9*T=u-*!nA=MYkM9)?Dj2GXpcf)ruM!J|33~qPFbJr znf@CDlO6WFe>1dDS+HI)`wt~%Pl z5`M=4AWW;P Y&h4@;JrftQZ@fck(En@TEG}03A3X&HVE_OC diff --git a/src/Djitellowhite/makefile b/src/Djitellowhite/makefile deleted file mode 100644 index 156373e..0000000 --- a/src/Djitellowhite/makefile +++ /dev/null @@ -1,21 +0,0 @@ -obj = Djitellowhite.o keyboard.cpp Triplet.cpp -CXXFLAGS += -c -Wall $(shell pkg-config --cflags opencv4) -LDFLAGS += $(shell pkg-config --libs --static opencv4) -test : $(obj) - $(CXX) -o test $(obj) $(LDFLAGS) - -Djitellowhite.o : Djitellowhite.h - $(CXX) -c Djitellowhite.cpp $(CXXFLAGS) - -keyboard.o : Hardwarelistener.h - $(CXX) -c keyboard.cpp $(CXXFLAGS) - -Triplet : Djitellowhite.h Hardwarelistener.h - $(CXX) -c Triplet.cpp -lpthread $(CXXFLAGS) - -.PHONY : clean -clean : - rm test $(obj) - - - diff --git a/src/Djitellowhite/server.cpp b/src/Djitellowhite/server.cpp deleted file mode 100644 index 581b3e7..0000000 --- a/src/Djitellowhite/server.cpp +++ /dev/null @@ -1,58 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#define PORT 8890 - -void udp_server(int sockfd) -{ - - socklen_t len; - char buf[1024] = {0}; - struct sockaddr_in server_addr; - int n; - int opt = 1; - len = sizeof(server_addr); - memset(&buf, 0, sizeof(buf)); - server_addr.sin_family = AF_INET; - server_addr.sin_addr.s_addr = htonl(INADDR_ANY); - server_addr.sin_port = htons(PORT); - - setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)); //当服务器非正常断开的时候重启服务器,不会进入TIME_WAIT状态 - - if (bind(sockfd, (struct sockaddr *)&server_addr, sizeof(server_addr)) < 0) { - printf("can not bind\n"); - exit(1); - } - - while (1) { - printf("========wait for client's request========\n"); - n = recvfrom(sockfd, buf, sizeof(buf), 0, (struct sockaddr *)&server_addr, &len); - buf[n] = '\0'; - printf("receive client's data: %s\n", buf); - sendto(sockfd, buf, n, 0, (struct sockaddr *)&server_addr, len); - printf("send data to client: %s\n", buf); - } - - close(sockfd); -} - -int main(int argc, char **argv) -{ - int sockfd; - - if ((sockfd = socket(PF_INET, SOCK_DGRAM, 0)) < 0) { - printf("create socket false\n"); - exit(1); - } - - udp_server(sockfd); - - exit(0); -} - - diff --git a/src/Djitellowhite/test b/src/Djitellowhite/test deleted file mode 100755 index db2feaccc29394fb46549aa6b0b1b6d6b949407f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 31008 zcmeHw4Rlo1x%Qs?K>Q(zD9Qyb1BjwX%!I!HMH7<2i6okmptQ<8nM@{RB*~03C;a${ zMk9Po)AaIrKU<2nrgqg@Z(CDrT|oVb&_$^A+Gy`p+G?9pe`W-0{HaY9&G)?f=VZ^x z99D^IecxK&%FfEX=Y96O-~H})@3Z$lXU=)&PH*L^43~?kl*z7Q#FfkzNQumF-zpD4 zN?0+Qgikk{!6tyu;+V)U5d^s+9nDCkITFtVrE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Ef%Q|0#%imK;kWVUrbS@E-RfUhj9^2M^eqHZN9 zDQ@?tB!t6BDZfsZS5)4{v&yLZ?h2@|l~>ORDC$;%lG@AP2pnN|!m9o1c_2m0WjTDU z#FO2AKTzEIw%V_r7gAI`NJKs&KdbWUxuFm+YO<v<*mVjM|5ucYc%&|kseD+YcJ60V+`P`}6NCQwVNenme<9(9o#ChB>N?kZ78 z$te|zS9AjWLt|H!SI>E<-&b|Zj-m69k}9Xh!G8cF7pwB>cR7w+PttfFMG)&#l~*(m zh4u2RPKs6wx|=e!q{=Be)mC18AH4fZqL4bzl?qi(@n1lB!j%2Jev#9o%G>HMQ3WNP zE$c6|;i^1652h!jPN&w`*97}z{XFt6aME)r{+0czU37ja+i_^6V(ern@tBX|kbkOr V6?6^`(v^QNEF`Y56|k}F{{XOSU>N`a From f8bbafdc2dd061a136d83bd9f671888e9f272ab6 Mon Sep 17 00:00:00 2001 From: gehongbo <1512161085@qq.com> Date: Wed, 4 May 2022 14:47:54 +0800 Subject: [PATCH 3/3] add --- src/Djitellowhite/Djitellowhite.cpp | 106 ++++++++++++++++++++++++++ src/Djitellowhite/Djitellowhite.h | 72 +++++++++++++++++ src/Djitellowhite/Hardwarelistener.h | 6 ++ src/Djitellowhite/T | Bin 0 -> 31008 bytes src/Djitellowhite/Triplet.cpp | 45 +++++++++++ src/Djitellowhite/keyboard.cpp | 52 +++++++++++++ src/Djitellowhite/libDjitellowhite.so | Bin 0 -> 18152 bytes src/Djitellowhite/makefile | 21 +++++ src/Djitellowhite/server.cpp | 58 ++++++++++++++ src/Djitellowhite/test | Bin 0 -> 31008 bytes 10 files changed, 360 insertions(+) create mode 100644 src/Djitellowhite/Djitellowhite.cpp create mode 100644 src/Djitellowhite/Djitellowhite.h create mode 100644 src/Djitellowhite/Hardwarelistener.h create mode 100755 src/Djitellowhite/T create mode 100644 src/Djitellowhite/Triplet.cpp create mode 100644 src/Djitellowhite/keyboard.cpp create mode 100755 src/Djitellowhite/libDjitellowhite.so create mode 100644 src/Djitellowhite/makefile create mode 100644 src/Djitellowhite/server.cpp create mode 100755 src/Djitellowhite/test diff --git a/src/Djitellowhite/Djitellowhite.cpp b/src/Djitellowhite/Djitellowhite.cpp new file mode 100644 index 0000000..9ebb3b5 --- /dev/null +++ b/src/Djitellowhite/Djitellowhite.cpp @@ -0,0 +1,106 @@ +#include"Djitellowhite.h" +#include +#include + + +#include +#include +#include + +#include +#include + +using namespace cv; +using namespace std; +Tello::Tello(const char* IP) { + this->stream_on=false; + this->host = inet_addr(IP); + cout << "create successfully!" << endl; + +} +Tello::~Tello() {} +void Tello::set_conf(int socket){ + this->sock = socket; +} +void Tello::get_connect(sockaddr_in serveraddr) { + char tmp[10] = {"command"}; + send_message(tmp,serveraddr,0);// 0 -> timeout + cout << "connect successfully!" <host; +} +void Tello::takeoff(sockaddr_in serveraddr) { + char tmp[10] = {"takeoff"}; + send_message(tmp,serveraddr,0);// 0 -> timeout + cout << "takeoff successfully!" < timeout + cout << "land successfully!" <sock,buffer,strlen(buffer),0,(struct sockaddr *)&server_addr, sizeof(server_addr)); + return true; +} +void* Tello::udp_response_receiver(void* arg){ + //int m_SockServer; //创建socket对象 + //sockaddr_in serveraddr; //创建sockaddr_in对象储存自身信息(当有多个端口,可以多个绑定) + //sockaddr_in serveraddrfrom; + + //serveraddr.sin_family = AF_INET; //设置服务器地址家族 + //serveraddr.sin_port = htons(8889); //设置服务器端口号 + //serveraddr.sin_addr.s_addr = inet_addr("0.0.0.0"); + //m_SockServer = socket(AF_INET, SOCK_DGRAM, 0); //创建一个临时变量并赋值给m_SockServer + //int i = bind(m_SockServer, (sockaddr*)&serveraddr, sizeof(serveraddr)); //把名字和套接字绑定 + //std::cout << "bind:" << i << std::endl; + + int socket = *(int *)arg; + + cout << "receive start" << endl; + while(1){ + char buffer[20]; + int iret; + memset(buffer,0,sizeof(buffer)); + + iret = recv(socket, buffer,20,MSG_WAITALL); + if(iret > 0 && iret <10){ + printf("Message from tello: %s\n", buffer); + } + } +} +void Tello::get_video(sockaddr_in serveraddr){ + + char tmp[10] = {"streamon"}; + send_message(tmp,serveraddr,0); + cout << "stream_on successfully!" <stream_on = true; + + cout << "vid"; + VideoCapture cap("udp://@0.0.0.0:11111"); + cout << "cap"; + if(!cap.isOpened()){ + cout << "fuck off"; + return; + } + + Mat frame; + cout << "continue!"; + while(1){ + cap>>frame; + if(frame.empty()) + break; + imshow("video",frame); + waitKey(20); + + } + cap.release(); + + +} diff --git a/src/Djitellowhite/Djitellowhite.h b/src/Djitellowhite/Djitellowhite.h new file mode 100644 index 0000000..b311e46 --- /dev/null +++ b/src/Djitellowhite/Djitellowhite.h @@ -0,0 +1,72 @@ +#ifndef _DJITELLOWHITE_H +#define _DJITELLOWHITE_H +#include +#include +#include +#include +#include +#include +/*Library for interacting with DJI Ryze Tello drones.*/ + + +//coding = utf - 8 + +/* """C++ wrapper to interact with the Ryze Tello drone using the official Tello api. + Tello API documentation: + [1.3](https://dl-cdn.ryzerobotics.com/downloads/tello/20180910/Tello%20SDK%20Documentation%20EN_1.3.pdf) +*/ + +#define RESPONSE_TIMEOUT 7 //in seconds +#define TAKEOFF_TIMEOUT 20 //in seconds +#define FRAME_GRAB_TIMEOUT 3 +#define TIME_BTW_COMMANDS 0.1 //in seconds +#define TIME_BTW_RC_CONTROL_COMMANDS 0.001 //in seconds +#define RETRY_COUNT 3 //number of retries after a failed command + + +//Video stream, server socket +#define VS_UDP_IP "0.0.0.0" +#define VS_UDP_PORT 11111 + +#define CONTROL_UDP_PORT 8889 +#define STATE_UDP_PORT 8890 + +#define BUFFER_SIZE 1024 +//Constants for video settings +#define BITRATE_AUTO 0 +#define BITRATE_1MBPS 1 +#define BITRATE_2MBPS 2 +#define BITRATE_3MBPS 3 +#define BITRATE_4MBPS 4 +#define BITRATE_5MBPS 5 +#define RESOLUTION_480P "low" +#define RESOLUTION_720P "high" +#define FPS_5 "low" +#define FPS_15 "middle" +#define FPS_30 "high" +#define CAMERA_FORWARD 0 +#define CAMERA_DOWNWARD 1 +//日志模块暂时不写 + +class Tello { +private: + int sock; + bool stream_on; + unsigned long host; +public: + Tello(const char* IP); + ~Tello(); + void set_conf(int socket); + unsigned long gethost(); + void get_connect(sockaddr_in serveraddr); + void takeoff(sockaddr_in serveraddr); + void land(sockaddr_in serveraddr); + bool send_message(char* msg,sockaddr_in server_addr,int timeout = RESPONSE_TIMEOUT); + static void *udp_response_receiver(void* arg); + void get_video(sockaddr_in serveraddr); +}; + + + + +#endif diff --git a/src/Djitellowhite/Hardwarelistener.h b/src/Djitellowhite/Hardwarelistener.h new file mode 100644 index 0000000..176cde8 --- /dev/null +++ b/src/Djitellowhite/Hardwarelistener.h @@ -0,0 +1,6 @@ +#ifndef _HARDWARELISTENER_H +#define _HARDWARELISTENER_H + +int listenkeyboard(); +int scanKeyboard(); +#endif diff --git a/src/Djitellowhite/T b/src/Djitellowhite/T new file mode 100755 index 0000000000000000000000000000000000000000..b2cf1f764804d29794150c851830b28ce045ace3 GIT binary patch literal 31008 zcmeHw4Rlo1wf~uXKvYNqO63n&2Jiz#VkUeAD4LKAPK01ef>M=tGfXCAB*~03H+(J8 zXoSZ!rjO_U*;2JNZP!!Edp=Y8bOH4vLKmUbzm2vJd41ZZ_%$Q6#*fly(RsgpK5ouT z=CVp$>%F!9D<>Ype|6lM8> zr+V3xb3p7*Sa>D7RpYn;YOiM+DY!B zdV6HOJ+hvnPU%lYl|M-x{TEArrcx)$C^`8jW2yDl$a<-?T*@m-ZBVLy$E+JpdsVVt zZK=?cO26h1xT31PucIFMWootnC&u$!Ar9Tyw&9mzo1MB9`y{@rtc4MHqW%KOK z#q(#+pIZn2Rqr~D=OC%01hCyCKd#m{{9#)J!wU!1X{ z{5RFnYc5nes1C_cB6(?&#TO$-GSvT_Wk1PuFlP>7i}Ak%{|DcC=V^sCKAKdrmz z=E)N__+>Wj*4XH;w81a38TZGbKb<{~+KgkZ4Su^#yHDHr$8Xc_-8TMz%EtafHhLbn zkuR{(|ALMEWj1;?+xX$f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}w|F5ozM;r)(eP(u{F#2;z-hxe^WyuLr#inBb9WDl{Iy@&yPE9kp5d6yipmS|4TQS94TLS zu54WRx0qt`!@c#^k9{OGT0l3c}-#~thNkgFhV zXO!}LB1!XF9#QHyAM_3~9^XFI$nzhyAwlRdhwQB@!o~b5{LlwN`Llw^mL}7?4%7?_ z+MsfLgBM~2co^PafNS!CP#A&j!{!zZTGtZ5kD}o@c_D@H^RwyqFSvMvH`2fg>b5ka z2|*F$pO!WbhjT_~hrBf^d+>#xL+U z$lD$b`0W6TgLVYe_iy(3LniLX&@bC?W#W#A(4q2Z)7upAp-RxCwqPzr-7i4UeO7>b zGEKPEqHgtk8A{(1(LG|^rsZj({2oG4_1ugsw(ch@eg-o5%EGE&EbA-kRDzP?c7IYr zIGm*VYh-;zNx>Lok~#B)cUsqN7$X9>c4s(NYQdx4__>x)C)!eZqL1NUukUmcit0{ISiYQ( zf}?x;5|{KzP`!TP3{jw{vR8^*_A9(ArM~(eThW(r|5#6|eT6-XjNZQbzFSdzot2cN zJ1y)v-*s8M6Jt z6kOG(=fU)()alfk` +using namespace std; +int main(void){ + Tello T("192.168.10.1"); + int socket_fd, err; + + if((socket_fd = socket(PF_INET,SOCK_DGRAM,IPPROTO_UDP))==-1) + { + cout << "initialized error" << endl; + cout << 0; + return -1; + } + + //cout << 1 << socket_fd; + T.set_conf(socket_fd); + + pthread_t thread_receive; + err = pthread_create(&thread_receive,nullptr,T.udp_response_receiver,&socket_fd); + sleep(3); + struct sockaddr_in serveraddr; + memset(&serveraddr,0,sizeof(serveraddr)); + serveraddr.sin_family=AF_INET; + serveraddr.sin_addr.s_addr=T.gethost(); + serveraddr.sin_port=htons(CONTROL_UDP_PORT); + + + + if(err!=0) + { + cout << err << " " << "can't create thread"; + } + + T.get_connect(serveraddr); + //sleep(1); + //T.takeoff(serveraddr); + T.get_video(serveraddr); + sleep(5); + //T.land(serveraddr); + + pthread_join(thread_receive,NULL); + listenkeyboard(); + return 0; +} diff --git a/src/Djitellowhite/keyboard.cpp b/src/Djitellowhite/keyboard.cpp new file mode 100644 index 0000000..3006537 --- /dev/null +++ b/src/Djitellowhite/keyboard.cpp @@ -0,0 +1,52 @@ +#include +#include +#include "Hardwarelistener.h" +#include +using namespace std; +int scanKeyboard() +{ + + int in; + + struct termios new_settings; + struct termios stored_settings; + //设置终端参数 + tcgetattr(0,&stored_settings); + new_settings = stored_settings; + new_settings.c_lflag &= (~ICANON); + new_settings.c_cc[VTIME] = 0; + tcgetattr(0,&stored_settings); + new_settings.c_cc[VMIN] = 1; + tcsetattr(0,TCSANOW,&new_settings); + in = getchar(); + tcsetattr(0,TCSANOW,&stored_settings); + + return in; + +} + +//测试函数 +int listenkeyboard(){ + while(1){ + switch(scanKeyboard()) + { + case (int)'w': + cout << "forward"<< endl; + break; + case (int)'s': + cout << "back" << endl; + break; + case (int)'a': + cout << "left" <N+|;A>n7Zw_KW;il z+cA}~0Ji=ED|998HE6p%x+8A-lx~kHw|5`xC@z;<_%yH6?G-x@b9KC!>hQ{Vk`Ed) zcdcy{P&-0>(WhI=r)Zw!iSX0keRkm0>5pXkPXFrRe|c_A)%m#)Oa0G*QZrW*;1Nel z_FwxA;agYvm>5@1vK#R?6Mq{%d~?FmzQJ9G9{Sm?>9@?8`{jn(7oXq!?&I0VQ(tTN z=INf7zLEOcq2|E%f7JQGb^HJ7J0Ji1(^c=otYCQ*4eCoOPrjfCeijE_NT1^2$@8F? z#YOylsR$k{g5OgFr`Q*2w+ncoel94YzY6$l{JBdEz;$jA{MU>0=P!!jj~0pBM@8^6 zXroa7Un+uMEaE3zME?${Um)Uzlb~TddtoSb?}@n!>E#u*M99jz(iE7x^3R35rO2*fIm5P#lu=R!uOL zv}7%ss9$eYR|i`Ianp(iB37b4==ZM!wzw&fhy=}8!it9jZS}zorhk2{Nxr0qaC<0P zAG|!<4d#X_Sl^0cyMOKaSTx~pSha3_Y`y6xK=-p+_S5F;7Wuc0Nb9Pd+|mRNCKzjP z_D4oks;gTR+8z#C{_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kM9)?Dj2GXpcf)ruM!J|33~qPFbJr znf@CDlO6WFe>1dDS+HI)`wt~%Pl z5`M=4AWW;P Y&h4@;JrftQZ@fck(En@TEG}03A3X&HVE_OC literal 0 HcmV?d00001 diff --git a/src/Djitellowhite/makefile b/src/Djitellowhite/makefile new file mode 100644 index 0000000..156373e --- /dev/null +++ b/src/Djitellowhite/makefile @@ -0,0 +1,21 @@ +obj = Djitellowhite.o keyboard.cpp Triplet.cpp +CXXFLAGS += -c -Wall $(shell pkg-config --cflags opencv4) +LDFLAGS += $(shell pkg-config --libs --static opencv4) +test : $(obj) + $(CXX) -o test $(obj) $(LDFLAGS) + +Djitellowhite.o : Djitellowhite.h + $(CXX) -c Djitellowhite.cpp $(CXXFLAGS) + +keyboard.o : Hardwarelistener.h + $(CXX) -c keyboard.cpp $(CXXFLAGS) + +Triplet : Djitellowhite.h Hardwarelistener.h + $(CXX) -c Triplet.cpp -lpthread $(CXXFLAGS) + +.PHONY : clean +clean : + rm test $(obj) + + + diff --git a/src/Djitellowhite/server.cpp b/src/Djitellowhite/server.cpp new file mode 100644 index 0000000..581b3e7 --- /dev/null +++ b/src/Djitellowhite/server.cpp @@ -0,0 +1,58 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#define PORT 8890 + +void udp_server(int sockfd) +{ + + socklen_t len; + char buf[1024] = {0}; + struct sockaddr_in server_addr; + int n; + int opt = 1; + len = sizeof(server_addr); + memset(&buf, 0, sizeof(buf)); + server_addr.sin_family = AF_INET; + server_addr.sin_addr.s_addr = htonl(INADDR_ANY); + server_addr.sin_port = htons(PORT); + + setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)); //当服务器非正常断开的时候重启服务器,不会进入TIME_WAIT状态 + + if (bind(sockfd, (struct sockaddr *)&server_addr, sizeof(server_addr)) < 0) { + printf("can not bind\n"); + exit(1); + } + + while (1) { + printf("========wait for client's request========\n"); + n = recvfrom(sockfd, buf, sizeof(buf), 0, (struct sockaddr *)&server_addr, &len); + buf[n] = '\0'; + printf("receive client's data: %s\n", buf); + sendto(sockfd, buf, n, 0, (struct sockaddr *)&server_addr, len); + printf("send data to client: %s\n", buf); + } + + close(sockfd); +} + +int main(int argc, char **argv) +{ + int sockfd; + + if ((sockfd = socket(PF_INET, SOCK_DGRAM, 0)) < 0) { + printf("create socket false\n"); + exit(1); + } + + udp_server(sockfd); + + exit(0); +} + + diff --git a/src/Djitellowhite/test b/src/Djitellowhite/test new file mode 100755 index 0000000000000000000000000000000000000000..db2feaccc29394fb46549aa6b0b1b6d6b949407f GIT binary patch literal 31008 zcmeHw4Rlo1x%Qs?K>Q(zD9Qyb1BjwX%!I!HMH7<2i6okmptQ<8nM@{RB*~03C;a${ zMk9Po)AaIrKU<2nrgqg@Z(CDrT|oVb&_$^A+Gy`p+G?9pe`W-0{HaY9&G)?f=VZ^x z99D^IecxK&%FfEX=Y96O-~H})@3Z$lXU=)&PH*L^43~?kl*z7Q#FfkzNQumF-zpD4 zN?0+Qgikk{!6tyu;+V)U5d^s+9nDCkITFtVrE*j0APv1xz)VqPAyF#llm@4Y97S2a z;Hg|T9lGfQ$<044I_X@&E2@{{^_56@8{H@yq^MqweA8Yf%C)agrG>H)>$p+KlXjB3 zsN5s6+#|A_qHgI=MU_8E9sL(ef7+=Vd6eAzlQDa_b+VkDmP>g>sSZjtZwxS)ueKz30b)P2`nx0YqJvtGhfc{)B1|KwK6-#zE~SnTmVJ68PRj(N?0 zeE*&qTPuo`4k|-3lt^BhWbwr~A{lD`&a$6ox|lnMu;ut)f&T-4x%c+|;0rBf-v2&v z^wxD3o^j7N|8d^#v&($vSKqMc-WB&i#4$Y$#go(I_P~gA_**bK9Uh0_>F}o<@ZX}& zbn^2Y?0MWl{&qMeot`EKe3^s(uc0H;>FIRP^PmI1%E8X79OUnCkpH!Voi{o7KkT4C z?x5#0hkogCz#nzc<98S*SD;;P{M*x04)XUo*gxpdFMbF4-#W;{{IvGG@JKz^N)LZMIzsdnW%c0*Ng#L8)-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