48 #include <visp3/core/vpConfig.h>
51 #if defined(VISP_HAVE_MAVSDK) && ((__cplusplus >= 201703L) || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201703L)))
53 #include <visp3/robot/vpRobotMavsdk.h>
55 void usage(
const std::string &bin_name)
57 std::cerr <<
"Usage : " << bin_name <<
" <connection information>\n"
58 <<
"Connection information format should be :\n"
59 <<
" - For TCP: tcp://[server_host][:server_port]\n"
60 <<
" - For UDP: udp://[bind_host][:bind_port]\n"
61 <<
" - For Serial: serial:///path/to/serial/dev[:baudrate]\n"
62 <<
"For example, to connect to the simulator use URL: udp://:14540\n";
65 int main(
int argc,
char **argv)
72 auto drone = vpRobotMavsdk(argv[1]);
74 drone.setTakeOffAlt(1.);
75 drone.setVerbose(
true);
79 if (!drone.takeOff()) {
80 std::cout <<
"Takeoff failed" << std::endl;
85 float ned_north, ned_east, ned_down, ned_yaw;
86 drone.getPosition(ned_north, ned_east, ned_down, ned_yaw);
87 std::cout <<
"Vehicle position in NED frame: " << ned_north <<
" " << ned_east <<
" " << ned_down <<
" [m] and " <<
vpMath::deg(ned_yaw) <<
" [deg]" << std::endl;
90 drone.getPosition(ned_M_frd);
92 std::cout <<
"Vehicle position in NED frame: "
96 std::cout <<
"Hold position for 4 sec" << std::endl;
110 #ifndef VISP_HAVE_MAVSDK
111 std::cout <<
"\nThis example requires mavsdk library. You should install it, configure and rebuid ViSP.\n"
114 #if !((__cplusplus >= 201703L) || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201703L)))
116 <<
"\nThis example requires at least cxx17. You should enable cxx17 during ViSP configuration with cmake and "
Implementation of an homogeneous matrix and operations on such kind of matrices.
vpRotationMatrix getRotationMatrix() const
vpTranslationVector getTranslationVector() const
static double deg(double rad)
Implementation of a rotation vector as Euler angle minimal representation.
VISP_EXPORT int wait(double t0, double t)