swarmit 0.2.0__py3-none-any.whl → 0.4.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dotbot-firmware/doc/sphinx/conf.py +191 -0
- swarmit-0.4.4.dist-info/METADATA +127 -0
- swarmit-0.4.4.dist-info/RECORD +12 -0
- {swarmit-0.2.0.dist-info → swarmit-0.4.4.dist-info}/WHEEL +1 -1
- testbed/cli/main.py +265 -529
- testbed/swarmit/__init__.py +1 -0
- testbed/swarmit/adapter.py +142 -0
- testbed/swarmit/controller.py +664 -0
- testbed/swarmit/protocol.py +231 -0
- swarmit-0.2.0.dist-info/METADATA +0 -99
- swarmit-0.2.0.dist-info/RECORD +0 -7
- {swarmit-0.2.0.dist-info → swarmit-0.4.4.dist-info}/entry_points.txt +0 -0
- {swarmit-0.2.0.dist-info → swarmit-0.4.4.dist-info}/licenses/AUTHORS +0 -0
- {swarmit-0.2.0.dist-info → swarmit-0.4.4.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,191 @@
|
|
1
|
+
# Configuration file for the Sphinx documentation builder.
|
2
|
+
|
3
|
+
import glob
|
4
|
+
import os
|
5
|
+
import shutil
|
6
|
+
import subprocess
|
7
|
+
import sys
|
8
|
+
|
9
|
+
|
10
|
+
project = 'DotBot-firmware'
|
11
|
+
copyright = '2023, Inria'
|
12
|
+
author = 'Alexandre Abadie'
|
13
|
+
|
14
|
+
# -- General configuration ----------------------------------------------------
|
15
|
+
extensions = [
|
16
|
+
'breathe',
|
17
|
+
"myst_parser",
|
18
|
+
"sphinx.ext.autodoc",
|
19
|
+
"sphinx.ext.autosummary",
|
20
|
+
"sphinx.ext.githubpages",
|
21
|
+
"sphinx.ext.graphviz",
|
22
|
+
"sphinx.ext.inheritance_diagram",
|
23
|
+
"sphinx.ext.todo",
|
24
|
+
"sphinx.ext.viewcode",
|
25
|
+
]
|
26
|
+
|
27
|
+
language = "en"
|
28
|
+
tls_verify = False
|
29
|
+
templates_path = ['_templates']
|
30
|
+
exclude_patterns = ["_build"]
|
31
|
+
nitpick_ignore_regex = [
|
32
|
+
(r'c:.*', r'[u]*int\d{1,2}_t'), # ignore int8_t, uint8_t, ...
|
33
|
+
(r'c:.*', r'NRF_.*'), # ignore NRF_ macros
|
34
|
+
(r'c:.*', r'[s]*size_t'), # ignore size_t and ssize_t
|
35
|
+
(r'c:.*', r'[U]*INT\d{1,2}_MAX'), # ignore INT8_MAX, UINT8_MAX, ...
|
36
|
+
]
|
37
|
+
|
38
|
+
# -- Options for breathe ------------------------------------------------------
|
39
|
+
breathe_projects = {"DotBot-firmware": "../doxygen/xml/"}
|
40
|
+
breathe_default_project = "DotBot-firmware"
|
41
|
+
breathe_show_include = False
|
42
|
+
breathe_domain_by_extension = {
|
43
|
+
"h" : "c",
|
44
|
+
}
|
45
|
+
|
46
|
+
myst_enable_extensions = ["html_image"]
|
47
|
+
|
48
|
+
# -- Options for HTML output --------------------------------------------------
|
49
|
+
html_theme = "pydata_sphinx_theme"
|
50
|
+
html_sourcelink_suffix = ""
|
51
|
+
html_static_path = ["_static"]
|
52
|
+
|
53
|
+
# Define the json_url for our version switcher.
|
54
|
+
json_url = "https://dotbot-firmware.readthedocs.io/en/latest/_static/switcher.json"
|
55
|
+
rtd_version = os.environ.get("READTHEDOCS_VERSION")
|
56
|
+
rtd_version_type = os.environ.get("READTHEDOCS_VERSION_TYPE")
|
57
|
+
rtd_git_identifier = os.environ.get("READTHEDOCS_GIT_IDENTIFIER")
|
58
|
+
# If READTHEDOCS_VERSION doesn't exist, we're not on RTD
|
59
|
+
# If it is an integer, we're in a PR build and the version isn't correct.
|
60
|
+
# If it's "latest" → change to "dev" (that's what we want the switcher to call it)
|
61
|
+
if not rtd_version or rtd_version.isdigit() or rtd_version == "latest":
|
62
|
+
rtd_version = "dev"
|
63
|
+
json_url = "_static/switcher.json"
|
64
|
+
elif rtd_version == "stable":
|
65
|
+
rtd_version = f"{rtd_git_identifier}"
|
66
|
+
elif rtd_version_type == "tag":
|
67
|
+
rtd_version = f"{rtd_git_identifier}"
|
68
|
+
|
69
|
+
html_theme_options = {
|
70
|
+
"external_links": [
|
71
|
+
{
|
72
|
+
"url": "https://github.com/DotBots/PyDotBot",
|
73
|
+
"name": "PyDotBot",
|
74
|
+
"attributes": {
|
75
|
+
"target" : "_blank",
|
76
|
+
"rel" : "noopener me",
|
77
|
+
},
|
78
|
+
},
|
79
|
+
{
|
80
|
+
"url": "https://github.com/DotBots/DotBot-hardware",
|
81
|
+
"name": "DotBot hardware",
|
82
|
+
"attributes": {
|
83
|
+
"target" : "_blank",
|
84
|
+
"rel" : "noopener me",
|
85
|
+
},
|
86
|
+
},
|
87
|
+
],
|
88
|
+
"icon_links": [
|
89
|
+
{
|
90
|
+
"name": "GitHub",
|
91
|
+
"url": "https://github.com/DotBots/DotBot-firmware",
|
92
|
+
"icon": "fa-brands fa-github",
|
93
|
+
},
|
94
|
+
],
|
95
|
+
"header_links_before_dropdown": 4,
|
96
|
+
"logo": {
|
97
|
+
"text": "DotBot firmware",
|
98
|
+
},
|
99
|
+
"navbar_align": "left",
|
100
|
+
"navbar_center": ["version-switcher", "navbar-nav"],
|
101
|
+
"switcher": {
|
102
|
+
"json_url": json_url,
|
103
|
+
"version_match": rtd_version,
|
104
|
+
},
|
105
|
+
"footer_start": ["copyright"],
|
106
|
+
"footer_center": ["sphinx-version"],
|
107
|
+
}
|
108
|
+
|
109
|
+
# -- Options for autosummary/autodoc output -----------------------------------
|
110
|
+
autosummary_generate = True
|
111
|
+
autodoc_typehints = "description"
|
112
|
+
autodoc_member_order = "groupwise"
|
113
|
+
|
114
|
+
# Hook for building doxygen documentation -------------------------------------
|
115
|
+
|
116
|
+
def run_doxygen(app):
|
117
|
+
"""Run the doxygen make command."""
|
118
|
+
doxygen_path = "../doxygen"
|
119
|
+
try:
|
120
|
+
retcode = subprocess.call(f"make -C {doxygen_path}", shell=True)
|
121
|
+
if retcode < 0:
|
122
|
+
sys.stderr.write(f"doxygen terminated by signal {-retcode}")
|
123
|
+
except OSError as e:
|
124
|
+
sys.stderr.write(f"doxygen execution failed: {e}")
|
125
|
+
|
126
|
+
# Hook for generating linked README.md files --------------------------------------------
|
127
|
+
|
128
|
+
README_INCLUDE_TEMPLATE = """```{{include}} {path_to_readme}
|
129
|
+
:relative-images:
|
130
|
+
:relative-docs: ../../
|
131
|
+
```
|
132
|
+
"""
|
133
|
+
|
134
|
+
def generate_readme(app, prefix, dest):
|
135
|
+
projects_dir = os.path.join(app.srcdir, "../../projects/")
|
136
|
+
projects = [os.path.basename(project) for project in glob.glob(f"{projects_dir}/{prefix}*")]
|
137
|
+
output_dir = os.path.join(app.srcdir, dest)
|
138
|
+
if not os.path.exists(output_dir):
|
139
|
+
os.makedirs(output_dir, exist_ok=True)
|
140
|
+
for project in projects:
|
141
|
+
with open(os.path.join(output_dir, f"{project}.md"), "w") as f:
|
142
|
+
f.write(README_INCLUDE_TEMPLATE.format(path_to_readme=f"../../../projects/{project}/README.md"))
|
143
|
+
|
144
|
+
|
145
|
+
def generate_projects_readme(app):
|
146
|
+
for prefix, dest in [("01", "_examples"), ("03app", "_projects")]:
|
147
|
+
generate_readme(app, prefix, dest)
|
148
|
+
|
149
|
+
|
150
|
+
API_INCLUDE_TEMPLATE = """{title}
|
151
|
+
=================================
|
152
|
+
|
153
|
+
.. doxygengroup:: {module}
|
154
|
+
.. doxygenfile:: {header}
|
155
|
+
|
156
|
+
"""
|
157
|
+
EXCLUDE_MODULES = [
|
158
|
+
"board_config",
|
159
|
+
"soft_ed25519",
|
160
|
+
"soft_edsign",
|
161
|
+
"soft_f25519",
|
162
|
+
"soft_fprime",
|
163
|
+
"soft_sha256",
|
164
|
+
"soft_sha512",
|
165
|
+
]
|
166
|
+
|
167
|
+
|
168
|
+
def generate_api_files(app):
|
169
|
+
output_dir = os.path.join(app.srcdir, "_api")
|
170
|
+
if not os.path.exists(output_dir):
|
171
|
+
os.makedirs(output_dir, exist_ok=True)
|
172
|
+
for module in ["bsp", "crypto", "drv"]:
|
173
|
+
module_dir = os.path.join(app.srcdir, f"../../{module}/")
|
174
|
+
submodules = [os.path.basename(project).split(".")[0] for project in glob.glob(f"{module_dir}/*.h")]
|
175
|
+
submodules = [module for module in submodules if module not in EXCLUDE_MODULES]
|
176
|
+
for submodule in submodules:
|
177
|
+
with open(os.path.join(output_dir, f"{module}_{submodule}.rst"), "w") as f:
|
178
|
+
f.write(
|
179
|
+
API_INCLUDE_TEMPLATE.format(
|
180
|
+
title=f"{submodule.capitalize()}",
|
181
|
+
module=f"{module}_{submodule}",
|
182
|
+
header=f"{module}/{submodule}.h"
|
183
|
+
)
|
184
|
+
)
|
185
|
+
|
186
|
+
|
187
|
+
def setup(app):
|
188
|
+
"""Add hook for building doxygen documentation."""
|
189
|
+
app.connect("builder-inited", run_doxygen)
|
190
|
+
app.connect("builder-inited", generate_api_files)
|
191
|
+
app.connect("builder-inited", generate_projects_readme)
|
@@ -0,0 +1,127 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: swarmit
|
3
|
+
Version: 0.4.4
|
4
|
+
Summary: Run Your Own Robot Swarm Testbed.
|
5
|
+
Project-URL: Homepage, https://github.com/DotBots/swarmit
|
6
|
+
Project-URL: Bug Tracker, https://github.com/DotBots/swarmit/issues
|
7
|
+
Author-email: Alexandre Abadie <alexandre.abadie@inria.fr>
|
8
|
+
License: BSD
|
9
|
+
License-File: AUTHORS
|
10
|
+
License-File: LICENSE
|
11
|
+
Classifier: License :: OSI Approved :: BSD License
|
12
|
+
Classifier: Operating System :: MacOS
|
13
|
+
Classifier: Operating System :: Microsoft :: Windows
|
14
|
+
Classifier: Operating System :: POSIX :: Linux
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
16
|
+
Requires-Python: >=3.7
|
17
|
+
Requires-Dist: click==8.1.7
|
18
|
+
Requires-Dist: cryptography==43.0.1
|
19
|
+
Requires-Dist: marilib-pkg>=0.6.0
|
20
|
+
Requires-Dist: pydotbot>=0.24.1
|
21
|
+
Requires-Dist: rich==14.0.0
|
22
|
+
Requires-Dist: structlog==24.4.0
|
23
|
+
Requires-Dist: tqdm==4.66.5
|
24
|
+
Description-Content-Type: text/markdown
|
25
|
+
|
26
|
+
# SwarmIT
|
27
|
+
|
28
|
+
SwarmIT provides a embedded C port for nRF53 as well as Python based services to
|
29
|
+
easily build and deploy a robotic swarm infrastructure testbed.
|
30
|
+
ARM TrustZone is used to create a sandboxed user environment on each device
|
31
|
+
under test, without requiring a control co-processor attached to it.
|
32
|
+
|
33
|
+
https://github.com/user-attachments/assets/eff63b07-216a-41fb-9062-2e0e56f03c20
|
34
|
+
|
35
|
+
## Features
|
36
|
+
|
37
|
+
- Experiment management: start, stop, monitor and status check
|
38
|
+
- Deploy a custom firmware on all or on a subset of robots of a swarm testbed
|
39
|
+
- Resilient robot state: even when crashed by buggy user code, the robot can be reprogrammed remotely and wirelessly
|
40
|
+
|
41
|
+
## Usage
|
42
|
+
|
43
|
+
### Get the code
|
44
|
+
|
45
|
+
Swarmit depends on the [DotBot-firmware](https://github.com/DotBots/DotBot-firmware)
|
46
|
+
and [Mari](https://github.com/DotBots/mari) repositories. They are included
|
47
|
+
in the codebase as [Git submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules).
|
48
|
+
|
49
|
+
Use the following command to clone the Swarmit codebase locally:
|
50
|
+
|
51
|
+
```
|
52
|
+
git clone --recurse-submodules https://github.com/DotBots/swarmit.git
|
53
|
+
```
|
54
|
+
|
55
|
+
### Embedded C code
|
56
|
+
|
57
|
+
SwarmIT embedded C code can be built using
|
58
|
+
[Segger Embedded Studio (SES)](https://www.segger.com/products/development-tools/embedded-studio/).
|
59
|
+
Use Tools > Package manager to install the CMSIS 5 CMSIS-CORE, CMSIS-DSP and nRF packages.
|
60
|
+
|
61
|
+
To provision a device, follow the following steps:
|
62
|
+
1. open [netcore.emProject](swarmit-netcore.emProject)
|
63
|
+
and [bootloader.emProject](swarmit-bootloader-dotbot-v3.emProject)
|
64
|
+
(or [bootloader.emProject](swarmit-bootloader-dotbot-v2.emProject) depending on
|
65
|
+
your robot version) in SES
|
66
|
+
2. build and load the netcore application on the nRF53 network core,
|
67
|
+
3. build and load the bootloader application on the nRF53 application core.
|
68
|
+
|
69
|
+
The device is now ready.
|
70
|
+
|
71
|
+
### Gateway
|
72
|
+
|
73
|
+
The communication between the computer and the swarm devices is performed via a
|
74
|
+
gateway board connected via USB to the computer.
|
75
|
+
|
76
|
+
This gateway uses the [mari](https://github.com/dotbots/mari) network stack and
|
77
|
+
the it must run the Mari gateway firmware, either Edge or Cloud version.
|
78
|
+
|
79
|
+
The documentation to setup a Mari gateway is located
|
80
|
+
[here](https://github.com/DotBots/mari/wiki/Getting-started#running-mari-network-on-your-computer).
|
81
|
+
|
82
|
+
### Python CLI script
|
83
|
+
|
84
|
+
The Python CLI script provides commands for flashing, starting and stopping user
|
85
|
+
code on the device, as well as monitoring and checking the status of devices
|
86
|
+
in the swarm.
|
87
|
+
|
88
|
+
The Python CLI script connects via a virtual COM port to the gateway connected to
|
89
|
+
the computer.
|
90
|
+
|
91
|
+
The Python CLI script is available on PyPI. Install it using:
|
92
|
+
|
93
|
+
```
|
94
|
+
pip install swarmit
|
95
|
+
```
|
96
|
+
|
97
|
+
Print usage using `swarmit --help`:
|
98
|
+
|
99
|
+
```
|
100
|
+
Usage: swarmit [OPTIONS] COMMAND [ARGS]...
|
101
|
+
|
102
|
+
Options:
|
103
|
+
-p, --port TEXT Serial port to use to send the bitstream to
|
104
|
+
the gateway. Default: /dev/ttyACM0.
|
105
|
+
-b, --baudrate INTEGER Serial port baudrate. Default: 1000000.
|
106
|
+
-H, --mqtt-host TEXT MQTT host. Default: localhost.
|
107
|
+
-P, --mqtt-port INTEGER MQTT port. Default: 1883.
|
108
|
+
-T, --mqtt-use_tls Use TLS with MQTT.
|
109
|
+
-n, --network-id INTEGER Marilib network ID to use. Default: 1
|
110
|
+
-a, --adapter [edge|cloud]
|
111
|
+
Choose the adapter to communicate with the
|
112
|
+
gateway. [default: edge]
|
113
|
+
-d, --devices TEXT Subset list of devices to interact with,
|
114
|
+
separated with ,
|
115
|
+
-v, --verbose Enable verbose mode.
|
116
|
+
-V, --version Show the version and exit.
|
117
|
+
-h, --help Show this message and exit.
|
118
|
+
|
119
|
+
Commands:
|
120
|
+
flash Flash a firmware to the robots.
|
121
|
+
message Send a custom text message to the robots.
|
122
|
+
monitor Monitor running applications.
|
123
|
+
reset Reset robots locations.
|
124
|
+
start Start the user application.
|
125
|
+
status Print current status of the robots.
|
126
|
+
stop Stop the user application.
|
127
|
+
```
|
@@ -0,0 +1,12 @@
|
|
1
|
+
dotbot-firmware/doc/sphinx/conf.py,sha256=uQJVglqE9HoqMXJf5nbmCVCLSSGbqfiSr5ZQbE7HsLk,6211
|
2
|
+
testbed/cli/main.py,sha256=2jix2xPzP4XLcnpk804gKGOJWnXAho73lbZXqJGk_6g,9399
|
3
|
+
testbed/swarmit/__init__.py,sha256=6G_giX6Ucuweo7w5OiftoXmbNLoqiU_soXJoU8aiLmY,22
|
4
|
+
testbed/swarmit/adapter.py,sha256=Qmx7ULkx0OfyU7PJh-VBQibEOhvnDfnB3_DmntQ2tfU,4616
|
5
|
+
testbed/swarmit/controller.py,sha256=7XTX0Px8hnzE-ebUsMLFuPs3uKOrdBSle2mkOuW_gVQ,22354
|
6
|
+
testbed/swarmit/protocol.py,sha256=tkPMIGo_G1Fvo3zM6_zk4a3i3gqLtEzDFf97VRHa4B4,6344
|
7
|
+
swarmit-0.4.4.dist-info/METADATA,sha256=tsOWOAwVvJNzJxJleyTLcTcaaqFjuYgmSVaEr2A10xE,4837
|
8
|
+
swarmit-0.4.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
9
|
+
swarmit-0.4.4.dist-info/entry_points.txt,sha256=R6BGQe6I1FcI5B2jo7Dr-Gh6-Rjn1Ykx3uAGuV5rVTo,50
|
10
|
+
swarmit-0.4.4.dist-info/licenses/AUTHORS,sha256=o2cH3J5JkbZssK_1zYj0m8PHiGiILV0lySR6_hoWKK0,45
|
11
|
+
swarmit-0.4.4.dist-info/licenses/LICENSE,sha256=j97C1uBc5chpQWi4bv_2SrqExuvKaJK2Ch6L2LFkoc4,1492
|
12
|
+
swarmit-0.4.4.dist-info/RECORD,,
|