ribcage 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.
Potentially problematic release.
This version of ribcage might be problematic. Click here for more details.
ribcage/__init__.py
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"""Ribcage robotics framework."""
|
|
2
|
+
|
|
3
|
+
import math
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@dataclass(frozen=True)
|
|
8
|
+
class Pose2:
|
|
9
|
+
"""SE(2) pose: position (x, y) in metres, heading theta in radians."""
|
|
10
|
+
|
|
11
|
+
x: float = 0.0
|
|
12
|
+
y: float = 0.0
|
|
13
|
+
theta: float = 0.0
|
|
14
|
+
|
|
15
|
+
def __matmul__(self, other: "Pose2") -> "Pose2":
|
|
16
|
+
"""Compose: apply `other` in this pose's frame."""
|
|
17
|
+
c, s = math.cos(self.theta), math.sin(self.theta)
|
|
18
|
+
return Pose2(
|
|
19
|
+
self.x + c * other.x - s * other.y,
|
|
20
|
+
self.y + s * other.x + c * other.y,
|
|
21
|
+
_wrap(self.theta + other.theta),
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
def inverse(self) -> "Pose2":
|
|
25
|
+
c, s = math.cos(self.theta), math.sin(self.theta)
|
|
26
|
+
return Pose2(-c * self.x - s * self.y, s * self.x - c * self.y, _wrap(-self.theta))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def _wrap(a: float) -> float:
|
|
30
|
+
return math.atan2(math.sin(a), math.cos(a))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
if __name__ == "__main__":
|
|
34
|
+
p = Pose2(1.0, 2.0, 0.7)
|
|
35
|
+
i = p @ p.inverse()
|
|
36
|
+
assert abs(i.x) < 1e-12 and abs(i.y) < 1e-12 and abs(i.theta) < 1e-12
|
|
37
|
+
q = Pose2(0, 0, math.pi / 2) @ Pose2(1, 0, 0)
|
|
38
|
+
assert abs(q.x) < 1e-12 and abs(q.y - 1) < 1e-12
|
|
39
|
+
print("ok")
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: ribcage
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Ribcage robotics framework
|
|
5
|
+
Author: Ivan Nikolic
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Python: >=3.9
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
|
|
11
|
+
# ribcage
|
|
12
|
+
|
|
13
|
+
Ribcage robotics framework. Early development.
|
|
14
|
+
|
|
15
|
+
Core types for robot state: an SE(2) pose with composition and inverse.
|
|
16
|
+
|
|
17
|
+
- `python/`: Python package `ribcage` (PyPI)
|
|
18
|
+
- `rust/`: Rust crate `ribcage` (crates.io)
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
ribcage/__init__.py,sha256=UR_ygmxC-Xm-xDijGG-aKLobelepngrfSCN9PLXXA98,1141
|
|
2
|
+
ribcage-0.0.1.dist-info/METADATA,sha256=kPSGFafj3kjfGfohwHh-HpmnzyYEOGLm7_IjC7o_aUo,439
|
|
3
|
+
ribcage-0.0.1.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
4
|
+
ribcage-0.0.1.dist-info/licenses/LICENSE,sha256=MZO7KOmbukEjsiRmCiq7smhLfAGgnezuzsmDKf4Orv0,1069
|
|
5
|
+
ribcage-0.0.1.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ivan Nikolic
|
|
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.
|