Visual Servoing Platform
version 3.7.0
Toggle main menu visibility
Loading...
Searching...
No Matches
vpRobotMavsdk.h
1
/*
2
* ViSP, open source Visual Servoing Platform software.
3
* Copyright (C) 2005 - 2025 by Inria. All rights reserved.
4
*
5
* This software is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
9
* See the file LICENSE.txt at the root directory of this source
10
* distribution for additional information about the GNU GPL.
11
*
12
* For using ViSP with software that can not be combined with the GNU
13
* GPL, please contact Inria about acquiring a ViSP Professional
14
* Edition License.
15
*
16
* See https://visp.inria.fr for more information.
17
*
18
* This software was developed at:
19
* Inria Rennes - Bretagne Atlantique
20
* Campus Universitaire de Beaulieu
21
* 35042 Rennes Cedex
22
* France
23
*
24
* If you have questions regarding the use of this file, please contact
25
* Inria at visp@inria.fr
26
*
27
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
28
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29
*
30
* Description:
31
* Interface to mavlink compatible controller using mavsdk 3rd party
32
*/
33
34
#ifndef VP_ROBOT_MAVSDK_H
35
#define VP_ROBOT_MAVSDK_H
36
37
#include <visp3/core/vpConfig.h>
38
39
// Check if std:c++17 or higher.
40
// Here we cannot use (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_17) in the declaration of the class
41
#if defined(VISP_HAVE_MAVSDK) && ((__cplusplus >= 201703L) || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201703L))) \
42
&& defined(VISP_HAVE_THREADS)
43
44
#include <future>
45
#include <mutex>
46
#include <signal.h>
47
#include <string>
48
#include <tuple>
49
50
#include <visp3/core/vpHomogeneousMatrix.h>
51
52
BEGIN_VISP_NAMESPACE
95
class
VISP_EXPORT
vpRobotMavsdk
96
{
97
public
:
98
vpRobotMavsdk
();
99
vpRobotMavsdk
(
const
std::string &connection_info);
100
virtual
~vpRobotMavsdk
();
101
103
104
void
connect
(
const
std::string &connection_info);
106
108
109
float
getBatteryLevel
()
const
;
110
void
getPosition
(
float
&ned_north,
float
&ned_east,
float
&ned_down,
float
&ned_yaw)
const
;
111
void
getPosition
(
vpHomogeneousMatrix
&ned_M_frd)
const
;
112
std::tuple<float, float>
getHome
()
const
;
113
std::string
getAddress
()
const
;
114
bool
isRunning
()
const
;
116
118
119
bool
arm
();
120
bool
disarm
();
121
void
doFlatTrim
();
122
bool
hasFlyingCapability
();
123
bool
holdPosition
();
124
bool
kill
();
125
bool
land
();
126
bool
releaseControl
();
127
bool
sendMocapData
(
const
vpHomogeneousMatrix
&enu_M_flu,
int
display_fps = 1);
128
void
setAutoLand
(
bool
auto_land);
129
bool
setForwardSpeed
(
double
body_frd_vx);
130
bool
setLateralSpeed
(
double
body_frd_vy);
131
bool
setGPSGlobalOrigin
(
double
latitude,
double
longitude,
double
altitude);
132
void
setPositioningIncertitude
(
float
position_incertitude,
float
yaw_incertitude);
133
bool
setPosition
(
float
ned_north,
float
ned_east,
float
ned_down,
float
ned_yaw,
bool
blocking =
true
,
134
int
timeout_sec = 10);
135
bool
setPosition
(
const
vpHomogeneousMatrix
&ned_M_frd,
bool
blocking =
true
,
int
timeout_sec = 10);
136
bool
setPositionRelative
(
float
ned_delta_north,
float
ned_delta_east,
float
ned_delta_down,
float
ned_delta_yaw,
137
bool
blocking =
true
,
int
timeout_sec = 10);
138
bool
setPositionRelative
(
const
vpHomogeneousMatrix
&delta_frd_M_frd,
bool
blocking =
true
,
int
timeout_sec = 10);
139
bool
setVelocity
(
const
vpColVector
&frd_vel_cmd);
140
bool
setVerticalSpeed
(
double
body_frd_vz);
141
bool
setYawSpeed
(
double
body_frd_wz);
142
void
setTakeOffAlt
(
double
altitude);
143
void
setVerbose
(
bool
verbose);
144
bool
stopMoving
();
145
bool
takeControl
();
146
bool
takeOff
(
bool
interactive =
true
,
int
timeout_sec = 10,
bool
use_gps =
false
);
147
bool
takeOff
(
bool
interactive,
double
takeoff_altitude,
int
timeout_sec = 10,
bool
use_gps =
false
);
149
150
private
:
151
//*** Setup functions ***//
152
void
cleanUp();
153
void
createDroneController();
154
void
setupCallbacks();
155
void
startController();
156
157
vpRobotMavsdk
(
const
vpRobotMavsdk
&);
// noncopyable
158
vpRobotMavsdk
&operator=(
const
vpRobotMavsdk
&);
//
159
160
class
vpRobotMavsdkImpl;
161
vpRobotMavsdkImpl *m_impl;
162
};
163
END_VISP_NAMESPACE
164
#endif
// #ifdef VISP_HAVE_MAVSDK
165
#endif
// #ifndef vpRobotMavsdk_h_
vpColVector
Implementation of column vector and the associated operations.
Definition
vpColVector.h:191
vpHomogeneousMatrix
Implementation of an homogeneous matrix and operations on such kind of matrices.
Definition
vpHomogeneousMatrix.h:221
vpRobotMavsdk::getBatteryLevel
float getBatteryLevel() const
Definition
vpRobotMavsdk.cpp:1260
vpRobotMavsdk::getAddress
std::string getAddress() const
Definition
vpRobotMavsdk.cpp:1253
vpRobotMavsdk::setPositioningIncertitude
void setPositioningIncertitude(float position_incertitude, float yaw_incertitude)
Definition
vpRobotMavsdk.cpp:1572
vpRobotMavsdk::holdPosition
bool holdPosition()
Definition
vpRobotMavsdk.cpp:1362
vpRobotMavsdk::disarm
bool disarm()
Definition
vpRobotMavsdk.cpp:1314
vpRobotMavsdk::getHome
std::tuple< float, float > getHome() const
Definition
vpRobotMavsdk.cpp:1286
vpRobotMavsdk::sendMocapData
bool sendMocapData(const vpHomogeneousMatrix &enu_M_flu, int display_fps=1)
Definition
vpRobotMavsdk.cpp:1242
vpRobotMavsdk::takeControl
bool takeControl()
Definition
vpRobotMavsdk.cpp:1543
vpRobotMavsdk::takeOff
bool takeOff(bool interactive=true, int timeout_sec=10, bool use_gps=false)
Definition
vpRobotMavsdk.cpp:1330
vpRobotMavsdk::getPosition
void getPosition(float &ned_north, float &ned_east, float &ned_down, float &ned_yaw) const
Definition
vpRobotMavsdk.cpp:1275
vpRobotMavsdk::setLateralSpeed
bool setLateralSpeed(double body_frd_vy)
Definition
vpRobotMavsdk.cpp:1517
vpRobotMavsdk::doFlatTrim
void doFlatTrim()
Definition
vpRobotMavsdk.cpp:1293
vpRobotMavsdk::arm
bool arm()
Definition
vpRobotMavsdk.cpp:1308
vpRobotMavsdk::setPositionRelative
bool setPositionRelative(float ned_delta_north, float ned_delta_east, float ned_delta_down, float ned_delta_yaw, bool blocking=true, int timeout_sec=10)
Definition
vpRobotMavsdk.cpp:1435
vpRobotMavsdk::setVerticalSpeed
bool setVerticalSpeed(double body_frd_vz)
Definition
vpRobotMavsdk.cpp:1588
vpRobotMavsdk::setAutoLand
void setAutoLand(bool auto_land)
Definition
vpRobotMavsdk.cpp:1563
vpRobotMavsdk::kill
bool kill()
Definition
vpRobotMavsdk.cpp:1478
vpRobotMavsdk::setForwardSpeed
bool setForwardSpeed(double body_frd_vx)
Definition
vpRobotMavsdk.cpp:1504
vpRobotMavsdk::setTakeOffAlt
void setTakeOffAlt(double altitude)
Definition
vpRobotMavsdk.cpp:1302
vpRobotMavsdk::land
bool land()
Definition
vpRobotMavsdk.cpp:1378
vpRobotMavsdk::hasFlyingCapability
bool hasFlyingCapability()
Definition
vpRobotMavsdk.cpp:1602
vpRobotMavsdk::releaseControl
bool releaseControl()
Definition
vpRobotMavsdk.cpp:1554
vpRobotMavsdk::setVerbose
void setVerbose(bool verbose)
Definition
vpRobotMavsdk.cpp:1595
vpRobotMavsdk::setVelocity
bool setVelocity(const vpColVector &frd_vel_cmd)
Definition
vpRobotMavsdk.cpp:1471
vpRobotMavsdk::connect
void connect(const std::string &connection_info)
Definition
vpRobotMavsdk.cpp:1215
vpRobotMavsdk::setGPSGlobalOrigin
bool setGPSGlobalOrigin(double latitude, double longitude, double altitude)
Definition
vpRobotMavsdk.cpp:1527
vpRobotMavsdk::setPosition
bool setPosition(float ned_north, float ned_east, float ned_down, float ned_yaw, bool blocking=true, int timeout_sec=10)
Definition
vpRobotMavsdk.cpp:1394
vpRobotMavsdk::stopMoving
bool stopMoving()
Definition
vpRobotMavsdk.cpp:1369
vpRobotMavsdk::setYawSpeed
bool setYawSpeed(double body_frd_wz)
Definition
vpRobotMavsdk.cpp:1491
vpRobotMavsdk::isRunning
bool isRunning() const
Definition
vpRobotMavsdk.cpp:1220
vpRobotMavsdk::vpRobotMavsdk
vpRobotMavsdk()
Definition
vpRobotMavsdk.cpp:1189
BEGIN_VISP_NAMESPACE
Definition
vpMbtDistanceCircle.cpp:55
modules
robot
include
visp3
robot
vpRobotMavsdk.h
Generated by
1.17.0