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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Alain Takoudjou
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
[qjs-wrapper]
recipe = slapos.recipe.cmmi
configure-command = true
url = https://lab.nexedi.com/nexedi/qjs-wrapper/-/archive/v1.
2/qjs-wrapper-v1.2
.tar.gz
md5sum =
e335fc2251610c09dde3e74787317d98
url = https://lab.nexedi.com/nexedi/qjs-wrapper/-/archive/v1.
3/qjs-wrapper-v1.3
.tar.gz
md5sum =
5f63356c6a10bf227e2641ea4f78c7a2
environment =
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
...
...
software/js-drone/buildout.hash.cfg
View file @
89c10ef6
...
...
@@ -18,7 +18,7 @@ md5sum = 360b58007c25727b7bd8a9154d5cafd4
[instance-default]
filename = instance-default.cfg
md5sum =
b26633b118cddd7c7b8dfd61b360999c
md5sum =
903939308701b11b1ff751784a9be110
[instance-drone]
filename = instance-drone.cfg
...
...
@@ -26,7 +26,7 @@ md5sum = 1ff50063f5a54712a0bc0ff38fa74630
[main]
filename = main.js
md5sum =
2118d7908a909c585e03531147b1d540
md5sum =
d0bfcc79cdd7c1e5b8f5d264cc59074e
[pubsub]
filename = pubsub.js
...
...
@@ -34,4 +34,4 @@ md5sum = 1555496ad591a31a845f33488d5c335d
[worker]
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_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 is_a_simulation = slapparameter_dict.get('isASimulation', False) -%}
{% set multicast_ip = slapparameter_dict.get('multicastIp', 'ff15::1111') -%}
...
...
@@ -25,6 +26,7 @@ software-type = drone
return = instance-path
sla-computer_guid = {{ guid }}
config-autopilotIp = {{ autopilot_ip }}
config-autopilotPort = {{ dumps(autopilot_port) }}
config-numberOfPeers = {{ dumps(nb_peer) }}
config-id = {{ dumps(id) }}
config-isASimulation = {{ dumps(is_a_simulation) }}
...
...
software/js-drone/instance-drone-input-schema.json
View file @
89c10ef6
...
...
@@ -9,6 +9,11 @@
"description"
:
"IP used to create a connection with the autopilot."
,
"type"
:
"string"
},
"autopilotPort"
:
{
"title"
:
"Port of the drone's autopilot"
,
"description"
:
"Port on which autopilot service is running."
,
"type"
:
"integer"
},
"numberOfPeers"
:
{
"title"
:
"Number of Peers"
,
"description"
:
"Number of drones and subscribers in the swarm"
,
...
...
software/js-drone/instance-input-schema.json
View file @
89c10ef6
...
...
@@ -10,6 +10,12 @@
"type"
:
"string"
,
"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"
:
{
"title"
:
"List of drones computer ID"
,
"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";
var
CONF_PATH
=
{{
json_module
.
dumps
(
configuration
)
}},
conf_file
=
open
(
CONF_PATH
,
"
r
"
),
configuration
=
JSON
.
parse
(
conf_file
.
readAsString
()),
URL
=
"
udp://
"
+
configuration
.
autopilotIp
+
"
:7909
"
,
LOG_FILE
=
"
{{ log_dir }}/mavsdk-log
"
,
pubsubWorker
,
worker
,
...
...
@@ -53,8 +52,12 @@ import { open, exit } from "std";
}
function
connect
()
{
console
.
log
(
"
Will connect to
"
,
URL
);
exitOnFail
(
start
(
URL
,
LOG_FILE
,
60
),
"
Failed to connect to
"
+
URL
);
var
address
=
configuration
.
autopilotIp
+
"
:
"
+
configuration
.
autopilotPort
;
console
.
log
(
"
Will connect to
"
,
address
);
exitOnFail
(
start
(
configuration
.
autopilotIp
,
configuration
.
autopilotPort
,
LOG_FILE
,
60
),
"
Failed to connect to
"
+
address
);
}
if
(
configuration
.
isADrone
)
{
...
...
software/js-drone/test/test.py
View file @
89c10ef6
...
...
@@ -255,6 +255,7 @@ class JSDroneTestCase(SlapOSInstanceTestCase):
json
.
loads
(
self
.
get_partition
(
'drone'
).
getInstanceParameterDict
()[
'_'
]),
{
'autopilotIp'
:
'192.168.27.1'
,
'autopilotPort'
:
7909
,
'id'
:
0
,
'isASimulation'
:
False
,
'isADrone'
:
False
,
...
...
software/js-drone/worker.js
View file @
89c10ef6
/*jslint nomen: true, indent: 2, maxerr: 3, maxlen: 80 */
/*global console, getAltitude, getAltitudeRel, getInitialAltitude, getLatitude,
getLongitude, getYaw, execUserScript, initPubsub, isInManualMode, landed,
loiter, setAirspeed, setAltitude, setManualControlInput, setMessage,
setTargetCoordinates, std, triggerParachute, Drone, Worker*/
getLongitude, getYaw, execUserScript, initPubsub, landed, loiter, setAirspeed,
setMessage, setTargetCoordinates, std, triggerParachute, Drone, Worker*/
import
{
Drone
,
triggerParachute
,
...
...
@@ -15,12 +14,9 @@ import {
getLongitude
,
getYaw
,
initPubsub
,
isInManualMode
,
landed
,
loiter
,
setAirspeed
,
setAltitude
,
setManualControlInput
,
setMessage
,
setTargetCoordinates
}
from
{{
json_module
.
dumps
(
qjs_wrapper
)
}};
...
...
@@ -28,10 +24,9 @@ import * as std from "std";
import
{
Worker
}
from
"
os
"
;
(
function
(
console
,
getAltitude
,
getAltitudeRel
,
getInitialAltitude
,
getLatitude
,
getLongitude
,
getYaw
,
initPubsub
,
isInManualMode
,
landed
,
loiter
,
setAirspeed
,
setAltitude
,
setManualControlInput
,
setMessage
,
setTargetCoordinates
,
std
,
triggerParachute
,
Drone
,
Worker
)
{
getLatitude
,
getLongitude
,
getYaw
,
initPubsub
,
landed
,
loiter
,
setAirspeed
,
setMessage
,
setTargetCoordinates
,
std
,
triggerParachute
,
Drone
,
Worker
)
{
// Every script is evaluated per drone
"
use strict
"
;
...
...
@@ -70,7 +65,6 @@ import { Worker } from "os";
setMessage
(
JSON
.
stringify
({
content
:
msg
,
dest_id
:
id
}));
},
setAirspeed
:
setAirspeed
,
setAltitude
:
setAltitude
,
setTargetCoordinates
:
setTargetCoordinates
};
conf_file
.
close
();
...
...
@@ -123,9 +117,6 @@ import { Worker } from "os";
});
// Call the drone onStart function
if
(
user_me
.
hasOwnProperty
(
"
onUpdate
"
))
{
if
(
configuration
.
isADrone
&&
isInManualMode
())
{
setManualControlInput
();
}
user_me
.
onUpdate
(
evt
.
data
.
timestamp
);
}
parent
.
postMessage
({
type
:
"
updated
"
});
...
...
@@ -145,6 +136,5 @@ import { Worker } from "os";
}
};
}(
console
,
getAltitude
,
getAltitudeRel
,
getInitialAltitude
,
getLatitude
,
getLongitude
,
getYaw
,
initPubsub
,
isInManualMode
,
landed
,
loiter
,
setAirspeed
,
setAltitude
,
setManualControlInput
,
setMessage
,
setTargetCoordinates
,
std
,
triggerParachute
,
Drone
,
Worker
));
getLongitude
,
getYaw
,
initPubsub
,
landed
,
loiter
,
setAirspeed
,
setMessage
,
setTargetCoordinates
,
std
,
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