Commit 526adc3e authored by Léo-Paul Géneau's avatar Léo-Paul Géneau 👾

Remove autopilot's API specific related code

parent 5bffa688
CFLAGS=-std=c99 -D_POSIX_C_SOURCE=200809L -pipe -Wall -Wextra -Wpedantic -Werror -Wno-overlength-strings -Wno-unused-parameter -Wc++-compat -Wformat -Wformat-security -Wformat-nonliteral -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wuninitialized -Winit-self -Wcast-qual -Wstrict-overflow -Wnested-externs -Wmultichar -Wundef -fno-strict-aliasing -fexceptions -fPIC -fstack-protector-strong -fstack-clash-protection -ffunction-sections -fdata-sections -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-math-errno -O3 -flto -fno-fat-lto-objects -Wshadow -Wconversion -fvisibility=hidden -fPIC CFLAGS=-std=c99 -D_POSIX_C_SOURCE=200809L -pipe -Wall -Wextra -Wpedantic -Werror -Wno-overlength-strings -Wno-unused-parameter -Wc++-compat -Wformat -Wformat-security -Wformat-nonliteral -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wuninitialized -Winit-self -Wcast-qual -Wstrict-overflow -Wnested-externs -Wmultichar -Wundef -fno-strict-aliasing -fexceptions -fstack-protector-strong -fstack-clash-protection -ffunction-sections -fdata-sections -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-math-errno -O3 -flto -fno-fat-lto-objects -Wshadow -Wconversion -fvisibility=hidden -fPIC
CXXFLAGS=-pipe -Wall -Wextra -Wpedantic -Werror -Wno-overlength-strings -Wno-unused-parameter -Wformat -Wformat-security -Wformat-nonliteral -Wredundant-decls -Wuninitialized -Winit-self -Wcast-qual -Wstrict-overflow -Wmultichar -Wundef -fno-strict-aliasing -fexceptions -fPIC -fstack-protector-strong -fstack-clash-protection -ffunction-sections -fdata-sections -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-math-errno -O3 -flto -fno-fat-lto-objects -Wshadow -Wconversion -fvisibility=hidden -fPIC LIBS=-lautopilotwrapper -lopen62541
LDFLAGS+= -std=c99 -D_POSIX_C_SOURCE=200809L -pipe -Wall -Wextra -Wpedantic -Werror -Wno-static-in-inline -Wno-overlength-strings -Wno-unused-parameter -Wc++-compat -Wformat -Wformat-security -Wformat-nonliteral -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wuninitialized -Winit-self -Wcast-qual -Wstrict-overflow -Wnested-externs -Wmultichar -Wundef -fno-strict-aliasing -fexceptions -fPIC -fstack-protector-strong -fstack-clash-protection -ffunction-sections -fdata-sections -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-math-errno -O3 -flto -fno-fat-lto-objects -Wshadow -Wconversion -fvisibility=hidden -fPIC
LIBS=-lstdc++ -lmavsdk -lmavsdk_action -lmavsdk_mavlink_passthrough -lmavsdk_telemetry -lopen62541
LIB_NAME := libqjswrapper.so LIB_NAME := libqjswrapper.so
SRCS := mavsdk_wrapper.cpp pubsub.c qjs_wrapper.c SRCS := pubsub.c qjs_wrapper.c
OBJS := mavsdk_wrapper.o pubsub.o qjs_wrapper.o OBJS := pubsub.o qjs_wrapper.o
all: $(LIB_NAME) all: $(LIB_NAME)
......
This project is holding the source code for QuickJS component that will wrap the functions from MAVSDK and open62541. # qjs-wrapper
This project is holding the source code for QuickJS component that will wrap the functions from open62541 and a drone
autopilot's API (MAVSDK by default).
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#define __DRONEDGE_H__ #define __DRONEDGE_H__
#include <open62541/server.h> #include <open62541/server.h>
#include "mavsdk_wrapper.h" #include "autopilot_wrapper.h"
#include "pubsub.h" #include "pubsub.h"
struct messageNode { struct messageNode {
...@@ -36,7 +36,7 @@ VariableData droneVariableArray[] = { ...@@ -36,7 +36,7 @@ VariableData droneVariableArray[] = {
.valueRank = UA_VALUERANK_ONE_DIMENSION, .valueRank = UA_VALUERANK_ONE_DIMENSION,
.arrayDimensionsSize = 1, .arrayDimensionsSize = 1,
.arrayDimensions = positionArrayDims, .arrayDimensions = positionArrayDims,
.getter.getArray = mavsdk_getPositionArray, .getter.getArray = getPositionArray,
}, },
{ {
.name = "speedArray", .name = "speedArray",
...@@ -48,7 +48,7 @@ VariableData droneVariableArray[] = { ...@@ -48,7 +48,7 @@ VariableData droneVariableArray[] = {
.valueRank = UA_VALUERANK_ONE_DIMENSION, .valueRank = UA_VALUERANK_ONE_DIMENSION,
.arrayDimensionsSize = 1, .arrayDimensionsSize = 1,
.arrayDimensions = speedArrayDims, .arrayDimensions = speedArrayDims,
.getter.getArray = mavsdk_getSpeedArray, .getter.getArray = getSpeedArray,
}, },
{ {
.name = "message", .name = "message",
......
#ifndef __MAVSDK_H__
#define __MAVSDK_H__
/*
* 0. latitude (double, degrees)
* 1. longitude (double, degrees)
* 2. absolute altitude (double, meters)
* 3. relative altitude (double, meters)
*/
#define POSITION_ARRAY_SIZE 4
/*
* 0. yaw angle (float, degrees)
* 1. air speed (float, m/s)
* 2. climb rate (float, m/s)
*/
#define SPEED_ARRAY_SIZE 3
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
// Connexion management functions
int mavsdk_start(const char * ip, int port, const char * log_file, int timeout);
int mavsdk_stop(bool shutdown);
int mavsdk_reboot(void);
// Flight state management functions
int mavsdk_arm(void);
int mavsdk_takeOff(void);
int mavsdk_takeOffAndWait(void);
int mavsdk_triggerParachute(void);
// Flight management functions
int mavsdk_loiter(float radius);
int mavsdk_setAirspeed(float airspeed);
int mavsdk_setTargetCoordinates(double la, double lo, float a);
// Information functions
float mavsdk_getAltitude(void);
float mavsdk_getAltitudeRel(void);
float mavsdk_getInitialAltitude(void);
double mavsdk_getInitialLatitude(void);
double mavsdk_getInitialLongitude(void);
double mavsdk_getLatitude(void);
double mavsdk_getLongitude(void);
double *mavsdk_getPositionArray(void);
float *mavsdk_getSpeedArray(void);
double mavsdk_getTakeOffAltitude(void);
float mavsdk_getYaw(void);
float mavsdk_getSpeed(void);
float mavsdk_getClimbRate(void);
int mavsdk_healthAllOk(void);
#ifdef __cplusplus
}
#endif
#endif /* __MAVSDK_H__ */
...@@ -6,7 +6,9 @@ ...@@ -6,7 +6,9 @@
#include <quickjs/quickjs.h> #include <quickjs/quickjs.h>
#ifndef DLL_PUBLIC
#define DLL_PUBLIC __attribute__ ((visibility ("default"))) #define DLL_PUBLIC __attribute__ ((visibility ("default")))
#endif
#define countof(x) (sizeof(x) / sizeof((x)[0])) #define countof(x) (sizeof(x) / sizeof((x)[0]))
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment