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
f37302b2
Commit
f37302b2
authored
Aug 31, 2023
by
Léo-Paul Géneau
👾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add timestamp to JSDroneData
Include timestamp into position array
parent
fdde4519
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
0 deletions
+5
-0
include/pubsub.h
include/pubsub.h
+1
-0
qjs_wrapper.c
qjs_wrapper.c
+4
-0
No files found.
include/pubsub.h
View file @
f37302b2
...
...
@@ -25,6 +25,7 @@ typedef struct {
UA_Double
longitude
;
UA_Double
altitudeAbs
;
UA_Double
altitudeRel
;
UA_Double
timestamp
;
UA_Float
yaw
;
UA_Float
speed
;
UA_Float
climbRate
;
...
...
qjs_wrapper.c
View file @
f37302b2
...
...
@@ -183,6 +183,8 @@ static JSValue js_drone_get(JSContext *ctx, JSValueConst thisVal, int magic)
pthread_cond_signal
(
&
threadCond
);
pthread_mutex_unlock
(
&
mutex
);
return
res
;
case
9
:
return
JS_NewFloat64
(
ctx
,
s
->
timestamp
);
default:
return
JS_EXCEPTION
;
}
...
...
@@ -261,6 +263,7 @@ static const JSCFunctionListEntry js_drone_proto_funcs[] = {
JS_CGETSET_MAGIC_DEF
(
"speed"
,
js_drone_get
,
NULL
,
6
),
JS_CGETSET_MAGIC_DEF
(
"climbRate"
,
js_drone_get
,
NULL
,
7
),
JS_CGETSET_MAGIC_DEF
(
"message"
,
js_drone_get
,
NULL
,
8
),
JS_CGETSET_MAGIC_DEF
(
"timestamp"
,
js_drone_get
,
NULL
,
9
),
JS_CFUNC_DEF
(
"init"
,
1
,
js_drone_init
),
};
...
...
@@ -370,6 +373,7 @@ static void pubsub_update_variables(UA_UInt32 id, const UA_DataValue *var, bool
s
->
longitude
=
positionArray
[
1
];
s
->
altitudeAbs
=
positionArray
[
2
];
s
->
altitudeRel
=
positionArray
[
3
];
s
->
timestamp
=
positionArray
[
4
];
if
(
print
)
{
UA_LOG_INFO
(
logger
,
UA_LOGCATEGORY_CLIENT
,
...
...
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