swarmit 0.1.0__py3-none-any.whl → 0.3.0__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.1.0.dist-info → swarmit-0.3.0.dist-info}/METADATA +25 -3
- swarmit-0.3.0.dist-info/RECORD +12 -0
- {swarmit-0.1.0.dist-info → swarmit-0.3.0.dist-info}/WHEEL +1 -1
- swarmit-0.3.0.dist-info/licenses/AUTHORS +1 -0
- testbed/cli/main.py +294 -515
- testbed/swarmit/__init__.py +1 -0
- testbed/swarmit/adapter.py +94 -0
- testbed/swarmit/controller.py +620 -0
- testbed/swarmit/protocol.py +292 -0
- swarmit-0.1.0.dist-info/RECORD +0 -6
- {swarmit-0.1.0.dist-info → swarmit-0.3.0.dist-info}/entry_points.txt +0 -0
- {swarmit-0.1.0.dist-info → swarmit-0.3.0.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)
|
@@ -1,11 +1,12 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: swarmit
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.3.0
|
4
4
|
Summary: Run Your Own Robot Swarm Testbed.
|
5
5
|
Project-URL: Homepage, https://github.com/DotBots/swarmit
|
6
6
|
Project-URL: Bug Tracker, https://github.com/DotBots/swarmit/issues
|
7
7
|
Author-email: Alexandre Abadie <alexandre.abadie@inria.fr>
|
8
8
|
License: BSD
|
9
|
+
License-File: AUTHORS
|
9
10
|
License-File: LICENSE
|
10
11
|
Classifier: License :: OSI Approved :: BSD License
|
11
12
|
Classifier: Operating System :: MacOS
|
@@ -15,7 +16,8 @@ Classifier: Programming Language :: Python :: 3
|
|
15
16
|
Requires-Python: >=3.7
|
16
17
|
Requires-Dist: click==8.1.7
|
17
18
|
Requires-Dist: cryptography==43.0.1
|
18
|
-
Requires-Dist:
|
19
|
+
Requires-Dist: paho-mqtt>=2.1.0
|
20
|
+
Requires-Dist: pydotbot==0.22.0
|
19
21
|
Requires-Dist: pyserial==3.5
|
20
22
|
Requires-Dist: rich==13.8.1
|
21
23
|
Requires-Dist: structlog==24.4.0
|
@@ -50,12 +52,32 @@ and [bootloader.emProject](device/bootloader/bootloader.emProject) in SES
|
|
50
52
|
|
51
53
|
The device is now ready.
|
52
54
|
|
55
|
+
### Gateway
|
56
|
+
|
57
|
+
The communication between the computer and the swarm devices is performed via a
|
58
|
+
gateway board connected via USB to the computer.
|
59
|
+
The gateway board is a Nordic nRF53840DK.
|
60
|
+
|
61
|
+
The firmware to run on the gateway can also be compiled and flash using SES.
|
62
|
+
The SES project to open is located at [gateway.emProject](gateway/gateway.emProject).
|
63
|
+
|
64
|
+
After flashing the gateway firmware, LED1 on the DK should blink fast during 1s.
|
65
|
+
|
53
66
|
### Python CLI script
|
54
67
|
|
55
68
|
The Python CLI script provides commands for flashing, starting and stopping user
|
56
69
|
code on the device, as well as monitoring and checking the status of devices
|
57
70
|
in the swarm.
|
58
71
|
|
72
|
+
The Python CLI script connects via a virtual COM port to the gateway connected to
|
73
|
+
the computer.
|
74
|
+
|
75
|
+
The Python CLI script is available on PyPI. Install it using:
|
76
|
+
|
77
|
+
```
|
78
|
+
pip install swarmit
|
79
|
+
```
|
80
|
+
|
59
81
|
Default usage:
|
60
82
|
|
61
83
|
```
|
@@ -0,0 +1,12 @@
|
|
1
|
+
dotbot-firmware/doc/sphinx/conf.py,sha256=uQJVglqE9HoqMXJf5nbmCVCLSSGbqfiSr5ZQbE7HsLk,6211
|
2
|
+
testbed/cli/main.py,sha256=FjGbeRkEKT48drOT79Tphfotl23lFV3RgNS_92fsnT4,10741
|
3
|
+
testbed/swarmit/__init__.py,sha256=VrXpHDu3erkzwl_WXrqINBm9xWkcyUy53IQOj042dOs,22
|
4
|
+
testbed/swarmit/adapter.py,sha256=jX3SJ_Z-cOqERa2Oh-KerzY-5eY6FFicbufGyDPapME,2899
|
5
|
+
testbed/swarmit/controller.py,sha256=o0rXvLC-9gyizlz73kr4Q2YQ3Tk5dd5cCAxaoBShh04,21451
|
6
|
+
testbed/swarmit/protocol.py,sha256=JOXUAGDBY2bI9exw7UMivtjm9a8hi0081_1s4haHx-4,8477
|
7
|
+
swarmit-0.3.0.dist-info/METADATA,sha256=-9rqDCAmXS7WwCVOquKYvDcjJCo8YpY7OX9QQz7tSAY,3324
|
8
|
+
swarmit-0.3.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
9
|
+
swarmit-0.3.0.dist-info/entry_points.txt,sha256=R6BGQe6I1FcI5B2jo7Dr-Gh6-Rjn1Ykx3uAGuV5rVTo,50
|
10
|
+
swarmit-0.3.0.dist-info/licenses/AUTHORS,sha256=o2cH3J5JkbZssK_1zYj0m8PHiGiILV0lySR6_hoWKK0,45
|
11
|
+
swarmit-0.3.0.dist-info/licenses/LICENSE,sha256=j97C1uBc5chpQWi4bv_2SrqExuvKaJK2Ch6L2LFkoc4,1492
|
12
|
+
swarmit-0.3.0.dist-info/RECORD,,
|
@@ -0,0 +1 @@
|
|
1
|
+
Alexandre Abadie <alexandre.abadie@inria.fr>
|