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
29fe3da7
Commit
29fe3da7
authored
Sep 08, 2022
by
Léo-Paul Géneau
👾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unused functions
Remove: - setTargetAltitude - setTargetCoordinatesXYZ - setTargetLatLong
parent
b5285c27
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
80 deletions
+0
-80
include/mavsdk_wrapper.h
include/mavsdk_wrapper.h
+0
-3
mavsdk_wrapper.cpp
mavsdk_wrapper.cpp
+0
-28
qjs_wrapper.c
qjs_wrapper.c
+0
-49
No files found.
include/mavsdk_wrapper.h
View file @
29fe3da7
...
@@ -22,10 +22,7 @@ int mavsdk_takeOffAndWait(void);
...
@@ -22,10 +22,7 @@ int mavsdk_takeOffAndWait(void);
int
mavsdk_doReposition
(
float
la
,
float
lo
,
float
a
,
float
y
);
int
mavsdk_doReposition
(
float
la
,
float
lo
,
float
a
,
float
y
);
int
mavsdk_setAirspeed
(
float
airspeed
);
int
mavsdk_setAirspeed
(
float
airspeed
);
int
mavsdk_setAltitude
(
float
altitude
);
int
mavsdk_setAltitude
(
float
altitude
);
int
mavsdk_setTargetAltitude
(
float
a
);
int
mavsdk_setTargetCoordinates
(
double
la
,
double
lo
,
float
a
,
float
y
);
int
mavsdk_setTargetCoordinates
(
double
la
,
double
lo
,
float
a
,
float
y
);
int
mavsdk_setTargetCoordinatesXYZ
(
double
x
,
double
y
,
float
z
);
int
mavsdk_setTargetLatLong
(
double
la
,
double
lo
);
// Information functions
// Information functions
float
mavsdk_getAltitude
(
void
);
float
mavsdk_getAltitude
(
void
);
...
...
mavsdk_wrapper.cpp
View file @
29fe3da7
...
@@ -330,21 +330,6 @@ int mavsdk_setAltitude(float altitude) {
...
@@ -330,21 +330,6 @@ int mavsdk_setAltitude(float altitude) {
return
doMavlinkCommand
(
command
,
"Setting altitude failed"
);
return
doMavlinkCommand
(
command
,
"Setting altitude failed"
);
}
}
int
mavsdk_setTargetAltitude
(
float
a
)
{
if
(
!
mavsdk_started
)
return
-
1
;
log
(
"Going to altitude "
+
std
::
to_string
(
a
)
+
"m"
);
const
Action
::
Result
result
=
action
->
goto_location
(
position
.
latitude_deg
,
position
.
longitude_deg
,
a
,
0
);
if
(
result
!=
Action
::
Result
::
Success
)
{
log_error_from_result
(
"Goto location failed"
,
result
);
return
-
1
;
}
return
0
;
}
int
mavsdk_setTargetCoordinates
(
double
la
,
double
lo
,
float
a
,
float
y
)
{
int
mavsdk_setTargetCoordinates
(
double
la
,
double
lo
,
float
a
,
float
y
)
{
if
(
!
mavsdk_started
)
if
(
!
mavsdk_started
)
return
-
1
;
return
-
1
;
...
@@ -359,19 +344,6 @@ int mavsdk_setTargetCoordinates(double la, double lo, float a, float y) {
...
@@ -359,19 +344,6 @@ int mavsdk_setTargetCoordinates(double la, double lo, float a, float y) {
return
0
;
return
0
;
}
}
int
mavsdk_setTargetCoordinatesXYZ
(
double
x
,
double
y
,
float
z
)
{
double
la
,
lo
;
la
=
((
origin
.
latitude_deg
+
y
/
EARTH_RADIUS
)
*
180.
F
)
/
M_PI
;
lo
=
((
origin
.
longitude_deg
+
x
/
(
EARTH_RADIUS
*
xy_ratio
))
*
180.
F
)
/
M_PI
;
return
mavsdk_setTargetCoordinates
(
la
,
lo
,
z
,
0
);
}
int
mavsdk_setTargetLatLong
(
double
la
,
double
lo
)
{
return
mavsdk_setTargetCoordinates
(
la
,
lo
,
mavsdk_getAltitude
(),
0
);
}
// Information functions
// Information functions
float
mavsdk_getAltitude
(
void
)
{
float
mavsdk_getAltitude
(
void
)
{
...
...
qjs_wrapper.c
View file @
29fe3da7
...
@@ -377,21 +377,6 @@ static JSValue js_mavsdk_setTargetCoordinates(JSContext *ctx,
...
@@ -377,21 +377,6 @@ static JSValue js_mavsdk_setTargetCoordinates(JSContext *ctx,
(
float
)
y_arg_double
));
(
float
)
y_arg_double
));
}
}
static
JSValue
js_mavsdk_setTargetLatLong
(
JSContext
*
ctx
,
JSValueConst
this_val
,
int
argc
,
JSValueConst
*
argv
)
{
double
la_arg_double
;
double
lo_arg_double
;
if
(
JS_ToFloat64
(
ctx
,
&
la_arg_double
,
argv
[
0
]))
return
JS_EXCEPTION
;
if
(
JS_ToFloat64
(
ctx
,
&
lo_arg_double
,
argv
[
1
]))
return
JS_EXCEPTION
;
return
JS_NewInt32
(
ctx
,
mavsdk_setTargetLatLong
(
la_arg_double
,
lo_arg_double
));
}
static
JSValue
js_mavsdk_setAltitude
(
JSContext
*
ctx
,
JSValueConst
this_val
,
static
JSValue
js_mavsdk_setAltitude
(
JSContext
*
ctx
,
JSValueConst
this_val
,
int
argc
,
JSValueConst
*
argv
)
int
argc
,
JSValueConst
*
argv
)
{
{
...
@@ -489,37 +474,6 @@ static JSValue js_mavsdk_doParachute(JSContext *ctx, JSValueConst this_val,
...
@@ -489,37 +474,6 @@ static JSValue js_mavsdk_doParachute(JSContext *ctx, JSValueConst this_val,
return
JS_NewInt32
(
ctx
,
mavsdk_doParachute
((
float
)
param
));
return
JS_NewInt32
(
ctx
,
mavsdk_doParachute
((
float
)
param
));
}
}
static
JSValue
js_mavsdk_setTargetCoordinatesXYZ
(
JSContext
*
ctx
,
JSValueConst
this_val
,
int
argc
,
JSValueConst
*
argv
)
{
double
x_arg_double
;
double
y_arg_double
;
double
z_arg_double
;
if
(
JS_ToFloat64
(
ctx
,
&
x_arg_double
,
argv
[
0
]))
return
JS_EXCEPTION
;
if
(
JS_ToFloat64
(
ctx
,
&
y_arg_double
,
argv
[
1
]))
return
JS_EXCEPTION
;
if
(
JS_ToFloat64
(
ctx
,
&
z_arg_double
,
argv
[
2
]))
return
JS_EXCEPTION
;
return
JS_NewInt32
(
ctx
,
mavsdk_setTargetCoordinatesXYZ
(
x_arg_double
,
y_arg_double
,
(
float
)
z_arg_double
));
}
static
JSValue
js_mavsdk_setTargetAltitude
(
JSContext
*
ctx
,
JSValueConst
this_val
,
int
argc
,
JSValueConst
*
argv
)
{
double
a_arg_double
;
if
(
JS_ToFloat64
(
ctx
,
&
a_arg_double
,
argv
[
0
]))
return
JS_EXCEPTION
;
return
JS_NewInt32
(
ctx
,
mavsdk_setTargetAltitude
((
float
)
a_arg_double
));
}
static
JSValue
js_mavsdk_takeOff
(
JSContext
*
ctx
,
JSValueConst
this_val
,
static
JSValue
js_mavsdk_takeOff
(
JSContext
*
ctx
,
JSValueConst
this_val
,
int
argc
,
JSValueConst
*
argv
)
int
argc
,
JSValueConst
*
argv
)
{
{
...
@@ -546,13 +500,10 @@ static const JSCFunctionListEntry js_mavsdk_funcs[] = {
...
@@ -546,13 +500,10 @@ static const JSCFunctionListEntry js_mavsdk_funcs[] = {
JS_CFUNC_DEF
(
"landed"
,
0
,
js_mavsdk_landed
),
JS_CFUNC_DEF
(
"landed"
,
0
,
js_mavsdk_landed
),
JS_CFUNC_DEF
(
"arm"
,
0
,
js_mavsdk_arm
),
JS_CFUNC_DEF
(
"arm"
,
0
,
js_mavsdk_arm
),
JS_CFUNC_DEF
(
"setTargetCoordinates"
,
4
,
js_mavsdk_setTargetCoordinates
),
JS_CFUNC_DEF
(
"setTargetCoordinates"
,
4
,
js_mavsdk_setTargetCoordinates
),
JS_CFUNC_DEF
(
"setTargetLatLong"
,
2
,
js_mavsdk_setTargetLatLong
),
JS_CFUNC_DEF
(
"setAltitude"
,
1
,
js_mavsdk_setAltitude
),
JS_CFUNC_DEF
(
"setAltitude"
,
1
,
js_mavsdk_setAltitude
),
JS_CFUNC_DEF
(
"setAirspeed"
,
1
,
js_mavsdk_setAirspeed
),
JS_CFUNC_DEF
(
"setAirspeed"
,
1
,
js_mavsdk_setAirspeed
),
JS_CFUNC_DEF
(
"loiter"
,
0
,
js_mavsdk_loiter
),
JS_CFUNC_DEF
(
"loiter"
,
0
,
js_mavsdk_loiter
),
JS_CFUNC_DEF
(
"doParachute"
,
1
,
js_mavsdk_doParachute
),
JS_CFUNC_DEF
(
"doParachute"
,
1
,
js_mavsdk_doParachute
),
JS_CFUNC_DEF
(
"setTargetCoordinatesXYZ"
,
3
,
js_mavsdk_setTargetCoordinatesXYZ
),
JS_CFUNC_DEF
(
"setTargetAltitude"
,
1
,
js_mavsdk_setTargetAltitude
),
JS_CFUNC_DEF
(
"getYaw"
,
0
,
js_mavsdk_getYaw
),
JS_CFUNC_DEF
(
"getYaw"
,
0
,
js_mavsdk_getYaw
),
JS_CFUNC_DEF
(
"getInitialLatitude"
,
0
,
js_mavsdk_getInitialLatitude
),
JS_CFUNC_DEF
(
"getInitialLatitude"
,
0
,
js_mavsdk_getInitialLatitude
),
JS_CFUNC_DEF
(
"getLatitude"
,
0
,
js_mavsdk_getLatitude
),
JS_CFUNC_DEF
(
"getLatitude"
,
0
,
js_mavsdk_getLatitude
),
...
...
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