diff --git a/src/Djitellowhite/Djitellowhite.cpp b/src/Djitellowhite/Djitellowhite.cpp index 9ebb3b5..c8a8f52 100644 --- a/src/Djitellowhite/Djitellowhite.cpp +++ b/src/Djitellowhite/Djitellowhite.cpp @@ -75,9 +75,49 @@ void* Tello::udp_response_receiver(void* arg){ } } } +void Tello::forward(sockaddr_in serveraddr){ + char tmp[15] = {"forward 20"}; + send_message(tmp,serveraddr,0);// 0 -> timeout + cout << "forward successfully!" < timeout + cout << "back successfully!" < timeout + cout << "left successfully!" < timeout + cout << "right successfully!" < timeout + cout << "up successfully!" < timeout + cout << "down successfully!" < timeout + cout << "cw successfully!" < timeout + cout << "ccw successfully!" <stream_on = true; diff --git a/src/Djitellowhite/Djitellowhite.h b/src/Djitellowhite/Djitellowhite.h index b311e46..bfaa936 100644 --- a/src/Djitellowhite/Djitellowhite.h +++ b/src/Djitellowhite/Djitellowhite.h @@ -61,6 +61,14 @@ public: void get_connect(sockaddr_in serveraddr); void takeoff(sockaddr_in serveraddr); void land(sockaddr_in serveraddr); + void forward(sockaddr_in serveraddr); + void back(sockaddr_in serveraddr); + void left(sockaddr_in serveraddr); + void right(sockaddr_in serveraddr); + void up(sockaddr_in serveraddr); + void down(sockaddr_in serveraddr); + void cw(sockaddr_in serveraddr); + void ccw(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); diff --git a/src/Djitellowhite/Djitellowhite.o b/src/Djitellowhite/Djitellowhite.o index 0fae4ce..12a9638 100644 Binary files a/src/Djitellowhite/Djitellowhite.o and b/src/Djitellowhite/Djitellowhite.o differ diff --git a/src/Djitellowhite/test b/src/Djitellowhite/test index f35b81f..a041d3c 100755 Binary files a/src/Djitellowhite/test and b/src/Djitellowhite/test differ