48#include <visp3/core/vpConfig.h>
50#if defined(VISP_HAVE_MAVSDK) && (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_17)
53#include <visp3/robot/vpRobotMavsdk.h>
55using std::chrono::seconds;
56using std::this_thread::sleep_for;
58void 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";
68int main(
int argc,
char **argv)
77 drone.setTakeOffAlt(.5);
78 if (! drone.takeOff() )
80 std::cout <<
"Takeoff failed" << std::endl;
85 drone.setForwardSpeed(0.3);
86 std::cout <<
"Set forward speed of 0.3 m/s for 4 sec" << std::endl;
87 sleep_for(seconds(4));
89 drone.setForwardSpeed(-0.3);
90 std::cout <<
"Set forward speed of -0.3 m/s for 4 sec" << std::endl;
91 sleep_for(seconds(4));
94 std::cout <<
"Stop moving for 4 sec" << std::endl;
95 sleep_for(seconds(4));
97 std::cout <<
"Land now..." << std::endl;
107#ifndef VISP_HAVE_MAVSDK
108 std::cout <<
"\nThis example requires mavsdk library. You should install it, configure and rebuid ViSP.\n"
111#if !(VISP_CXX_STANDARD >= VISP_CXX_STANDARD_17)
113 <<
"\nThis example requires at least cxx17. You should enable cxx17 during ViSP configuration with cmake and "
Implementation of column vector and the associated operations.