deep-learning-robotics 0.0.1__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.
@@ -0,0 +1,210 @@
1
+ Metadata-Version: 2.4
2
+ Name: deep-learning-robotics
3
+ Version: 0.0.1
4
+ Summary: Fast 2D robotics and MAPF environments for deep-learning-core.
5
+ Project-URL: Homepage, https://github.com/Blazkowiz47/dl-robotics
6
+ Project-URL: Repository, https://github.com/Blazkowiz47/dl-robotics
7
+ Project-URL: Issues, https://github.com/Blazkowiz47/dl-robotics/issues
8
+ Author-email: blazkowiz47 <sushrutpatwardhan@gmail.com>
9
+ License: MIT License
10
+
11
+ Copyright (c) 2026 blazkowiz47
12
+
13
+ Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ of this software and associated documentation files (the "Software"), to deal
15
+ in the Software without restriction, including without limitation the rights
16
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
+ copies of the Software, and to permit persons to whom the Software is
18
+ furnished to do so, subject to the following conditions:
19
+
20
+ The above copyright notice and this permission notice shall be included in all
21
+ copies or substantial portions of the Software.
22
+
23
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29
+ SOFTWARE.
30
+
31
+ License-File: LICENSE
32
+ Keywords: deep-reinforcement-learning,mapf,path-finding,robotics
33
+ Classifier: Development Status :: 3 - Alpha
34
+ Classifier: Intended Audience :: Science/Research
35
+ Classifier: License :: OSI Approved :: MIT License
36
+ Classifier: Programming Language :: Python :: 3
37
+ Classifier: Programming Language :: Python :: 3.10
38
+ Classifier: Programming Language :: Python :: 3.11
39
+ Classifier: Programming Language :: Python :: 3.12
40
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
41
+ Classifier: Typing :: Typed
42
+ Requires-Python: >=3.10
43
+ Requires-Dist: deep-learning-core<0.1,>=0.0.27
44
+ Requires-Dist: gymnasium<2,>=1.3
45
+ Requires-Dist: imageio-ffmpeg>=0.5
46
+ Requires-Dist: imageio>=2.34
47
+ Requires-Dist: numpy
48
+ Requires-Dist: opencv-python-headless
49
+ Provides-Extra: dev
50
+ Requires-Dist: pytest>=8.0; extra == 'dev'
51
+ Requires-Dist: ruff>=0.12; extra == 'dev'
52
+ Requires-Dist: twine>=6.0; extra == 'dev'
53
+ Description-Content-Type: text/markdown
54
+
55
+ # deep-learning-robotics
56
+
57
+ Fast, reproducible 2D robotics environments for
58
+ [`deep-learning-core`](https://github.com/Blazkowiz47/dl-core).
59
+
60
+ ## Install
61
+
62
+ ```bash
63
+ pip install deep-learning-robotics
64
+ ```
65
+
66
+ Version `0.0.1` requires `deep-learning-core>=0.0.27,<0.1`.
67
+
68
+ ## What's New in 0.0.1?
69
+
70
+ - validated grid scenarios with walls, actor starts, and per-actor goals
71
+ - preallocated batched world state for position, velocity, acceleration,
72
+ reached goals, path length, makespan, and sum of costs
73
+ - simultaneous exclusive-cell physics covering boundaries, walls, vertex
74
+ conflicts, edge swaps, and moves into stationary actors
75
+ - scalar and native vector Gymnasium environments registered as
76
+ `robotics_mapf` and `robotics_mapf_vector`
77
+ - centralized joint actions compatible with dl-core DQN and PPO
78
+ - semantic channel observations containing walls, actors, goals, velocity, and
79
+ acceleration
80
+ - headless RGB rendering plus direct GIF and MP4 episode output
81
+ - exact A*, Dijkstra, and BFS utilities for static single-agent shortest paths,
82
+ plus deterministic DFS for reachability and debugging
83
+ - a `robotics` episode manager for collision, completion, makespan,
84
+ sum-of-costs, path-length, trajectory, and media artifacts
85
+
86
+ ## Environment Configuration
87
+
88
+ Import `dl_robotics` once to register its environments, then use normal
89
+ dl-core configuration:
90
+
91
+ ```yaml
92
+ environment:
93
+ name: robotics_mapf_vector
94
+ num_envs: 16
95
+ scenario:
96
+ name: crossing
97
+ width: 7
98
+ height: 7
99
+ max_steps: 40
100
+ walls: [[3, 1], [3, 5]]
101
+ starts: [[1, 1], [5, 5]]
102
+ goals: [[5, 5], [1, 1]]
103
+ rewards:
104
+ step: -0.01
105
+ progress: 0.1
106
+ collision: -0.25
107
+ goal: 1.0
108
+ success: 5.0
109
+ render:
110
+ cell_size: 48
111
+ show_grid: true
112
+
113
+ episode_managers:
114
+ robotics:
115
+ capture_phases: [evaluation]
116
+ capture_every_n_episodes: 1
117
+ max_captured_episodes: 20
118
+ media_format: both
119
+ fps: 8
120
+ ```
121
+
122
+ Each actor chooses one of `stay`, `up`, `right`, `down`, or `left`. The
123
+ centralized environment encodes all actor choices into one
124
+ `Discrete(5 ** num_agents)` joint action, with actor zero stored in the least
125
+ significant base-5 digit. This is intentionally aimed at small cooperative
126
+ MAPF problems; larger or decentralized systems should use a future multi-agent
127
+ policy API instead of an exponentially growing joint action.
128
+
129
+ The image observation is suitable for DQN and PPO. dl-core's tabular
130
+ Q-learning trainer requires a `Discrete` observation space, so it is not
131
+ compatible with this first image-observation environment.
132
+
133
+ The observation is a float32 tensor with shape `[7, height, width]`: walls,
134
+ actor identity, goal identity, row/column velocity, and row/column acceleration.
135
+ Episode info exposes `is_success`, collision counts, reached agents, makespan,
136
+ sum of costs, and total path length for episode managers and experiment
137
+ tracking. `collisions` and its typed variants describe the latest step;
138
+ `episode_collisions` and its typed variants retain the episode totals.
139
+
140
+ ## Rendering and Episode Artifacts
141
+
142
+ `environment.render()` returns RGB `uint8` arrays without opening a display:
143
+ `[height, width, 3]` for the scalar environment and
144
+ `[num_envs, height, width, 3]` for the vector environment.
145
+
146
+ The `robotics` episode manager includes dl-core's standard episode metrics and
147
+ trajectory capture, so it should be used in place of the `standard` manager.
148
+ For selected phases and episode intervals it stores the complete compressed
149
+ trajectory and optionally a GIF, MP4, or both. It also emits
150
+ `robotics/collisions`, typed collision counts, reached fraction, makespan,
151
+ sum of costs, and path length through normal callback and tracker flows.
152
+
153
+ Media files can also be created directly:
154
+
155
+ ```python
156
+ from dl_robotics import write_animation
157
+
158
+ write_animation("episode.gif", frames, fps=8)
159
+ write_animation("episode.mp4", frames, fps=8)
160
+ ```
161
+
162
+ ## Interaction Rules
163
+
164
+ `GridWorldBatch` owns numerical state, while `InteractionRule` owns how proposed
165
+ movements interact. `ExclusiveCellRule` provides MAPF-safe defaults. A custom
166
+ rule instance can be supplied as `environment.interaction_rule` when an
167
+ environment is created programmatically, without changing scenario definitions
168
+ or RL adapters. Serializable rule registries are planned for a later release.
169
+
170
+ The first version uses vectorized geometry and preallocated state arrays, with
171
+ small per-world conflict-resolution loops where agent dependencies require
172
+ them. It does not model continuous rigid-body dynamics, ROS, Gazebo, or 3D
173
+ simulation.
174
+
175
+ ## Shortest-Path Baselines
176
+
177
+ Use A* for efficient exact planning on the unit-cost grid, or Dijkstra when a
178
+ heuristic-free reference is useful:
179
+
180
+ ```python
181
+ from dl_robotics import (
182
+ GridScenario,
183
+ astar_path,
184
+ bfs_path,
185
+ dfs_path,
186
+ dijkstra_path,
187
+ )
188
+
189
+ scenario = GridScenario(
190
+ width=5,
191
+ height=5,
192
+ starts=((0, 0), (4, 4)),
193
+ goals=((4, 4), (0, 0)),
194
+ walls=((1, 2), (3, 2)),
195
+ )
196
+
197
+ astar = astar_path(scenario, scenario.starts[0], scenario.goals[0])
198
+ dijkstra = dijkstra_path(scenario, scenario.starts[1], scenario.goals[1])
199
+ bfs = bfs_path(scenario, scenario.starts[0], scenario.goals[0])
200
+ dfs = dfs_path(scenario, scenario.starts[1], scenario.goals[1])
201
+ ```
202
+
203
+ Paths include both endpoints and use four-direction movement around static
204
+ walls. Their move count is therefore `len(path) - 1`. A*, Dijkstra, and BFS
205
+ return shortest paths on this unweighted grid. DFS returns the first
206
+ depth-first route and does not guarantee optimality. Traversal ties use the
207
+ fixed up, right, down, left order. The exact planners provide per-agent lower
208
+ bounds and deterministic evaluation baselines; independently planned paths can
209
+ still have vertex or edge conflicts and are not, by themselves, a multi-agent
210
+ path-finding solver.
@@ -0,0 +1,12 @@
1
+ dl_robotics/__init__.py,sha256=sd0gA7c3Wdu6KJm67SjJXKRWv1hbuUloRhI7XCF0HTk,921
2
+ dl_robotics/environment.py,sha256=8A9Y851yHQUf0KAkW5haVpvHv4BQiDP1KQ-mu-dffYs,15931
3
+ dl_robotics/episode_manager.py,sha256=UmcTr7fXerwVWZn6MhajA2peJ0KhgX7y7NEx36SbVxI,5410
4
+ dl_robotics/planning.py,sha256=qMIIe2BXCwdpkT4L194OIoS0lAcSIFVUyWE4PLjtBV0,7205
5
+ dl_robotics/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
6
+ dl_robotics/rendering.py,sha256=po55qfUE6XLIejIe-ty3okfgb5fdJGPAupMw--kHL44,8366
7
+ dl_robotics/scenario.py,sha256=iaImWxMu4-KoCf9PWuIkj0kvUelm5kqERpALWNCK9-M,5694
8
+ dl_robotics/world.py,sha256=mSXHwW0sA28hJeZSObj8jQDDejeL0YmaO41qOOlRXX4,12736
9
+ deep_learning_robotics-0.0.1.dist-info/METADATA,sha256=d4RVjyh4O7DPhpFybrCs1jXgfcXph_EiS87WkL775Z8,8289
10
+ deep_learning_robotics-0.0.1.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
11
+ deep_learning_robotics-0.0.1.dist-info/licenses/LICENSE,sha256=f-Pa3PzxMhIId4zEb_aOWHbL2bBV__jf67OWdRDh0t0,1069
12
+ deep_learning_robotics-0.0.1.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.31.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 blazkowiz47
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.
22
+
@@ -0,0 +1,38 @@
1
+ """Fast 2D robotics environments for deep-learning-core."""
2
+
3
+ from .environment import GridMAPFEnvironment, GridMAPFVectorEnvironment
4
+ from .episode_manager import RoboticsEpisodeManager
5
+ from .planning import (
6
+ GridPath,
7
+ PathNotFoundError,
8
+ astar_path,
9
+ bfs_path,
10
+ dfs_path,
11
+ dijkstra_path,
12
+ )
13
+ from .rendering import GridRenderer, write_animation
14
+ from .scenario import Coordinate, GridScenario
15
+ from .world import ExclusiveCellRule, GridWorldBatch, InteractionRule, StepEvents
16
+
17
+ __version__ = "0.0.1"
18
+
19
+ __all__ = [
20
+ "Coordinate",
21
+ "ExclusiveCellRule",
22
+ "GridMAPFEnvironment",
23
+ "GridMAPFVectorEnvironment",
24
+ "GridPath",
25
+ "GridRenderer",
26
+ "GridScenario",
27
+ "GridWorldBatch",
28
+ "InteractionRule",
29
+ "PathNotFoundError",
30
+ "RoboticsEpisodeManager",
31
+ "StepEvents",
32
+ "__version__",
33
+ "astar_path",
34
+ "bfs_path",
35
+ "dfs_path",
36
+ "dijkstra_path",
37
+ "write_animation",
38
+ ]