39 #include <visp3/core/vpConfig.h>
41 #include <visp3/core/vpTime.h>
42 #include <visp3/gui/vpDisplayX.h>
43 #include <visp3/io/vpKeyboard.h>
45 #include <visp3/robot/vpRobotBebop2.h>
49 #ifdef VISP_HAVE_ARSDK
148 int main(
int argc,
char **argv)
152 std::string ip_address =
"192.168.42.1";
156 bool verbose =
false;
158 for (
int i = 1; i < argc; i++) {
159 if (std::string(argv[i]) ==
"--ip" && i + 1 < argc) {
160 ip_address = std::string(argv[i + 1]);
162 }
else if (std::string(argv[i]) ==
"--hd_stream") {
164 }
else if (std::string(argv[i]) ==
"--verbose" || std::string(argv[i]) ==
"-v") {
166 }
else if (argc >= 2 && (std::string(argv[1]) ==
"--help" || std::string(argv[1]) ==
"-h")) {
167 std::cout <<
"\nUsage:\n"
168 <<
" " << argv[0] <<
"[--ip <drone ip>] [--hd_stream] [--verbose] [-v] [--help] [-h]\n"
171 <<
" --ip <drone ip>\n"
172 <<
" Ip address of the drone to which you want to connect (default : 192.168.42.1).\n\n"
174 <<
" Enables HD 720p streaming instead of default 480p.\n"
175 <<
" --verbose, -v\n"
176 <<
" Enables verbose (drone information messages and velocity commands\n"
177 <<
" are then displayed).\n\n"
179 <<
" Print help message.\n"
183 std::cout <<
"Error : unknown parameter " << argv[i] << std::endl
184 <<
"See " << argv[0] <<
" --help" << std::endl;
189 std::cout <<
"\nWARNING: this program does no sensing or avoiding of obstacles, "
190 "the drone WILL collide with any objects in the way! Make sure the "
191 "drone has approximately 3 meters of free space on all sides.\n"
202 std::cout <<
"\nConfiguring drone settings ...\n" << std::endl;
208 #ifdef VISP_HAVE_FFMPEG
211 std::cout <<
"\nWaiting for streaming to start ...\n" << std::endl;
223 std::cout <<
"\n| Control the drone with the keyboard :\n"
224 "| 't' to takeoff / spacebar to land / 'e' for emergency stop\n"
225 "| ('r','f','d','g') and ('i','k','j','l') to move\n"
232 if (keyboard.
kbhit()) {
235 running = handleKeyboardInput(drone, k);
237 #ifdef VISP_HAVE_FFMPEG
244 std::cout <<
"\nQuitting ...\n" << std::endl;
247 std::cout <<
"ERROR : failed to setup drone control." << std::endl;
251 std::cout <<
"\nCaught an exception: " << e << std::endl;
260 std::cout <<
"\nThis example requires Parrot ARSDK3 library. You should install it.\n" << std::endl;
Use the X11 console to display images on unix-like OS. Thus to enable this class X11 should be instal...
static void display(const vpImage< unsigned char > &I)
static void flush(const vpImage< unsigned char > &I)
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
error that can be emitted by ViSP classes.
Keyboard management under unix (Linux or OSX). This class is not available under windows.
void setMaxTilt(double maxTilt)
void setVerticalSpeed(int value)
void setStreamingMode(int mode)
void getRGBaImage(vpImage< vpRGBa > &I)
void setYawSpeed(int value)
void takeOff(bool blocking=true)
void setVideoResolution(int mode)
void display(vpImage< unsigned char > &I, const std::string &title)
Display a gray-scale image.
VISP_EXPORT int wait(double t0, double t)