48 #include <visp3/core/vpTime.h> 49 #include <visp3/gui/vpDisplayX.h> 50 #include <visp3/robot/vpRobotBebop2.h> 52 int main(
int argc,
char **argv)
54 #ifdef VISP_HAVE_ARSDK 57 std::string ip_address =
"192.168.42.1";
60 for (
int i = 1; i < argc; i++) {
61 if (std::string(argv[i]) ==
"--ip" && i + 1 < argc) {
62 ip_address = std::string(argv[i + 1]);
64 }
else if (std::string(argv[i]) ==
"--hd_resolution") {
66 }
else if (std::string(argv[i]) ==
"--verbose" || std::string(argv[i]) ==
"-v") {
68 }
else if (std::string(argv[i]) ==
"--help" || std::string(argv[i]) ==
"-h") {
69 std::cout <<
"\nUsage:\n" 70 <<
" " << argv[0] <<
" [--ip <drone ip>] [--hd_resolution] [--verbose] [-v]" 74 <<
" --ip <drone ip>\n" 75 <<
" IP address of the drone to which you want to connect (default : 192.168.42.1).\n\n" 76 <<
" --hd_resolution\n" 77 <<
" Enables HD 720p video instead of default 480p.\n\n" 79 <<
" Enables verbose (drone information messages are then displayed).\n\n" 81 <<
" Print help message.\n\n" 85 std::cout <<
"Error : unknown parameter " << argv[i] << std::endl
86 <<
"See " << argv[0] <<
" --help" << std::endl;
92 verbose,
true, ip_address);
94 if (drone.isRunning()) {
96 drone.setVideoResolution(stream_res);
98 drone.startStreaming();
101 drone.getRGBaImage(I);
105 #elif defined(VISP_HAVE_GDI) 107 #elif defined(VISP_HAVE_OPENCV) 110 std::cout <<
"No image viewer is available..." << std::endl;
121 double delta_t = 0.040;
125 drone.setVelocity(vel, 1);
127 drone.getRGBaImage(I);
137 std::cout <<
"Error : failed to setup drone control" << std::endl;
140 std::cout <<
"-- End of test --" << std::endl;
142 std::cout <<
"Caught an exception: " << e << std::endl;
147 std::cout <<
"Install Parrot ARSDK, configure and build ViSP to use this example..." << std::endl;
VISP_EXPORT int wait(double t0, double t)
Display for windows using GDI (available on any windows 32 platform).
Use the X11 console to display images on unix-like OS. Thus to enable this class X11 should be instal...
error that can be emited by ViSP classes.
static void flush(const vpImage< unsigned char > &I)
VISP_EXPORT double measureTimeMs()
static void display(const vpImage< unsigned char > &I)
The vpDisplayOpenCV allows to display image using the OpenCV library. Thus to enable this class OpenC...
static double rad(double deg)
Implementation of column vector and the associated operations.