pull/11/head
13195980010 3 years ago
parent 22bda90868
commit 67f288898d

@ -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!" <<endl;
}
void Tello::back(sockaddr_in serveraddr){
char tmp[15] = {"back 20"};
send_message(tmp,serveraddr,0);// 0 -> timeout
cout << "back successfully!" <<endl;
}
void Tello::left(sockaddr_in serveraddr){
char tmp[15] = {"left 20"};
send_message(tmp,serveraddr,0);// 0 -> timeout
cout << "left successfully!" <<endl;
}
void Tello::right(sockaddr_in serveraddr){
char tmp[15] = {"right 20"};
send_message(tmp,serveraddr,0);// 0 -> timeout
cout << "right successfully!" <<endl;
}
void Tello::up(sockaddr_in serveraddr){
char tmp[15] = {"up 20"};
send_message(tmp,serveraddr,0);// 0 -> timeout
cout << "up successfully!" <<endl;
}
void Tello::down(sockaddr_in serveraddr){
char tmp[15] = {"down 20"};
send_message(tmp,serveraddr,0);// 0 -> timeout
cout << "down successfully!" <<endl;
}
void Tello::cw(sockaddr_in serveraddr){
char tmp[15] = {"cw 20"};
send_message(tmp,serveraddr,0);// 0 -> timeout
cout << "cw successfully!" <<endl;
}
void Tello::ccw(sockaddr_in serveraddr){
char tmp[15] = {"ccw 20"};
send_message(tmp,serveraddr,0);// 0 -> timeout
cout << "ccw successfully!" <<endl;
}
void Tello::get_video(sockaddr_in serveraddr){
char tmp[10] = {"streamon"};
char tmp[15] = {"streamon"};
send_message(tmp,serveraddr,0);
cout << "stream_on successfully!" <<endl;
this->stream_on = true;

@ -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);

Binary file not shown.

Binary file not shown.
Loading…
Cancel
Save