Example to control Parrot Bebop2.
#include <iostream>
#include <visp3/core/vpTime.h>
#include <visp3/gui/vpDisplayX.h>
#include <visp3/robot/vpRobotBebop2.h>
int main(int argc, char **argv)
{
#ifdef ENABLE_VISP_NAMESPACE
#endif
#ifdef VISP_HAVE_ARSDK
try {
int stream_res = 0;
std::string ip_address = "192.168.42.1";
bool verbose = false;
for (int i = 1; i < argc; i++) {
if (std::string(argv[i]) == "--ip" && i + 1 < argc) {
ip_address = std::string(argv[i + 1]);
i++;
}
else if (std::string(argv[i]) == "--hd-resolution") {
stream_res = 1;
}
else if (std::string(argv[i]) == "--verbose" || std::string(argv[i]) == "-v") {
verbose = true;
}
else if (std::string(argv[i]) == "--help" || std::string(argv[i]) == "-h") {
std::cout << "\nUsage:\n"
<< " " << argv[0] << " [--ip <drone ip>] [--hd-resolution] [--verbose] [-v]"
<< " [--help] [-h]\n"
<< std::endl
<< "Description:\n"
<< " --ip <drone ip>\n"
<< " IP address of the drone to which you want to connect (default : 192.168.42.1).\n\n"
<< " --hd-resolution\n"
<< " Enables HD 720p video instead of default 480p.\n\n"
<< " --verbose, -v\n"
<< " Enables verbose (drone information messages are then displayed).\n\n"
<< " --help, -h\n"
<< " Print help message.\n\n"
<< std::endl;
return EXIT_SUCCESS;
}
else {
std::cout << "Error : unknown parameter " << argv[i] << std::endl
<< "See " << argv[0] << " --help" << std::endl;
return EXIT_FAILURE;
}
}
verbose, true, ip_address);
#ifdef VISP_HAVE_X11
vpDisplayX d(I);
#elif defined(VISP_HAVE_GDI)
#elif defined(HAVE_OPENCV_HIGHGUI)
#else
std::cout << "No image viewer is available..." << std::endl;
#endif
double delta_t = 0.040;
do {
}
else {
std::cout << "Error : failed to setup drone control" << std::endl;
}
std::cout << "-- End of test --" << std::endl;
}
std::cout << "Caught an exception: " << e << std::endl;
}
#else
(void)argc;
(void)argv;
std::cout << "Install Parrot ARSDK, configure and build ViSP to use this example..." << std::endl;
#endif
}
Implementation of column vector and the associated operations.
Display for windows using GDI (available on any windows 32 platform).
The vpDisplayOpenCV allows to display image using the OpenCV library. Thus to enable this class OpenC...
static void display(const vpImage< unsigned char > &I)
static void flush(const vpImage< unsigned char > &I)
error that can be emitted by ViSP classes.
static double rad(double deg)
void setVelocity(const vpColVector &vel, double delta_t)
void getRGBaImage(vpImage< vpRGBa > &I)
void takeOff(bool blocking=true)
void setVideoResolution(int mode)
VISP_EXPORT int wait(double t0, double t)
VISP_EXPORT double measureTimeMs()