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
Léo-Paul Géneau
slapos
Commits
e65ba795
Commit
e65ba795
authored
Sep 23, 2024
by
Léo-Paul Géneau
👾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
software/js-drone: define netIf independently
Network interface can now be defined for each computer.
parent
91c13bb4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
42 deletions
+44
-42
software/js-drone/README.md
software/js-drone/README.md
+2
-4
software/js-drone/buildout.hash.cfg
software/js-drone/buildout.hash.cfg
+2
-2
software/js-drone/instance-input-schema.json
software/js-drone/instance-input-schema.json
+29
-23
software/js-drone/instance-root.cfg.jinja2
software/js-drone/instance-root.cfg.jinja2
+9
-9
software/js-drone/instance.cfg.in
software/js-drone/instance.cfg.in
+2
-4
No files found.
software/js-drone/README.md
View file @
e65ba795
...
...
@@ -13,8 +13,7 @@
*
autopilotType: Select which autopilot wrapper should be used
*
autopilotIp: IPv4 address to identify the autopilot from the companion board
*
autopilotPort: Port on whichautopilot serviceis running
*
droneGuidList: List of computer id on which flight script must be deployed
*
droneNetIf: Drone network interface used for multicast traffic
*
droneList: List of computer on which flight script must be deployed
*
debug: Must be set to 'true' to send drone logs through OPC-UA
*
multicastIp: IPv6 of the multicast group of the swarm
*
operatorScript: URL of operator's script to prepare the flight
...
...
@@ -22,8 +21,7 @@
*
flightScript: URL of user's script to execute to fly drone swarm
*
subscriptionScript: URL of the script which will be executed by subscribers
*
loopPeriod: Minimal period (in milliseconds) between 2 executions of the flight script loop
*
subscriberGuidList: List of computer id on which a GUI must be deployed
*
subscriberNetIf: Subscriber network interface used for multicast traffic
*
subscriberList: List of computer on which a GUI must be deployed
## How it works ##
...
...
software/js-drone/buildout.hash.cfg
View file @
e65ba795
...
...
@@ -22,11 +22,11 @@ md5sum = 01425a1c77e79788e1948398b9136724
[instance-profile]
filename = instance.cfg.in
md5sum =
13a389530d919937901f6c4b12cfbc19
md5sum =
87968c91591db2c0778f41f7404700c7
[instance-root]
filename = instance-root.cfg.jinja2
md5sum =
a217eddf949e6e838129e61cc2a48d34
md5sum =
2372a1cf3616ccbd97ada047a645cb32
[instance-subscriber]
filename = instance-subscriber.cfg.in
...
...
software/js-drone/instance-input-schema.json
View file @
e65ba795
{
"$schema"
:
"http://json-schema.org/draft-0
6/schema
"
,
"$schema"
:
"http://json-schema.org/draft-0
7/schema#
"
,
"type"
:
"object"
,
"description"
:
"Parameters to instantiate JS drone"
,
"additionalProperties"
:
false
,
"definitions"
:
{
"entitie-list"
:
{
"description"
:
"List of entities able to listen/send OPC-UA messages from/to the swarm"
,
"type"
:
"array"
,
"default"
:
[],
"items"
:
{
"type"
:
"object"
,
"properties"
:
{
"guid"
:
{
"description"
:
"Computer ID"
,
"type"
:
"string"
},
"netIf"
:
{
"description"
:
"Interface used for multicast traffic."
,
"type"
:
"string"
,
"default"
:
"eth0"
}
}
},
"uniqueItems"
:
true
}
},
"properties"
:
{
"autopilotType"
:
{
"title"
:
"Type of the drone's autopilot"
,
...
...
@@ -26,17 +48,9 @@
"type"
:
"integer"
,
"default"
:
7909
},
"droneGuidList"
:
{
"title"
:
"List of drones computer ID"
,
"description"
:
"List of computer ID of drones in the swarm"
,
"type"
:
"array"
,
"default"
:
[]
},
"droneNetIf"
:
{
"title"
:
"Drones Network interface"
,
"description"
:
"Interface used for multicast traffic."
,
"type"
:
"string"
,
"default"
:
"eth0"
"droneList"
:
{
"$ref"
:
"#/definitions/entitie-list"
,
"title"
:
"List of drones in the swarm"
},
"debug"
:
{
"title"
:
"Set debug mode"
,
...
...
@@ -80,17 +94,9 @@
"type"
:
"integer"
,
"default"
:
200
},
"subscriberGuidList"
:
{
"title"
:
"List of subscribers computer ID"
,
"description"
:
"List of computer ID of swarms subscribers (entities able to listen/send OPC-UA messages from/to the swarm)"
,
"type"
:
"array"
,
"default"
:
[]
},
"subscriberNetIf"
:
{
"title"
:
"Subscribers Network interface"
,
"description"
:
"Interface used for multicast traffic."
,
"type"
:
"string"
,
"default"
:
"eth0"
"subscriberList"
:
{
"$ref"
:
"#/definitions/entitie-list"
,
"title"
:
"List of swarm subscribers"
}
}
}
software/js-drone/instance-root.cfg.jinja2
View file @
e65ba795
{% set parameter_dict = dict(default_parameter_dict, **parameter_dict) -%}
{% set
guid_list = parameter_dict['droneGuidList'] + parameter_dict['subscriberGuid
List'] -%}
{% set
entitie_list = parameter_dict['droneList'] + parameter_dict['subscriber
List'] -%}
{% set drone_id_list = [] -%}
{% set subscriber_id_list = [] -%}
{% set part_list = ['publish-connection-information'] -%}
{% for id,
guid in enumerate(guid
_list) -%}
{% for id,
entitie in enumerate(entitie
_list) -%}
{% set request_peer_section_title = 'request-peer' ~ id -%}
{% do part_list.append(request_peer_section_title) %}
{% set guid = entitie['guid'] %}
[{{ request_peer_section_title }}]
<= slap-connection
recipe = slapos.cookbook:request.serialised
{% if id < len(parameter_dict['drone
Guid
List']) -%}
{% if id < len(parameter_dict['droneList']) -%}
{% set sr_name = parameter_dict['autopilotType'] -%}
name = Drone{{ id }}_{{ guid }}
{% else -%}
{% set sr_name = 'subscriber' -%}
name = Subscriber{{ len(parameter_dict['drone
Guid
List']) - id }}_{{ guid }}
name = Subscriber{{ len(parameter_dict['droneList']) - id }}_{{ guid }}
{% endif -%}
software-url = {{ '/'.join(software_url.split('/')[:-1]) + '/software-%s.cfg' % sr_name }}
return = instance-path
sla-computer_guid = {{ guid }}
config-autopilotIp = {{ parameter_dict['autopilotIp'] }}
config-autopilotPort = {{ dumps(parameter_dict['autopilotPort']) }}
config-numberOfDrones = {{ dumps(len(parameter_dict['drone
Guid
List'])) }}
config-numberOfSubscribers = {{ dumps(len(parameter_dict['subscriber
Guid
List'])) }}
config-numberOfDrones = {{ dumps(len(parameter_dict['droneList'])) }}
config-numberOfSubscribers = {{ dumps(len(parameter_dict['subscriberList'])) }}
config-id = {{ dumps(id) }}
config-debug = {{ dumps(parameter_dict['debug']) }}
config-loopPeriod = {{ dumps(parameter_dict['loopPeriod']) }}
{% if id < len(parameter_dict['droneGuidList']) -%}
config-netIf = {{ entitie.get('netIf', 'eth0') }}
{% if id < len(parameter_dict['droneList']) -%}
{% do drone_id_list.append(id) %}
config-isADrone = {{ dumps(True) }}
config-flightScript = {{ parameter_dict['flightScript'] }}
config-netIf = {{ parameter_dict['droneNetIf'] }}
{% else -%}
{% do subscriber_id_list.append(id) %}
config-isADrone = {{ dumps(False) }}
config-operatorScript = {{ parameter_dict['operatorScript'] }}
config-mapJson = {{ parameter_dict['mapJson'] }}
config-flightScript = {{ parameter_dict['subscriptionScript'] }}
config-netIf = {{ parameter_dict['subscriberNetIf'] }}
{% endif -%}
config-multicastIp = {{ parameter_dict['multicastIp'] }}
{% endfor %}
...
...
software/js-drone/instance.cfg.in
View file @
e65ba795
...
...
@@ -35,14 +35,12 @@ default-parameters =
"autopilotIp": "192.168.27.1",
"autopilotPort": 7909,
"debug": false,
"droneGuidList": [],
"droneNetIf": "eth0",
"droneList": [],
"operatorScript": "https://lab.nexedi.com/nexedi/flight-scripts/-/raw/operator_script/operator.js",
"mapJson": "https://lab.nexedi.com/nexedi/flight-scripts/-/raw/operator_script/map.json",
"flightScript": "https://lab.nexedi.com/nexedi/flight-scripts/-/raw/operator_script/default.js",
"subscriptionScript": "https://lab.nexedi.com/nexedi/flight-scripts/-/raw/operator_script/subscribe.js",
"loopPeriod": 200,
"multicastIp": "ff15::1111",
"subscriberGuidList":[],
"subscriberNetIf": "eth0"
"subscriberList":[]
}
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