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
1a387ecc
Commit
1a387ecc
authored
Feb 19, 2024
by
Léo-Paul Géneau
👾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add return value for setTargetCoordinates and loiter
parent
f7fde3a4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
8 deletions
+6
-8
include/autopilot_API.h
include/autopilot_API.h
+4
-4
qjs_wrapper.c
qjs_wrapper.c
+2
-4
No files found.
include/autopilot_API.h
View file @
1a387ecc
...
...
@@ -20,10 +20,10 @@ DLL_PUBLIC int takeOff(void);
DLL_PUBLIC
int
land
(
void
);
// Flight management functions
DLL_PUBLIC
void
loiter
(
double
latitude
,
double
longitude
,
float
altitude
,
float
radius
,
float
speed
);
DLL_PUBLIC
void
setTargetCoordinates
(
double
latitude
,
double
longitude
,
float
altitude
,
float
speed
);
DLL_PUBLIC
int
loiter
(
double
latitude
,
double
longitude
,
float
altitude
,
float
radius
,
float
speed
);
DLL_PUBLIC
int
setTargetCoordinates
(
double
latitude
,
double
longitude
,
float
altitude
,
float
speed
);
// Information functions
DLL_PUBLIC
float
getAltitude
(
void
);
...
...
qjs_wrapper.c
View file @
1a387ecc
...
...
@@ -721,8 +721,7 @@ static JSValue js_loiter(JSContext *ctx, JSValueConst thisVal,
if
(
JS_ToFloat64
(
ctx
,
&
speed
,
argv
[
4
]))
return
JS_EXCEPTION
;
loiter
(
latitude
,
longitude
,
(
float
)
altitude
,
(
float
)
radius
,
(
float
)
speed
);
return
JS_NewInt32
(
ctx
,
0
);
return
JS_NewInt32
(
ctx
,
loiter
(
latitude
,
longitude
,
(
float
)
altitude
,
(
float
)
radius
,
(
float
)
speed
));
}
static
JSValue
js_setTargetCoordinates
(
JSContext
*
ctx
,
...
...
@@ -743,8 +742,7 @@ static JSValue js_setTargetCoordinates(JSContext *ctx,
if
(
JS_ToFloat64
(
ctx
,
&
speed
,
argv
[
3
]))
return
JS_EXCEPTION
;
setTargetCoordinates
(
latitude
,
longitude
,
(
float
)
altitude
,
(
float
)
speed
);
return
JS_NewInt32
(
ctx
,
0
);
return
JS_NewInt32
(
ctx
,
setTargetCoordinates
(
latitude
,
longitude
,
(
float
)
altitude
,
(
float
)
speed
));
}
// Information functions
...
...
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