46 #include <visp3/core/vpConfig.h>
49 #if defined(VISP_HAVE_MAVSDK) && ((__cplusplus >= 201703L) || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201703L)))
51 #include <visp3/robot/vpRobotMavsdk.h>
53 void usage(
const std::string &bin_name)
55 std::cerr <<
"Usage : " << bin_name <<
" <connection information>\n"
56 <<
"Connection URL format should be :\n"
57 <<
" - For TCP : tcp://[server_host][:server_port]\n"
58 <<
" - For UDP : udp://[bind_host][:bind_port]\n"
59 <<
" - For Serial : serial:///path/to/serial/dev[:baudrate]\n"
60 <<
"For example, to connect to the simulator use URL: udp://:14540\n";
63 int main(
int argc,
char **argv)
65 #ifdef ENABLE_VISP_NAMESPACE
73 double takeoff_alt = 1.;
75 auto drone = vpRobotMavsdk(argv[1]);
76 drone.setTakeOffAlt(takeoff_alt);
77 drone.setVerbose(
true);
79 if (!drone.takeOff()) {
80 std::cout <<
"Takeoff failed" << std::endl;
87 float ned_north, ned_east, ned_down, ned_yaw;
88 drone.getPosition(ned_north, ned_east, ned_down, ned_yaw);
89 std::cout <<
"Vehicle position in NED frame: " << ned_north <<
" " << ned_east <<
" " << ned_down <<
" [m] and "
93 drone.getPosition(ned_M_frd);
99 drone.setPositioningIncertitude(0.10,
vpMath::rad(5.));
101 drone.setPosition(0.0, 1.0, ned_down, 0.0);
102 drone.setPosition(1.0, 0.0, ned_down, 0.0);
103 drone.setPosition(0.0, -1.0, ned_down, 0.0);
104 drone.setPosition(-1.0, 0.0, ned_down, 0.0);
116 #ifndef VISP_HAVE_MAVSDK
117 std::cout <<
"\nThis example requires mavsdk library. You should install it, configure and rebuid ViSP.\n"
120 #if !((__cplusplus >= 201703L) || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201703L)))
122 <<
"\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 rad(double deg)
static double deg(double rad)
Implementation of a rotation vector as Euler angle minimal representation.