hivebr 0.1.0__tar.gz
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.
- hivebr-0.1.0/LICENSE +21 -0
- hivebr-0.1.0/MANIFEST.in +8 -0
- hivebr-0.1.0/PKG-INFO +148 -0
- hivebr-0.1.0/README.md +101 -0
- hivebr-0.1.0/RELEASING.md +85 -0
- hivebr-0.1.0/config/default copy.yaml +127 -0
- hivebr-0.1.0/config/default.yaml +147 -0
- hivebr-0.1.0/config/maze.png +0 -0
- hivebr-0.1.0/config/maze2.png +0 -0
- hivebr-0.1.0/config/maze_config.yaml +95 -0
- hivebr-0.1.0/docs/api/bridge.md +7 -0
- hivebr-0.1.0/docs/api/camera.md +8 -0
- hivebr-0.1.0/docs/api/core.md +5 -0
- hivebr-0.1.0/docs/api/data_logger.md +5 -0
- hivebr-0.1.0/docs/api/geometry.md +11 -0
- hivebr-0.1.0/docs/api/index.md +23 -0
- hivebr-0.1.0/docs/api/interaction.md +5 -0
- hivebr-0.1.0/docs/api/kinematics.md +5 -0
- hivebr-0.1.0/docs/api/lidar.md +8 -0
- hivebr-0.1.0/docs/api/map_generator.md +7 -0
- hivebr-0.1.0/docs/api/occupancy_grid.md +8 -0
- hivebr-0.1.0/docs/api/robots.md +44 -0
- hivebr-0.1.0/docs/api/simulator.md +10 -0
- hivebr-0.1.0/docs/api/state.md +5 -0
- hivebr-0.1.0/docs/api/waypoints.md +8 -0
- hivebr-0.1.0/docs/api/world.md +9 -0
- hivebr-0.1.0/docs/configuration.md +128 -0
- hivebr-0.1.0/docs/controllers.md +73 -0
- hivebr-0.1.0/docs/examples/decentralized.md +59 -0
- hivebr-0.1.0/docs/examples/multi_robot.md +47 -0
- hivebr-0.1.0/docs/examples/single_robot.md +46 -0
- hivebr-0.1.0/docs/getting_started.md +90 -0
- hivebr-0.1.0/docs/index.md +81 -0
- hivebr-0.1.0/docs/installation.md +81 -0
- hivebr-0.1.0/docs/maps.md +73 -0
- hivebr-0.1.0/docs/multi_robot.md +113 -0
- hivebr-0.1.0/docs/openlab_api.md +116 -0
- hivebr-0.1.0/docs/planners.md +71 -0
- hivebr-0.1.0/docs/robots.md +105 -0
- hivebr-0.1.0/docs/sensors.md +62 -0
- hivebr-0.1.0/docs/user_interface.md +59 -0
- hivebr-0.1.0/examples/controle_robodiferencial.py +246 -0
- hivebr-0.1.0/examples/controllers/__init__.py +0 -0
- hivebr-0.1.0/examples/controllers/planner_controller.py +280 -0
- hivebr-0.1.0/examples/controllers/potential_field.py +568 -0
- hivebr-0.1.0/examples/controllers/potential_field2.py +597 -0
- hivebr-0.1.0/examples/controllers/simple_ackermann_controller.py +127 -0
- hivebr-0.1.0/examples/controllers/simula_robot.py +89 -0
- hivebr-0.1.0/examples/controllers/vortex_apf.py +528 -0
- hivebr-0.1.0/examples/controllers/waypoint_follower_controller.py +135 -0
- hivebr-0.1.0/examples/decentralized_swarm.py +125 -0
- hivebr-0.1.0/examples/multi_robot_differential.py +137 -0
- hivebr-0.1.0/examples/planners/__init__.py +0 -0
- hivebr-0.1.0/examples/planners/astar.py +213 -0
- hivebr-0.1.0/examples/planners/base_planner.py +253 -0
- hivebr-0.1.0/examples/planners/ompl_planner.py +204 -0
- hivebr-0.1.0/examples/planners/planners.py +436 -0
- hivebr-0.1.0/examples/planners/rrtdubins/dubins_path_planner.py +317 -0
- hivebr-0.1.0/examples/planners/rrtdubins/plot.py +234 -0
- hivebr-0.1.0/examples/planners/rrtdubins/rrt.py +291 -0
- hivebr-0.1.0/examples/planners/rrtdubins/rrt_star.py +303 -0
- hivebr-0.1.0/examples/planners/rrtdubins/rrt_star_dubins.py +217 -0
- hivebr-0.1.0/examples/planners/rrtdubins/run_rrtdubins2.py +263 -0
- hivebr-0.1.0/examples/planners/rrtdubins/run_rrtdubins_ompl.py +79 -0
- hivebr-0.1.0/examples/run_AG.py +313 -0
- hivebr-0.1.0/examples/run_ackermann.py +19 -0
- hivebr-0.1.0/examples/run_astar copy.py +146 -0
- hivebr-0.1.0/examples/run_astar.py +259 -0
- hivebr-0.1.0/examples/run_boat.py +67 -0
- hivebr-0.1.0/examples/run_custom_controller.py +36 -0
- hivebr-0.1.0/examples/run_differential.py +194 -0
- hivebr-0.1.0/examples/run_holonomic.py +190 -0
- hivebr-0.1.0/examples/run_maze.py +38 -0
- hivebr-0.1.0/examples/run_rrt.py +62 -0
- hivebr-0.1.0/pyproject.toml +77 -0
- hivebr-0.1.0/requirements-docs.txt +4 -0
- hivebr-0.1.0/setup.cfg +4 -0
- hivebr-0.1.0/src/hivebr/__init__.py +20 -0
- hivebr-0.1.0/src/hivebr/bridge.py +143 -0
- hivebr-0.1.0/src/hivebr/core.py +207 -0
- hivebr-0.1.0/src/hivebr/engine/__init__.py +15 -0
- hivebr-0.1.0/src/hivebr/engine/assets/explosion.png +0 -0
- hivebr-0.1.0/src/hivebr/engine/assets/mapa_1.png +0 -0
- hivebr-0.1.0/src/hivebr/engine/assets/mapa_l.png +0 -0
- hivebr-0.1.0/src/hivebr/engine/assets/mapa_u.png +0 -0
- hivebr-0.1.0/src/hivebr/engine/assets/maze2.png +0 -0
- hivebr-0.1.0/src/hivebr/engine/assets/recharge_place.png +0 -0
- hivebr-0.1.0/src/hivebr/engine/camera.py +72 -0
- hivebr-0.1.0/src/hivebr/engine/config.py +10 -0
- hivebr-0.1.0/src/hivebr/engine/data_logger.py +627 -0
- hivebr-0.1.0/src/hivebr/engine/geometry.py +14 -0
- hivebr-0.1.0/src/hivebr/engine/interaction.py +66 -0
- hivebr-0.1.0/src/hivebr/engine/lidar.py +67 -0
- hivebr-0.1.0/src/hivebr/engine/map_generator.py +282 -0
- hivebr-0.1.0/src/hivebr/engine/occupancy_grid.py +250 -0
- hivebr-0.1.0/src/hivebr/engine/robots/__init__.py +61 -0
- hivebr-0.1.0/src/hivebr/engine/robots/ackermann.py +172 -0
- hivebr-0.1.0/src/hivebr/engine/robots/base.py +33 -0
- hivebr-0.1.0/src/hivebr/engine/robots/boat.py +214 -0
- hivebr-0.1.0/src/hivebr/engine/robots/differential.py +224 -0
- hivebr-0.1.0/src/hivebr/engine/robots/differential_firstorder.py +79 -0
- hivebr-0.1.0/src/hivebr/engine/robots/holonomic.py +110 -0
- hivebr-0.1.0/src/hivebr/engine/simulator.py +1031 -0
- hivebr-0.1.0/src/hivebr/engine/ui/__init__.py +0 -0
- hivebr-0.1.0/src/hivebr/engine/ui/gui.py +389 -0
- hivebr-0.1.0/src/hivebr/engine/waypoints.py +138 -0
- hivebr-0.1.0/src/hivebr/engine/world.py +363 -0
- hivebr-0.1.0/src/hivebr/kinematics.py +49 -0
- hivebr-0.1.0/src/hivebr/state.py +59 -0
- hivebr-0.1.0/src/hivebr.egg-info/PKG-INFO +148 -0
- hivebr-0.1.0/src/hivebr.egg-info/SOURCES.txt +112 -0
- hivebr-0.1.0/src/hivebr.egg-info/dependency_links.txt +1 -0
- hivebr-0.1.0/src/hivebr.egg-info/requires.txt +21 -0
- hivebr-0.1.0/src/hivebr.egg-info/top_level.txt +1 -0
hivebr-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Elias J. R. Freitas
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
hivebr-0.1.0/MANIFEST.in
ADDED
hivebr-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
|
+
Name: hivebr
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Hivebr simulator - 2D simulator and OpenLab API for single- and multi-robot (B-bot) navigation.
|
|
5
|
+
Author: Elias J. R. Freitas
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/eliasjof/hivebr_simulator
|
|
8
|
+
Project-URL: Documentation, https://eliasjof.github.io/hivebr_simulator/
|
|
9
|
+
Project-URL: Repository, https://github.com/eliasjof/hivebr_simulator
|
|
10
|
+
Project-URL: Issues, https://github.com/eliasjof/hivebr_simulator/issues
|
|
11
|
+
Keywords: robotics,simulation,multi-robot,swarm,navigation,path-planning,mobile-robots,pygame
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Education
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Natural Language :: English
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
25
|
+
Classifier: Topic :: Scientific/Engineering
|
|
26
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
27
|
+
Requires-Python: >=3.8
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
License-File: LICENSE
|
|
30
|
+
Requires-Dist: pygame-ce>=2.5.0
|
|
31
|
+
Requires-Dist: pygame_gui>=0.6.9
|
|
32
|
+
Requires-Dist: numpy>=1.24
|
|
33
|
+
Requires-Dist: PyYAML>=6.0
|
|
34
|
+
Provides-Extra: maps
|
|
35
|
+
Requires-Dist: Pillow>=9.0; extra == "maps"
|
|
36
|
+
Requires-Dist: scipy>=1.9; extra == "maps"
|
|
37
|
+
Provides-Extra: plot
|
|
38
|
+
Requires-Dist: matplotlib>=3.6; extra == "plot"
|
|
39
|
+
Provides-Extra: docs
|
|
40
|
+
Requires-Dist: mkdocs>=1.6; extra == "docs"
|
|
41
|
+
Requires-Dist: mkdocs-material>=9.5; extra == "docs"
|
|
42
|
+
Requires-Dist: mkdocstrings[python]>=0.25; extra == "docs"
|
|
43
|
+
Requires-Dist: black>=24.0; extra == "docs"
|
|
44
|
+
Provides-Extra: dev
|
|
45
|
+
Requires-Dist: build>=1.2; extra == "dev"
|
|
46
|
+
Requires-Dist: twine>=5.1; extra == "dev"
|
|
47
|
+
|
|
48
|
+
# hivebr — OpenLab Simulator
|
|
49
|
+
|
|
50
|
+
[](https://pypi.org/project/hivebr/)
|
|
51
|
+
[](https://pypi.org/project/hivebr/)
|
|
52
|
+
[](https://github.com/eliasjof/hivebr_simulator/blob/main/LICENSE)
|
|
53
|
+
[](https://eliasjof.github.io/hivebr_simulator/)
|
|
54
|
+
|
|
55
|
+
A lightweight 2D simulation framework for **single- and multi-robot mobile
|
|
56
|
+
navigation**, built on Pygame, with a dual-paradigm **OpenLab API** for
|
|
57
|
+
centralized and decentralized control.
|
|
58
|
+
|
|
59
|
+
Robots in the simulator are called **B-bots** (for *bee*), keeping the hive
|
|
60
|
+
metaphor.
|
|
61
|
+
|
|
62
|
+
📖 **Full documentation:** <https://eliasjof.github.io/hivebr_simulator/>
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Installation
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
pip install hivebr
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Optional extras:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
pip install "hivebr[maps]" # occupancy grids (Pillow + scipy)
|
|
76
|
+
pip install "hivebr[plot]" # data logger plots (matplotlib)
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Quick start
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
from hivebr import HiveBrAgent, SwarmExperiment
|
|
83
|
+
|
|
84
|
+
class Patrol(HiveBrAgent):
|
|
85
|
+
def loop(self, state, neighbors):
|
|
86
|
+
# state.goal holds the current waypoint (x, y, theta)
|
|
87
|
+
return 0.5, 0.0
|
|
88
|
+
|
|
89
|
+
exp = SwarmExperiment(robots=3, backend="navsim2d")
|
|
90
|
+
exp.assign_agent(robot_ids=[0, 1, 2], agent_class=Patrol)
|
|
91
|
+
exp.assign_route(0, [[5, 2, 0.0], [5, 6, 0.0]])
|
|
92
|
+
exp.run()
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
A single robot is just a fleet with `N = 1`. Switching `backend="ros2"` reuses
|
|
96
|
+
the same agent code on the physical arena.
|
|
97
|
+
|
|
98
|
+
## Dual paradigm
|
|
99
|
+
|
|
100
|
+
| Decentralized — `HiveBrAgent` | Centralized — `SwarmController` |
|
|
101
|
+
| ----------------------------- | ------------------------------- |
|
|
102
|
+
| One instance per B-bot | Exactly one instance |
|
|
103
|
+
| Receives its `state` + `neighbors` | Receives all `states` |
|
|
104
|
+
| Returns a command | Returns `{robot_id: command}` |
|
|
105
|
+
| Reactive control, consensus | Global planning, optimization (DE, L-SHADE) |
|
|
106
|
+
|
|
107
|
+
## Features
|
|
108
|
+
|
|
109
|
+
- **Mono or fleet, one API.** A single robot is a fleet with `N = 1`.
|
|
110
|
+
- **Interactive GUI.** Pan/zoom, load occupancy-grid maps, switch themes,
|
|
111
|
+
toggle LiDAR, add waypoints and obstacles with the mouse.
|
|
112
|
+
- **Two environment representations.** Analytic circular obstacles *and*
|
|
113
|
+
image-based occupancy grids with inflation.
|
|
114
|
+
- **Precision sensing.** Ray-casting LiDAR (DDA) against the grid plus analytic
|
|
115
|
+
circle intersections.
|
|
116
|
+
- **Deterministic fleets.** Each timestep is computed from a frozen snapshot of
|
|
117
|
+
the fleet state, independent of update order.
|
|
118
|
+
- **Research-ready.** Pluggable controllers, path planners (A*, RRT, RRT*, PRM,
|
|
119
|
+
BIT*, OMPL, RRT-Dubins), and a data logger for offline analysis.
|
|
120
|
+
|
|
121
|
+
## Robot models
|
|
122
|
+
|
|
123
|
+
| `type` | Command |
|
|
124
|
+
| ------ | ------- |
|
|
125
|
+
| `differential` | `{"v": ..., "omega": ...}` |
|
|
126
|
+
| `differential_firstorder` | `{"v": ..., "omega": ...}` |
|
|
127
|
+
| `holonomic` | `{"vx": ..., "vy": ...}` |
|
|
128
|
+
| `ackermann` | `{"speed": ..., "steer": ...}` |
|
|
129
|
+
| `boat` | `{"v": ..., "omega": ...}` |
|
|
130
|
+
|
|
131
|
+
## Run the examples
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
# from a clone of the repository (examples are not shipped in the wheel)
|
|
135
|
+
python examples/controle_robodiferencial.py
|
|
136
|
+
python examples/decentralized_swarm.py
|
|
137
|
+
python examples/multi_robot_differential.py
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Links
|
|
141
|
+
|
|
142
|
+
- Documentation: <https://eliasjof.github.io/hivebr_simulator/>
|
|
143
|
+
- Repository: <https://github.com/eliasjof/hivebr_simulator>
|
|
144
|
+
- Issue tracker: <https://github.com/eliasjof/hivebr_simulator/issues>
|
|
145
|
+
|
|
146
|
+
## License
|
|
147
|
+
|
|
148
|
+
MIT — free for educational and research use. See [LICENSE](LICENSE).
|
hivebr-0.1.0/README.md
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# hivebr — OpenLab Simulator
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/hivebr/)
|
|
4
|
+
[](https://pypi.org/project/hivebr/)
|
|
5
|
+
[](https://github.com/eliasjof/hivebr_simulator/blob/main/LICENSE)
|
|
6
|
+
[](https://eliasjof.github.io/hivebr_simulator/)
|
|
7
|
+
|
|
8
|
+
A lightweight 2D simulation framework for **single- and multi-robot mobile
|
|
9
|
+
navigation**, built on Pygame, with a dual-paradigm **OpenLab API** for
|
|
10
|
+
centralized and decentralized control.
|
|
11
|
+
|
|
12
|
+
Robots in the simulator are called **B-bots** (for *bee*), keeping the hive
|
|
13
|
+
metaphor.
|
|
14
|
+
|
|
15
|
+
📖 **Full documentation:** <https://eliasjof.github.io/hivebr_simulator/>
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pip install hivebr
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Optional extras:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pip install "hivebr[maps]" # occupancy grids (Pillow + scipy)
|
|
29
|
+
pip install "hivebr[plot]" # data logger plots (matplotlib)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Quick start
|
|
33
|
+
|
|
34
|
+
```python
|
|
35
|
+
from hivebr import HiveBrAgent, SwarmExperiment
|
|
36
|
+
|
|
37
|
+
class Patrol(HiveBrAgent):
|
|
38
|
+
def loop(self, state, neighbors):
|
|
39
|
+
# state.goal holds the current waypoint (x, y, theta)
|
|
40
|
+
return 0.5, 0.0
|
|
41
|
+
|
|
42
|
+
exp = SwarmExperiment(robots=3, backend="navsim2d")
|
|
43
|
+
exp.assign_agent(robot_ids=[0, 1, 2], agent_class=Patrol)
|
|
44
|
+
exp.assign_route(0, [[5, 2, 0.0], [5, 6, 0.0]])
|
|
45
|
+
exp.run()
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
A single robot is just a fleet with `N = 1`. Switching `backend="ros2"` reuses
|
|
49
|
+
the same agent code on the physical arena.
|
|
50
|
+
|
|
51
|
+
## Dual paradigm
|
|
52
|
+
|
|
53
|
+
| Decentralized — `HiveBrAgent` | Centralized — `SwarmController` |
|
|
54
|
+
| ----------------------------- | ------------------------------- |
|
|
55
|
+
| One instance per B-bot | Exactly one instance |
|
|
56
|
+
| Receives its `state` + `neighbors` | Receives all `states` |
|
|
57
|
+
| Returns a command | Returns `{robot_id: command}` |
|
|
58
|
+
| Reactive control, consensus | Global planning, optimization (DE, L-SHADE) |
|
|
59
|
+
|
|
60
|
+
## Features
|
|
61
|
+
|
|
62
|
+
- **Mono or fleet, one API.** A single robot is a fleet with `N = 1`.
|
|
63
|
+
- **Interactive GUI.** Pan/zoom, load occupancy-grid maps, switch themes,
|
|
64
|
+
toggle LiDAR, add waypoints and obstacles with the mouse.
|
|
65
|
+
- **Two environment representations.** Analytic circular obstacles *and*
|
|
66
|
+
image-based occupancy grids with inflation.
|
|
67
|
+
- **Precision sensing.** Ray-casting LiDAR (DDA) against the grid plus analytic
|
|
68
|
+
circle intersections.
|
|
69
|
+
- **Deterministic fleets.** Each timestep is computed from a frozen snapshot of
|
|
70
|
+
the fleet state, independent of update order.
|
|
71
|
+
- **Research-ready.** Pluggable controllers, path planners (A*, RRT, RRT*, PRM,
|
|
72
|
+
BIT*, OMPL, RRT-Dubins), and a data logger for offline analysis.
|
|
73
|
+
|
|
74
|
+
## Robot models
|
|
75
|
+
|
|
76
|
+
| `type` | Command |
|
|
77
|
+
| ------ | ------- |
|
|
78
|
+
| `differential` | `{"v": ..., "omega": ...}` |
|
|
79
|
+
| `differential_firstorder` | `{"v": ..., "omega": ...}` |
|
|
80
|
+
| `holonomic` | `{"vx": ..., "vy": ...}` |
|
|
81
|
+
| `ackermann` | `{"speed": ..., "steer": ...}` |
|
|
82
|
+
| `boat` | `{"v": ..., "omega": ...}` |
|
|
83
|
+
|
|
84
|
+
## Run the examples
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
# from a clone of the repository (examples are not shipped in the wheel)
|
|
88
|
+
python examples/controle_robodiferencial.py
|
|
89
|
+
python examples/decentralized_swarm.py
|
|
90
|
+
python examples/multi_robot_differential.py
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Links
|
|
94
|
+
|
|
95
|
+
- Documentation: <https://eliasjof.github.io/hivebr_simulator/>
|
|
96
|
+
- Repository: <https://github.com/eliasjof/hivebr_simulator>
|
|
97
|
+
- Issue tracker: <https://github.com/eliasjof/hivebr_simulator/issues>
|
|
98
|
+
|
|
99
|
+
## License
|
|
100
|
+
|
|
101
|
+
MIT — free for educational and research use. See [LICENSE](LICENSE).
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Releasing hivebr
|
|
2
|
+
|
|
3
|
+
This project publishes to [PyPI](https://pypi.org/project/hivebr/) as `hivebr`.
|
|
4
|
+
|
|
5
|
+
## 1. Bump the version
|
|
6
|
+
|
|
7
|
+
Edit `version` in `pyproject.toml` (semantic versioning, e.g. `0.1.1`, `0.2.0`).
|
|
8
|
+
Keep `hivebr.__version__` in `src/hivebr/__init__.py` in sync.
|
|
9
|
+
|
|
10
|
+
## 2. Build locally and check the metadata
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
python -m pip install -U build twine
|
|
14
|
+
python -m build
|
|
15
|
+
python -m twine check dist/*
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
`python -m build` produces:
|
|
19
|
+
|
|
20
|
+
- `dist/hivebr-<version>.tar.gz` (sdist)
|
|
21
|
+
- `dist/hivebr-<version>-py3-none-any.whl` (wheel)
|
|
22
|
+
|
|
23
|
+
Inspect the wheel to confirm the engine assets and subpackages are present:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
python -m zipfile -l dist/hivebr-*.whl
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## 3. Test the wheel in a clean environment
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
python -m venv /tmp/hivebr-test
|
|
33
|
+
# Windows: /tmp/hivebr-test/Scripts/activate ; Linux/macOS:
|
|
34
|
+
source /tmp/hivebr-test/bin/activate
|
|
35
|
+
pip install dist/hivebr-*.whl
|
|
36
|
+
python -c "import hivebr; print(hivebr.__version__)"
|
|
37
|
+
python -c "from hivebr.engine import Simulator; print('engine ok')"
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## 4. Publish
|
|
41
|
+
|
|
42
|
+
### Option A — Automated (recommended, Trusted Publishing)
|
|
43
|
+
|
|
44
|
+
Pushing a GitHub **release** (or running the `Publish to PyPI` workflow
|
|
45
|
+
manually) triggers `.github/workflows/Publish.yml`, which builds and uploads the
|
|
46
|
+
distributions.
|
|
47
|
+
|
|
48
|
+
One-time setup on PyPI:
|
|
49
|
+
|
|
50
|
+
1. Go to **PyPI → Your projects → Publishing** (or
|
|
51
|
+
<https://pypi.org/manage/account/publishing/>).
|
|
52
|
+
2. Add a **pending publisher** / trusted publisher with:
|
|
53
|
+
- PyPI project name: `hivebr`
|
|
54
|
+
- Owner: `eliasjof`
|
|
55
|
+
- Repository: `hivebr_simulator`
|
|
56
|
+
- Workflow name: `Publish.yml`
|
|
57
|
+
- Environment name: `pypi`
|
|
58
|
+
3. Create a GitHub **environment** named `pypi` (Settings → Environments).
|
|
59
|
+
|
|
60
|
+
No API token is required.
|
|
61
|
+
|
|
62
|
+
### Option B — Manual
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
python -m twine upload dist/*
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Use an API token (`__token__` as username) when prompted, or set `TWINE_USERNAME`
|
|
69
|
+
and `TWINE_PASSWORD` (or a `~/.pypirc`) beforehand.
|
|
70
|
+
|
|
71
|
+
## 5. Tag the release
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
git tag v0.1.1
|
|
75
|
+
git push origin v0.1.1
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Checklist
|
|
79
|
+
|
|
80
|
+
- [ ] Version bumped in `pyproject.toml` and `src/hivebr/__init__.py`
|
|
81
|
+
- [ ] `python -m build` succeeds
|
|
82
|
+
- [ ] `python -m twine check dist/*` passes
|
|
83
|
+
- [ ] Wheel imports fine in a clean venv
|
|
84
|
+
- [ ] Docs build (`mkdocs build --strict`)
|
|
85
|
+
- [ ] GitHub release created (triggers the publish workflow)
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
window:
|
|
2
|
+
width: 1400
|
|
3
|
+
height: 750
|
|
4
|
+
min_width: 1100
|
|
5
|
+
min_height: 650
|
|
6
|
+
panel_width: 300
|
|
7
|
+
title: HiveBr Simulator
|
|
8
|
+
world:
|
|
9
|
+
width: 20.0
|
|
10
|
+
height: 12.0
|
|
11
|
+
grid_size: 1.0
|
|
12
|
+
obstacle_radius: 0.4
|
|
13
|
+
show_origin: true
|
|
14
|
+
show_axes: true
|
|
15
|
+
default_obstacle_radius: 0.4
|
|
16
|
+
obstacles:
|
|
17
|
+
- - 6.0
|
|
18
|
+
- 5.0
|
|
19
|
+
- 1.2
|
|
20
|
+
- - 13.163636363636364
|
|
21
|
+
- 5.709090909090909
|
|
22
|
+
- 0.4
|
|
23
|
+
camera:
|
|
24
|
+
initial_zoom: 1.0
|
|
25
|
+
min_zoom: 0.25
|
|
26
|
+
max_zoom: 8.0
|
|
27
|
+
zoom_step: 1.1
|
|
28
|
+
margin_x: 1.0
|
|
29
|
+
margin_y: 1.0
|
|
30
|
+
robot:
|
|
31
|
+
type: differential
|
|
32
|
+
initial_pose:
|
|
33
|
+
- 2.0
|
|
34
|
+
- 2.0
|
|
35
|
+
- 0.0
|
|
36
|
+
radius: 0.4473
|
|
37
|
+
length: 0.8
|
|
38
|
+
width: 0.4
|
|
39
|
+
wheel_base: 0.5
|
|
40
|
+
max_speed: 3.0
|
|
41
|
+
max_omega: 4.0
|
|
42
|
+
max_steer: 0.52
|
|
43
|
+
path_max_length: 4000
|
|
44
|
+
lidar:
|
|
45
|
+
enabled: true
|
|
46
|
+
num_rays: 101
|
|
47
|
+
range: 12.0
|
|
48
|
+
fov_deg: 360
|
|
49
|
+
waypoints:
|
|
50
|
+
goal_tolerance: 0.5
|
|
51
|
+
controller:
|
|
52
|
+
enabled: true
|
|
53
|
+
attractive_gain: 1.0
|
|
54
|
+
repulsive_gain: 2.0
|
|
55
|
+
repulsive_radius: 5.0
|
|
56
|
+
max_repulsive_force: 8.0
|
|
57
|
+
force_filter_alpha: 0.35
|
|
58
|
+
command_filter_alpha: 0.4
|
|
59
|
+
obstacle_slowdown_distance: 2.0
|
|
60
|
+
min_obstacle_speed_factor: 0.2
|
|
61
|
+
min_lidar_distance: 0.08
|
|
62
|
+
linear_gain: 0.6
|
|
63
|
+
angular_gain: 0.6
|
|
64
|
+
max_steer_rate: 0.52
|
|
65
|
+
curvature_speed_gain: 2.0
|
|
66
|
+
tangential_gain: 1.5 # k_tang — MOD-3
|
|
67
|
+
stagnation_radius: 0.15 # metros — MOD-1
|
|
68
|
+
local_minima_angle_deg: 90.0 # graus — MOD-1
|
|
69
|
+
virtual_subgoal_offset: 2.0 # metros — MOD-2
|
|
70
|
+
emergency_brake_distance: 0.5 # metros — aciona BRAKE
|
|
71
|
+
emergency_safe_distance: 0.65 # metros — cancela BRAKE se obstáculo recua
|
|
72
|
+
emergency_rear_clearance: 0.50 # metros — interrompe ré se obstáculo atrás
|
|
73
|
+
reverse_speed: -0.25 # m/s — velocidade da ré (negativo)
|
|
74
|
+
reverse_duration_s: 1.2 # segundos — duração máxima da ré
|
|
75
|
+
colors:
|
|
76
|
+
background:
|
|
77
|
+
- 30
|
|
78
|
+
- 30
|
|
79
|
+
- 30
|
|
80
|
+
grid:
|
|
81
|
+
- 50
|
|
82
|
+
- 50
|
|
83
|
+
- 50
|
|
84
|
+
panel:
|
|
85
|
+
- 20
|
|
86
|
+
- 20
|
|
87
|
+
- 20
|
|
88
|
+
robot:
|
|
89
|
+
- 220
|
|
90
|
+
- 50
|
|
91
|
+
- 50
|
|
92
|
+
obstacle:
|
|
93
|
+
- 50
|
|
94
|
+
- 100
|
|
95
|
+
- 255
|
|
96
|
+
waypoint:
|
|
97
|
+
- 255
|
|
98
|
+
- 220
|
|
99
|
+
- 0
|
|
100
|
+
goal:
|
|
101
|
+
- 0
|
|
102
|
+
- 255
|
|
103
|
+
- 0
|
|
104
|
+
path:
|
|
105
|
+
- 255
|
|
106
|
+
- 140
|
|
107
|
+
- 0
|
|
108
|
+
lidar:
|
|
109
|
+
- 0
|
|
110
|
+
- 255
|
|
111
|
+
- 255
|
|
112
|
+
red:
|
|
113
|
+
- 220
|
|
114
|
+
- 50
|
|
115
|
+
- 50
|
|
116
|
+
green:
|
|
117
|
+
- 0
|
|
118
|
+
- 255
|
|
119
|
+
- 0
|
|
120
|
+
white:
|
|
121
|
+
- 255
|
|
122
|
+
- 255
|
|
123
|
+
- 255
|
|
124
|
+
black:
|
|
125
|
+
- 0
|
|
126
|
+
- 0
|
|
127
|
+
- 0
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
window:
|
|
2
|
+
width: 1400
|
|
3
|
+
height: 750
|
|
4
|
+
min_width: 1100
|
|
5
|
+
min_height: 650
|
|
6
|
+
panel_width: 300
|
|
7
|
+
title: HiveBr Simulator
|
|
8
|
+
world:
|
|
9
|
+
width: 20.0
|
|
10
|
+
height: 12.0
|
|
11
|
+
grid_size: 1.0
|
|
12
|
+
obstacle_radius: 0.4
|
|
13
|
+
show_origin: true
|
|
14
|
+
show_axes: true
|
|
15
|
+
default_obstacle_radius: 0.4
|
|
16
|
+
obstacles:
|
|
17
|
+
- - 6.381818181818182
|
|
18
|
+
- 5.3090909090909095
|
|
19
|
+
- 0.4
|
|
20
|
+
resolution: 0.1
|
|
21
|
+
camera:
|
|
22
|
+
initial_zoom: 1.0
|
|
23
|
+
min_zoom: 0.25
|
|
24
|
+
max_zoom: 8.0
|
|
25
|
+
zoom_step: 1.1
|
|
26
|
+
margin_x: 1.0
|
|
27
|
+
margin_y: 1.0
|
|
28
|
+
robot:
|
|
29
|
+
type: differential
|
|
30
|
+
initial_pose:
|
|
31
|
+
- 2.5
|
|
32
|
+
- 2.5
|
|
33
|
+
- 0.0
|
|
34
|
+
radius: 0.1375
|
|
35
|
+
length: 0.39
|
|
36
|
+
width: 0.275
|
|
37
|
+
wheel_base: 0.285
|
|
38
|
+
max_speed: 3.0
|
|
39
|
+
max_omega: 4.0
|
|
40
|
+
max_steer: 0.52
|
|
41
|
+
tau_v: 0.2
|
|
42
|
+
path_max_length: 4000
|
|
43
|
+
lidar:
|
|
44
|
+
enabled: false
|
|
45
|
+
num_rays: 101
|
|
46
|
+
range: 12.0
|
|
47
|
+
fov_deg: 360
|
|
48
|
+
waypoints:
|
|
49
|
+
goal_tolerance: 0.5
|
|
50
|
+
define_orientation: true
|
|
51
|
+
show_tolerance_circle: false
|
|
52
|
+
points: []
|
|
53
|
+
controller:
|
|
54
|
+
enabled: true
|
|
55
|
+
attractive_gain: 1.0
|
|
56
|
+
repulsive_gain: 2.0
|
|
57
|
+
repulsive_radius: 2.0
|
|
58
|
+
max_repulsive_force: 8.0
|
|
59
|
+
force_filter_alpha: 0.35
|
|
60
|
+
command_filter_alpha: 0.4
|
|
61
|
+
obstacle_slowdown_distance: 2.0
|
|
62
|
+
min_obstacle_speed_factor: 0.2
|
|
63
|
+
min_lidar_distance: 0.08
|
|
64
|
+
linear_gain: 0.6
|
|
65
|
+
angular_gain: 0.6
|
|
66
|
+
max_steer_rate: 0.52
|
|
67
|
+
curvature_speed_gain: 2.0
|
|
68
|
+
tangential_gain: 1.5
|
|
69
|
+
stagnation_radius: 0.15
|
|
70
|
+
local_minima_angle_deg: 90.0
|
|
71
|
+
virtual_subgoal_offset: 2.0
|
|
72
|
+
emergency_brake_distance: 0.5
|
|
73
|
+
emergency_safe_distance: 0.65
|
|
74
|
+
emergency_rear_clearance: 0.5
|
|
75
|
+
reverse_speed: -0.25
|
|
76
|
+
reverse_duration_s: 1.2
|
|
77
|
+
colors:
|
|
78
|
+
background:
|
|
79
|
+
- 240
|
|
80
|
+
- 240
|
|
81
|
+
- 240
|
|
82
|
+
grid:
|
|
83
|
+
- 220
|
|
84
|
+
- 220
|
|
85
|
+
- 220
|
|
86
|
+
panel:
|
|
87
|
+
- 20
|
|
88
|
+
- 20
|
|
89
|
+
- 20
|
|
90
|
+
robot:
|
|
91
|
+
- 30
|
|
92
|
+
- 144
|
|
93
|
+
- 255
|
|
94
|
+
obstacle:
|
|
95
|
+
- 0
|
|
96
|
+
- 100
|
|
97
|
+
- 0
|
|
98
|
+
waypoint:
|
|
99
|
+
- 180
|
|
100
|
+
- 150
|
|
101
|
+
- 0
|
|
102
|
+
goal:
|
|
103
|
+
- 140
|
|
104
|
+
- 0
|
|
105
|
+
- 255
|
|
106
|
+
path:
|
|
107
|
+
- 30
|
|
108
|
+
- 144
|
|
109
|
+
- 255
|
|
110
|
+
lidar:
|
|
111
|
+
- 0
|
|
112
|
+
- 150
|
|
113
|
+
- 150
|
|
114
|
+
red:
|
|
115
|
+
- 200
|
|
116
|
+
- 0
|
|
117
|
+
- 0
|
|
118
|
+
green:
|
|
119
|
+
- 0
|
|
120
|
+
- 150
|
|
121
|
+
- 0
|
|
122
|
+
white:
|
|
123
|
+
- 0
|
|
124
|
+
- 0
|
|
125
|
+
- 0
|
|
126
|
+
black:
|
|
127
|
+
- 255
|
|
128
|
+
- 255
|
|
129
|
+
- 255
|
|
130
|
+
silver:
|
|
131
|
+
- 192
|
|
132
|
+
- 192
|
|
133
|
+
- 186
|
|
134
|
+
occupancy_inflated:
|
|
135
|
+
- 50
|
|
136
|
+
- 129
|
|
137
|
+
- 75
|
|
138
|
+
occupancy_raw:
|
|
139
|
+
- 40
|
|
140
|
+
- 120
|
|
141
|
+
- 40
|
|
142
|
+
occupancy_free:
|
|
143
|
+
- 230
|
|
144
|
+
- 230
|
|
145
|
+
- 230
|
|
146
|
+
obstacles: []
|
|
147
|
+
theme: light
|
|
Binary file
|
|
Binary file
|