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
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
Xavier Thompson
slapos
Commits
89c10ef6
Commit
89c10ef6
authored
Feb 03, 2023
by
Léo-Paul Géneau
👾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
component/qjs-wrapper: v↑ qjs-wrapper (1.2 -> 1.3)
parent
e5be76da
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
32 additions
and
25 deletions
+32
-25
component/qjs-wrapper/buildout.cfg
component/qjs-wrapper/buildout.cfg
+2
-2
software/js-drone/buildout.hash.cfg
software/js-drone/buildout.hash.cfg
+3
-3
software/js-drone/instance-default.cfg
software/js-drone/instance-default.cfg
+2
-0
software/js-drone/instance-drone-input-schema.json
software/js-drone/instance-drone-input-schema.json
+5
-0
software/js-drone/instance-input-schema.json
software/js-drone/instance-input-schema.json
+6
-0
software/js-drone/main.js
software/js-drone/main.js
+6
-3
software/js-drone/test/test.py
software/js-drone/test/test.py
+1
-0
software/js-drone/worker.js
software/js-drone/worker.js
+7
-17
No files found.
component/qjs-wrapper/buildout.cfg
View file @
89c10ef6
...
@@ -9,8 +9,8 @@ parts = qjs-wrapper
...
@@ -9,8 +9,8 @@ parts = qjs-wrapper
[qjs-wrapper]
[qjs-wrapper]
recipe = slapos.recipe.cmmi
recipe = slapos.recipe.cmmi
configure-command = true
configure-command = true
url = https://lab.nexedi.com/nexedi/qjs-wrapper/-/archive/v1.
2/qjs-wrapper-v1.2
.tar.gz
url = https://lab.nexedi.com/nexedi/qjs-wrapper/-/archive/v1.
3/qjs-wrapper-v1.3
.tar.gz
md5sum =
e335fc2251610c09dde3e74787317d98
md5sum =
5f63356c6a10bf227e2641ea4f78c7a2
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 @
89c10ef6
...
@@ -18,7 +18,7 @@ md5sum = 360b58007c25727b7bd8a9154d5cafd4
...
@@ -18,7 +18,7 @@ md5sum = 360b58007c25727b7bd8a9154d5cafd4
[instance-default]
[instance-default]
filename = instance-default.cfg
filename = instance-default.cfg
md5sum =
b26633b118cddd7c7b8dfd61b360999c
md5sum =
903939308701b11b1ff751784a9be110
[instance-drone]
[instance-drone]
filename = instance-drone.cfg
filename = instance-drone.cfg
...
@@ -26,7 +26,7 @@ md5sum = 1ff50063f5a54712a0bc0ff38fa74630
...
@@ -26,7 +26,7 @@ md5sum = 1ff50063f5a54712a0bc0ff38fa74630
[main]
[main]
filename = main.js
filename = main.js
md5sum =
2118d7908a909c585e03531147b1d540
md5sum =
d0bfcc79cdd7c1e5b8f5d264cc59074e
[pubsub]
[pubsub]
filename = pubsub.js
filename = pubsub.js
...
@@ -34,4 +34,4 @@ md5sum = 1555496ad591a31a845f33488d5c335d
...
@@ -34,4 +34,4 @@ md5sum = 1555496ad591a31a845f33488d5c335d
[worker]
[worker]
filename = worker.js
filename = worker.js
md5sum =
3893fb9228603e8c74f803476ec64de
c
md5sum =
e4b4ca3bde1a21f1dbfc4ff7fa3b872
c
software/js-drone/instance-default.cfg
View file @
89c10ef6
{% set autopilot_ip = slapparameter_dict.get('autopilotIp', '192.168.27.1') -%}
{% set autopilot_ip = slapparameter_dict.get('autopilotIp', '192.168.27.1') -%}
{% set autopilot_port = slapparameter_dict.get('autopilotPort', 7909) -%}
{% set flight_script = slapparameter_dict.get('flightScript', 'https://lab.nexedi.com/nexedi/flight-scripts/raw/master/default.js') -%}
{% set flight_script = slapparameter_dict.get('flightScript', 'https://lab.nexedi.com/nexedi/flight-scripts/raw/master/default.js') -%}
{% set is_a_simulation = slapparameter_dict.get('isASimulation', False) -%}
{% set is_a_simulation = slapparameter_dict.get('isASimulation', False) -%}
{% set multicast_ip = slapparameter_dict.get('multicastIp', 'ff15::1111') -%}
{% set multicast_ip = slapparameter_dict.get('multicastIp', 'ff15::1111') -%}
...
@@ -25,6 +26,7 @@ software-type = drone
...
@@ -25,6 +26,7 @@ software-type = drone
return = instance-path
return = instance-path
sla-computer_guid = {{ guid }}
sla-computer_guid = {{ guid }}
config-autopilotIp = {{ autopilot_ip }}
config-autopilotIp = {{ autopilot_ip }}
config-autopilotPort = {{ dumps(autopilot_port) }}
config-numberOfPeers = {{ dumps(nb_peer) }}
config-numberOfPeers = {{ dumps(nb_peer) }}
config-id = {{ dumps(id) }}
config-id = {{ dumps(id) }}
config-isASimulation = {{ dumps(is_a_simulation) }}
config-isASimulation = {{ dumps(is_a_simulation) }}
...
...
software/js-drone/instance-drone-input-schema.json
View file @
89c10ef6
...
@@ -9,6 +9,11 @@
...
@@ -9,6 +9,11 @@
"description"
:
"IP used to create a connection with the autopilot."
,
"description"
:
"IP used to create a connection with the autopilot."
,
"type"
:
"string"
"type"
:
"string"
},
},
"autopilotPort"
:
{
"title"
:
"Port of the drone's autopilot"
,
"description"
:
"Port on which autopilot service is running."
,
"type"
:
"integer"
},
"numberOfPeers"
:
{
"numberOfPeers"
:
{
"title"
:
"Number of Peers"
,
"title"
:
"Number of Peers"
,
"description"
:
"Number of drones and subscribers in the swarm"
,
"description"
:
"Number of drones and subscribers in the swarm"
,
...
...
software/js-drone/instance-input-schema.json
View file @
89c10ef6
...
@@ -10,6 +10,12 @@
...
@@ -10,6 +10,12 @@
"type"
:
"string"
,
"type"
:
"string"
,
"default"
:
"192.168.27.1"
"default"
:
"192.168.27.1"
},
},
"autopilotPort"
:
{
"title"
:
"Port of the drone's autopilot"
,
"description"
:
"Port on which autopilot service is running."
,
"type"
:
"integer"
,
"default"
:
"7909"
},
"droneGuidList"
:
{
"droneGuidList"
:
{
"title"
:
"List of drones computer ID"
,
"title"
:
"List of drones computer ID"
,
"description"
:
"List of computer ID of drones in the swarm"
,
"description"
:
"List of computer ID of drones in the swarm"
,
...
...
software/js-drone/main.js
View file @
89c10ef6
...
@@ -18,7 +18,6 @@ import { open, exit } from "std";
...
@@ -18,7 +18,6 @@ import { open, exit } from "std";
var
CONF_PATH
=
{{
json_module
.
dumps
(
configuration
)
}},
var
CONF_PATH
=
{{
json_module
.
dumps
(
configuration
)
}},
conf_file
=
open
(
CONF_PATH
,
"
r
"
),
conf_file
=
open
(
CONF_PATH
,
"
r
"
),
configuration
=
JSON
.
parse
(
conf_file
.
readAsString
()),
configuration
=
JSON
.
parse
(
conf_file
.
readAsString
()),
URL
=
"
udp://
"
+
configuration
.
autopilotIp
+
"
:7909
"
,
LOG_FILE
=
"
{{ log_dir }}/mavsdk-log
"
,
LOG_FILE
=
"
{{ log_dir }}/mavsdk-log
"
,
pubsubWorker
,
pubsubWorker
,
worker
,
worker
,
...
@@ -53,8 +52,12 @@ import { open, exit } from "std";
...
@@ -53,8 +52,12 @@ import { open, exit } from "std";
}
}
function
connect
()
{
function
connect
()
{
console
.
log
(
"
Will connect to
"
,
URL
);
var
address
=
configuration
.
autopilotIp
+
"
:
"
+
configuration
.
autopilotPort
;
exitOnFail
(
start
(
URL
,
LOG_FILE
,
60
),
"
Failed to connect to
"
+
URL
);
console
.
log
(
"
Will connect to
"
,
address
);
exitOnFail
(
start
(
configuration
.
autopilotIp
,
configuration
.
autopilotPort
,
LOG_FILE
,
60
),
"
Failed to connect to
"
+
address
);
}
}
if
(
configuration
.
isADrone
)
{
if
(
configuration
.
isADrone
)
{
...
...
software/js-drone/test/test.py
View file @
89c10ef6
...
@@ -255,6 +255,7 @@ class JSDroneTestCase(SlapOSInstanceTestCase):
...
@@ -255,6 +255,7 @@ class JSDroneTestCase(SlapOSInstanceTestCase):
json
.
loads
(
self
.
get_partition
(
'drone'
).
getInstanceParameterDict
()[
'_'
]),
json
.
loads
(
self
.
get_partition
(
'drone'
).
getInstanceParameterDict
()[
'_'
]),
{
{
'autopilotIp'
:
'192.168.27.1'
,
'autopilotIp'
:
'192.168.27.1'
,
'autopilotPort'
:
7909
,
'id'
:
0
,
'id'
:
0
,
'isASimulation'
:
False
,
'isASimulation'
:
False
,
'isADrone'
:
False
,
'isADrone'
:
False
,
...
...
software/js-drone/worker.js
View file @
89c10ef6
/*jslint nomen: true, indent: 2, maxerr: 3, maxlen: 80 */
/*jslint nomen: true, indent: 2, maxerr: 3, maxlen: 80 */
/*global console, getAltitude, getAltitudeRel, getInitialAltitude, getLatitude,
/*global console, getAltitude, getAltitudeRel, getInitialAltitude, getLatitude,
getLongitude, getYaw, execUserScript, initPubsub, isInManualMode, landed,
getLongitude, getYaw, execUserScript, initPubsub, landed, loiter, setAirspeed,
loiter, setAirspeed, setAltitude, setManualControlInput, setMessage,
setMessage, setTargetCoordinates, std, triggerParachute, Drone, Worker*/
setTargetCoordinates, std, triggerParachute, Drone, Worker*/
import
{
import
{
Drone
,
Drone
,
triggerParachute
,
triggerParachute
,
...
@@ -15,12 +14,9 @@ import {
...
@@ -15,12 +14,9 @@ import {
getLongitude
,
getLongitude
,
getYaw
,
getYaw
,
initPubsub
,
initPubsub
,
isInManualMode
,
landed
,
landed
,
loiter
,
loiter
,
setAirspeed
,
setAirspeed
,
setAltitude
,
setManualControlInput
,
setMessage
,
setMessage
,
setTargetCoordinates
setTargetCoordinates
}
from
{{
json_module
.
dumps
(
qjs_wrapper
)
}};
}
from
{{
json_module
.
dumps
(
qjs_wrapper
)
}};
...
@@ -28,10 +24,9 @@ import * as std from "std";
...
@@ -28,10 +24,9 @@ import * as std from "std";
import
{
Worker
}
from
"
os
"
;
import
{
Worker
}
from
"
os
"
;
(
function
(
console
,
getAltitude
,
getAltitudeRel
,
getInitialAltitude
,
(
function
(
console
,
getAltitude
,
getAltitudeRel
,
getInitialAltitude
,
getLatitude
,
getLongitude
,
getYaw
,
initPubsub
,
isInManualMode
,
getLatitude
,
getLongitude
,
getYaw
,
initPubsub
,
landed
,
loiter
,
landed
,
loiter
,
setAirspeed
,
setAltitude
,
setManualControlInput
,
setAirspeed
,
setMessage
,
setTargetCoordinates
,
std
,
triggerParachute
,
setMessage
,
setTargetCoordinates
,
std
,
triggerParachute
,
Drone
,
Drone
,
Worker
)
{
Worker
)
{
// Every script is evaluated per drone
// Every script is evaluated per drone
"
use strict
"
;
"
use strict
"
;
...
@@ -70,7 +65,6 @@ import { Worker } from "os";
...
@@ -70,7 +65,6 @@ import { Worker } from "os";
setMessage
(
JSON
.
stringify
({
content
:
msg
,
dest_id
:
id
}));
setMessage
(
JSON
.
stringify
({
content
:
msg
,
dest_id
:
id
}));
},
},
setAirspeed
:
setAirspeed
,
setAirspeed
:
setAirspeed
,
setAltitude
:
setAltitude
,
setTargetCoordinates
:
setTargetCoordinates
setTargetCoordinates
:
setTargetCoordinates
};
};
conf_file
.
close
();
conf_file
.
close
();
...
@@ -123,9 +117,6 @@ import { Worker } from "os";
...
@@ -123,9 +117,6 @@ import { Worker } from "os";
});
});
// Call the drone onStart function
// Call the drone onStart function
if
(
user_me
.
hasOwnProperty
(
"
onUpdate
"
))
{
if
(
user_me
.
hasOwnProperty
(
"
onUpdate
"
))
{
if
(
configuration
.
isADrone
&&
isInManualMode
())
{
setManualControlInput
();
}
user_me
.
onUpdate
(
evt
.
data
.
timestamp
);
user_me
.
onUpdate
(
evt
.
data
.
timestamp
);
}
}
parent
.
postMessage
({
type
:
"
updated
"
});
parent
.
postMessage
({
type
:
"
updated
"
});
...
@@ -145,6 +136,5 @@ import { Worker } from "os";
...
@@ -145,6 +136,5 @@ import { Worker } from "os";
}
}
};
};
}(
console
,
getAltitude
,
getAltitudeRel
,
getInitialAltitude
,
getLatitude
,
}(
console
,
getAltitude
,
getAltitudeRel
,
getInitialAltitude
,
getLatitude
,
getLongitude
,
getYaw
,
initPubsub
,
isInManualMode
,
landed
,
loiter
,
setAirspeed
,
getLongitude
,
getYaw
,
initPubsub
,
landed
,
loiter
,
setAirspeed
,
setMessage
,
setAltitude
,
setManualControlInput
,
setMessage
,
setTargetCoordinates
,
std
,
setTargetCoordinates
,
std
,
triggerParachute
,
Drone
,
Worker
));
triggerParachute
,
Drone
,
Worker
));
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