Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Rafael Monnerat
slapos
Commits
aa71ff0a
Commit
aa71ff0a
authored
Sep 06, 2022
by
Léo-Paul Géneau
👾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
component/qjs-wrapper: use manual control to fly
Manual control is used under the hood to set course to coordinates
parent
f3f6e048
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
8 deletions
+15
-8
component/qjs-wrapper/buildout.cfg
component/qjs-wrapper/buildout.cfg
+2
-2
software/js-drone/buildout.hash.cfg
software/js-drone/buildout.hash.cfg
+2
-2
software/js-drone/instance.cfg
software/js-drone/instance.cfg
+1
-0
software/js-drone/worker.js
software/js-drone/worker.js
+10
-4
No files found.
component/qjs-wrapper/buildout.cfg
View file @
aa71ff0a
...
@@ -10,8 +10,8 @@ parts = qjs-wrapper
...
@@ -10,8 +10,8 @@ parts = qjs-wrapper
recipe = slapos.recipe.cmmi
recipe = slapos.recipe.cmmi
shared = true
shared = true
configure-command = true
configure-command = true
url = https://lab.nexedi.com/nexedi/qjs-wrapper/-/archive/v0.
2/qjs-wrapper-v0.2
.tar.gz
url = https://lab.nexedi.com/nexedi/qjs-wrapper/-/archive/v0.
3/qjs-wrapper-v0.3
.tar.gz
md5sum =
fa78424e5314d6d3f76e9b0ec28f7878
md5sum =
850b9d5b8530521635a08baa1a2aa9e0
environment =
environment =
C_INCLUDE_PATH=include:${open62541:location}/include:${open62541:location}/deps:${open62541:location}/src/pubsub:${quickjs:location}/include
C_INCLUDE_PATH=include:${open62541:location}/include:${open62541:location}/deps:${open62541:location}/src/pubsub:${quickjs:location}/include
CPLUS_INCLUDE_PATH=include:${mavsdk:location}/include:${mavsdk:location}/include/mavsdk
CPLUS_INCLUDE_PATH=include:${mavsdk:location}/include:${mavsdk:location}/include/mavsdk
...
...
software/js-drone/buildout.hash.cfg
View file @
aa71ff0a
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
# not need these here).
# not need these here).
[instance-profile]
[instance-profile]
filename = instance.cfg
filename = instance.cfg
md5sum =
c0aa1ae91895b77bf223a386f228f302
md5sum =
bf69b4317283f59acda44e341c0a644e
[main]
[main]
filename = main.js
filename = main.js
...
@@ -26,4 +26,4 @@ md5sum = d8798c3206f129e8715afd3ca23afa1a
...
@@ -26,4 +26,4 @@ md5sum = d8798c3206f129e8715afd3ca23afa1a
[worker]
[worker]
filename = worker.js
filename = worker.js
md5sum =
6d0d359bb59b2270042a04e0e35dda10
md5sum =
2f3761f14a4cbd557c91f949fba3471e
software/js-drone/instance.cfg
View file @
aa71ff0a
...
@@ -97,3 +97,4 @@ inline = {{ script }}
...
@@ -97,3 +97,4 @@ inline = {{ script }}
extra-context =
extra-context =
key drone_id_list drone:drone-id-list
key drone_id_list drone:drone-id-list
key id drone:id
key id drone:id
key is_a_drone drone:is-a-drone
software/js-drone/worker.js
View file @
aa71ff0a
/*global console*/
/*global console*/
import
{
import
{
Drone
,
Drone
,
do
Parachute
,
trigger
Parachute
,
getAltitude
,
getAltitude
,
getAltitudeRel
,
getAltitudeRel
,
getInitialAltitude
,
getInitialAltitude
,
...
@@ -9,11 +9,13 @@ import {
...
@@ -9,11 +9,13 @@ import {
getLongitude
,
getLongitude
,
getYaw
,
getYaw
,
initPubsub
,
initPubsub
,
isInManualMode
,
landed
,
landed
,
loiter
,
loiter
,
setAirspeed
,
setAirspeed
,
setAltitude
,
setAltitude
,
setCheckpoint
,
setCheckpoint
,
setManualControlInput
,
setTargetCoordinates
setTargetCoordinates
}
from
"
{{ qjs_wrapper }}
"
;
}
from
"
{{ qjs_wrapper }}
"
;
import
{
Worker
}
from
"
os
"
import
{
Worker
}
from
"
os
"
...
@@ -23,7 +25,8 @@ import * as std from "std";
...
@@ -23,7 +25,8 @@ import * as std from "std";
// Every script is evaluated per drone
// Every script is evaluated per drone
"
use strict
"
;
"
use strict
"
;
const
drone_dict
=
{},
const
drone_dict
=
{},
drone_id_list
=
[{{
drone_id_list
}}];
drone_id_list
=
[{{
drone_id_list
}}],
IS_A_DRONE
=
{{
'
true
'
if
is_a_drone
else
'
false
'
}};
var
parent
=
Worker
.
parent
,
var
parent
=
Worker
.
parent
,
user_me
=
{
user_me
=
{
...
@@ -33,7 +36,7 @@ import * as std from "std";
...
@@ -33,7 +36,7 @@ import * as std from "std";
//to move into user script
//to move into user script
setCheckpoint
:
setCheckpoint
,
setCheckpoint
:
setCheckpoint
,
//required to fly
//required to fly
doParachute
:
do
Parachute
,
triggerParachute
:
trigger
Parachute
,
drone_dict
:
{},
drone_dict
:
{},
exit
:
function
(
exit_code
)
{
exit
:
function
(
exit_code
)
{
parent
.
postMessage
({
type
:
"
exited
"
,
exit
:
exit_code
});
parent
.
postMessage
({
type
:
"
exited
"
,
exit
:
exit_code
});
...
@@ -98,7 +101,10 @@ import * as std from "std";
...
@@ -98,7 +101,10 @@ import * as std from "std";
parent
.
postMessage
({
type
:
"
loaded
"
});
parent
.
postMessage
({
type
:
"
loaded
"
});
}
else
if
(
type
===
'
update
'
)
{
}
else
if
(
type
===
'
update
'
)
{
// Call the drone onStart function
// Call the drone onStart function
if
(
user_me
.
hasOwnProperty
(
'
onUpdate
'
))
{
if
(
user_me
.
hasOwnProperty
(
"
onUpdate
"
))
{
if
(
IS_A_DRONE
&&
isInManualMode
())
{
setManualControlInput
();
}
user_me
.
onUpdate
(
evt
.
data
.
timestamp
);
user_me
.
onUpdate
(
evt
.
data
.
timestamp
);
}
}
parent
.
postMessage
({
type
:
"
updated
"
});
parent
.
postMessage
({
type
:
"
updated
"
});
...
...
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