Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Q
qjs-wrapper
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
qjs-wrapper
Commits
526adc3e
Commit
526adc3e
authored
May 09, 2023
by
Léo-Paul Géneau
👾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove autopilot's API specific related code
parent
5bffa688
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
108 additions
and
586 deletions
+108
-586
Makefile
Makefile
+4
-6
README
README
+4
-1
include/dronedge.h
include/dronedge.h
+3
-3
include/mavsdk_wrapper.h
include/mavsdk_wrapper.h
+0
-57
include/pubsub.h
include/pubsub.h
+2
-0
mavsdk_wrapper.cpp
mavsdk_wrapper.cpp
+0
-424
qjs_wrapper.c
qjs_wrapper.c
+95
-95
No files found.
Makefile
View file @
526adc3e
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
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
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
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
LIBS
=
-lautopilotwrapper
-lopen62541
LIB_NAME
:=
libqjswrapper.so
SRCS
:=
mavsdk_wrapper.cpp
pubsub.c qjs_wrapper.c
OBJS
:=
mavsdk_wrapper.o
pubsub.o qjs_wrapper.o
SRCS
:=
pubsub.c qjs_wrapper.c
OBJS
:=
pubsub.o qjs_wrapper.o
all
:
$(LIB_NAME)
...
...
README
View file @
526adc3e
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).
include/dronedge.h
View file @
526adc3e
...
...
@@ -2,7 +2,7 @@
#define __DRONEDGE_H__
#include <open62541/server.h>
#include "
mavsdk
_wrapper.h"
#include "
autopilot
_wrapper.h"
#include "pubsub.h"
struct
messageNode
{
...
...
@@ -36,7 +36,7 @@ VariableData droneVariableArray[] = {
.
valueRank
=
UA_VALUERANK_ONE_DIMENSION
,
.
arrayDimensionsSize
=
1
,
.
arrayDimensions
=
positionArrayDims
,
.
getter
.
getArray
=
mavsdk_
getPositionArray
,
.
getter
.
getArray
=
getPositionArray
,
},
{
.
name
=
"speedArray"
,
...
...
@@ -48,7 +48,7 @@ VariableData droneVariableArray[] = {
.
valueRank
=
UA_VALUERANK_ONE_DIMENSION
,
.
arrayDimensionsSize
=
1
,
.
arrayDimensions
=
speedArrayDims
,
.
getter
.
getArray
=
mavsdk_
getSpeedArray
,
.
getter
.
getArray
=
getSpeedArray
,
},
{
.
name
=
"message"
,
...
...
include/mavsdk_wrapper.h
deleted
100644 → 0
View file @
5bffa688
#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__ */
include/pubsub.h
View file @
526adc3e
...
...
@@ -6,7 +6,9 @@
#include <quickjs/quickjs.h>
#ifndef DLL_PUBLIC
#define DLL_PUBLIC __attribute__ ((visibility ("default")))
#endif
#define countof(x) (sizeof(x) / sizeof((x)[0]))
...
...
mavsdk_wrapper.cpp
deleted
100644 → 0
View file @
5bffa688
This diff is collapsed.
Click to expand it.
qjs_wrapper.c
View file @
526adc3e
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment