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 0000000..b2cf1f7 Binary files /dev/null and b/src/Djitellowhite/T differ diff --git a/src/Djitellowhite/Triplet b/src/Djitellowhite/Triplet deleted file mode 100755 index b514f91..0000000 Binary files a/src/Djitellowhite/Triplet and /dev/null differ diff --git a/src/Djitellowhite/Triplet.cpp b/src/Djitellowhite/Triplet.cpp index 39c2de7..1456006 100644 --- a/src/Djitellowhite/Triplet.cpp +++ b/src/Djitellowhite/Triplet.cpp @@ -13,7 +13,7 @@ int main(void){ return -1; } - cout << 1 << socket_fd; + //cout << 1 << socket_fd; T.set_conf(socket_fd); pthread_t thread_receive; diff --git a/src/Djitellowhite/keyboard b/src/Djitellowhite/keyboard deleted file mode 100755 index fb6acf5..0000000 Binary files a/src/Djitellowhite/keyboard and /dev/null differ 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 09df8ae..0000000 Binary files a/src/Djitellowhite/server and /dev/null differ diff --git a/src/Djitellowhite/test b/src/Djitellowhite/test new file mode 100755 index 0000000..db2feac Binary files /dev/null and b/src/Djitellowhite/test differ