|
|
@ -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){
|
|
|
|
void Tello::get_video(sockaddr_in serveraddr){
|
|
|
|
|
|
|
|
|
|
|
|
char tmp[10] = {"streamon"};
|
|
|
|
char tmp[15] = {"streamon"};
|
|
|
|
send_message(tmp,serveraddr,0);
|
|
|
|
send_message(tmp,serveraddr,0);
|
|
|
|
cout << "stream_on successfully!" <<endl;
|
|
|
|
cout << "stream_on successfully!" <<endl;
|
|
|
|
this->stream_on = true;
|
|
|
|
this->stream_on = true;
|
|
|
|