46 #include <visp3/core/vpConfig.h>
49 #if defined(VISP_HAVE_MAVSDK) && ((__cplusplus >= 201703L) || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201703L))) \
50 && defined(VISP_HAVE_THREADS)
53 #include <visp3/robot/vpRobotMavsdk.h>
55 using std::chrono::seconds;
56 using std::this_thread::sleep_for;
58 void usage(
const std::string &bin_name)
60 std::cerr <<
"Usage : " << bin_name <<
" <connection information>\n"
61 <<
"Connection URL format should be :\n"
62 <<
" - For TCP : tcp://[server_host][:server_port]\n"
63 <<
" - For UDP : udp://[bind_host][:bind_port]\n"
64 <<
" - For Serial : serial:///path/to/serial/dev[:baudrate]\n"
65 <<
"For example, to connect to the simulator use URL: udp://:14540\n";
68 int main(
int argc,
char **argv)
70 #ifdef ENABLE_VISP_NAMESPACE
78 auto drone = vpRobotMavsdk(argv[1]);
80 drone.setTakeOffAlt(.5);
81 if (!drone.takeOff()) {
82 std::cout <<
"Takeoff failed" << std::endl;
87 drone.setForwardSpeed(0.3);
88 std::cout <<
"Set forward speed of 0.3 m/s for 4 sec" << std::endl;
89 sleep_for(seconds(4));
91 drone.setForwardSpeed(-0.3);
92 std::cout <<
"Set forward speed of -0.3 m/s for 4 sec" << std::endl;
93 sleep_for(seconds(4));
96 std::cout <<
"Stop moving for 4 sec" << std::endl;
97 sleep_for(seconds(4));
99 std::cout <<
"Land now..." << std::endl;
109 #ifndef VISP_HAVE_MAVSDK
110 std::cout <<
"\nThis example requires mavsdk library. You should install it, configure and rebuid ViSP.\n"
113 #if !((__cplusplus >= 201703L) || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201703L)))
115 <<
"\nThis example requires at least cxx17. You should enable cxx17 during ViSP configuration with cmake and "
Implementation of column vector and the associated operations.