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 if (! robot.setGPSGlobalOrigin(48.117266, -1.6777926, 40.0))
82 std::cout <<
"Vehicle has flying capability: " << (robot.hasFlyingCapability() ?
"yes" :
"no") << std::endl;
85 double delta_north = 1.;
86 double delta_east = 0.;
87 double delta_down = 0.;
88 double delta_yaw = 0.;
90 std::cout <<
"Move 1 meter north" << std::endl;;
91 robot.setPositionRelative(delta_north, delta_east, delta_down, delta_yaw);
97 std::cout <<
"Go at 0.3m/s backward during 3 sec.\n";
101 std::cout <<
"Go at 0.3m/s forward and rotate 10 deg/s along yaw during 2 sec.\n";
120#ifndef VISP_HAVE_MAVSDK
121 std::cout <<
"\nThis example requires mavsdk library. You should install it, configure and rebuid ViSP.\n"
124#if !(VISP_CXX_STANDARD >= VISP_CXX_STANDARD_17)
126 <<
"\nThis example requires at least cxx17. You should enable cxx17 during ViSP configuration with cmake and "
Implementation of column vector and the associated operations.
static double rad(double deg)
void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &vel)
VISP_EXPORT double measureTimeMs()
VISP_EXPORT int wait(double t0, double t)
VISP_EXPORT void sleepMs(double t)