airo-typing 2025.4.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.
@@ -0,0 +1,11 @@
1
+ Metadata-Version: 2.4
2
+ Name: airo_typing
3
+ Version: 2025.4.0
4
+ Summary: Python type definitions for use in the python packages at the Ghent University AI and Robotics Lab
5
+ Author: Thomas Lips
6
+ Author-email: thomas.lips@ugent.be
7
+ Requires-Dist: numpy<2.0
8
+ Dynamic: author
9
+ Dynamic: author-email
10
+ Dynamic: requires-dist
11
+ Dynamic: summary
@@ -0,0 +1,5 @@
1
+ # airo-typing
2
+
3
+ python package with common types that are used across multiple other packages.
4
+
5
+ These types also define some of our conventions such as the use of scalar-last quaternions or metric units.
@@ -0,0 +1,181 @@
1
+ from dataclasses import dataclass
2
+ from typing import Callable, Dict, List, Optional, Tuple, Union
3
+
4
+ import numpy as np
5
+
6
+ # TODO: see if we can specify the shape of these types for mypy
7
+
8
+ #######################
9
+ # spatial algebra types
10
+ #######################
11
+ Vector2DType = np.ndarray
12
+ """a (2,) np array that represents a 2D position/translation/direction"""
13
+
14
+ Vector2DArrayType = np.ndarray
15
+ """a (N,2) np array that represents N 2D positions/translations/directions"""
16
+
17
+ Vectors2DType = Union[Vector2DType, Vector2DArrayType]
18
+ """a convenience type that represents a (2,) 2D vector or (N,2) array of 3D vectors."""
19
+
20
+
21
+ Vector3DType = np.ndarray
22
+ """ a (3,) np array that represents a 3D position/translation/direction
23
+ """
24
+ Vector3DArrayType = np.ndarray
25
+ """ a (N,3) np array that represents N 3D positions/translations/directions
26
+ """
27
+ Vectors3DType = Union[Vector3DType, Vector3DArrayType]
28
+ """ a convenience type that represents a (3,) 3D vector or (N,3) array of 3D vectors.
29
+ """
30
+ QuaternionType = np.ndarray
31
+ """scalar-last quaternion <x,y,z,w> that represents a rotation around the <x,y,z> axis with angle <theta>
32
+ as <x sin(theta), y sin(theta), z sin(theta), cos(theta)>
33
+ """
34
+ RotationMatrixType = np.ndarray
35
+ """3x3 rotation matrix
36
+ """
37
+ EulerAnglesType = np.ndarray
38
+ """XYZ angles of rotation around the axes of the original frame (extrinsic).
39
+ First rotate around X, then around Y, finally around Z.
40
+ """
41
+ AxisAngleType = Tuple[Vector3DType, float]
42
+
43
+ RotationVectorType = np.ndarray
44
+ """ Rotation vector <x*theta,y*theta,z*theta> that represents a rotation around the <x,y,z> axis with angle <theta>
45
+ """
46
+
47
+ HomogeneousMatrixType = np.ndarray
48
+ """4x4 homogeneous transform matrix
49
+ <<R,T>|<0,0,0,1>> that represents the pose of a frame A in another frame B
50
+
51
+ Shorthand notation is T^A_B.
52
+ """
53
+
54
+ # Changing the applied-on frame requires the Adjoint of the transform between the two frames.
55
+ # Changing the expressed-in frame requires multiplication by the rotation matrix of the transform between the two frames.
56
+ # notation is taken from https://manipulation.csail.mit.edu/clutter.html#section3
57
+ WrenchType = np.ndarray
58
+ """ a (6,) numpy array that represents a wrench applied on a frame and expressed in a (possibly different) frame as [Fx,Fy,Fz,Tx,Ty,Tz]
59
+
60
+ shorthand notation is W^F_E, where F is the frame the wrench is applied on, and E is the frame the wrench is expressed in.
61
+ """
62
+
63
+ # Changing the measured-in frame requires the Adjoint of the transform between the two frames.
64
+ # Changing the expressed-in frame requires multiplication by the rotation matrix of the transform between the two frames.
65
+ # Notation is taken from https://manipulation.csail.mit.edu/pick.html#jacobian
66
+ TwistType = np.ndarray
67
+ """ a (6,) numpy array that represents the spatial velocity or an incremental motion of one frame as measured in another frame (and possibly expressed in a third frame)
68
+
69
+ shorthand notation is ^C T^B_A, where C is the frame the velocity is measured in, B is the frame the velocity is expressed in.
70
+ """
71
+
72
+ #####################
73
+ # Manipulator types #
74
+ #####################
75
+
76
+ JointConfigurationType = np.ndarray
77
+ """an (N,) numpy array that represents the joint angles for a robot"""
78
+
79
+ JointPathType = np.ndarray
80
+ """ a (T, N) array of joint states (can be position/velocity/acceleration) that describe a path in joint space"""
81
+
82
+ TimesType = np.ndarray
83
+ """ a (T,) array of monotonically increasing times (float), corresponding to a path"""
84
+
85
+
86
+ @dataclass
87
+ class JointPathContainer:
88
+ positions: Optional[JointPathType] = None
89
+ velocities: Optional[JointPathType] = None
90
+ accelerations: Optional[JointPathType] = None
91
+ efforts: Optional[JointPathType] = None
92
+
93
+
94
+ @dataclass
95
+ class SingleArmTrajectory:
96
+ times: TimesType # time (seconds) from start of trajectory
97
+ path: JointPathContainer
98
+ gripper_path: Optional[JointPathContainer] = None
99
+
100
+
101
+ @dataclass
102
+ class DualArmTrajectory:
103
+ times: TimesType # time (seconds) from start of trajectory
104
+ path_left: JointPathContainer
105
+ path_right: JointPathContainer
106
+ gripper_path_left: Optional[JointPathContainer] = None
107
+ gripper_path_right: Optional[JointPathContainer] = None
108
+
109
+
110
+ PosePathType = np.ndarray
111
+ """ a (T, 4, 4) list of homogeneous matrices that describe a path in cartesian space"""
112
+
113
+
114
+ @dataclass
115
+ class PoseTrajectory:
116
+ times: TimesType
117
+ poses: PosePathType
118
+
119
+
120
+ ForwardKinematicsFunctionType = Callable[[JointConfigurationType], HomogeneousMatrixType]
121
+ """ a function that computes the forward kinematics of a given joint configuration"""
122
+
123
+ InverseKinematicsFunctionType = Callable[[HomogeneousMatrixType], List[JointConfigurationType]]
124
+ """ a function that computes one or more inverse kinematics solutions of a given TCP pose"""
125
+
126
+ JointConfigurationCheckerType = Callable[[JointConfigurationType], bool]
127
+ """ a function that checks a certain condition on a joint configuration, e.g. collision checking"""
128
+
129
+ ######################
130
+ # camera related types
131
+ ######################
132
+
133
+ OpenCVIntImageType = np.ndarray
134
+ """an image in the OpenCV format: BGR, uint8, (H,W,C)"""
135
+
136
+ NumpyFloatImageType = np.ndarray
137
+ """ a float image in the numpy format: RGB, float (0-1), (H,W,C)"""
138
+ NumpyIntImageType = np.ndarray
139
+ """ an int image in the numpy format: RGB, uint8 (0-255), (H,W,C)"""
140
+ TorchFloatImageType = np.ndarray
141
+ """ an image in the torch format: RGB, float(0-1), (C,H,W)"""
142
+
143
+ NumpyDepthMapType = np.ndarray
144
+ """ a depth map (z-buffer),float, (H,W)"""
145
+
146
+ CameraResolutionType = Tuple[int, int]
147
+ """ a tuple of image (width, height) in pixels"""
148
+
149
+ CameraIntrinsicsMatrixType = np.ndarray
150
+ """3x3 camera intrinsics matrix
151
+
152
+ K = [[fx,s,cx],[0,fy,cy],[0,0,1]]
153
+ see e.g. https://ksimek.github.io/2013/08/13/intrinsic/ for more details """
154
+
155
+
156
+ CameraExtrinsicMatrixType = HomogeneousMatrixType
157
+ """4x4 camera extrinsic matrix,
158
+ this is the homogeneous matrix that describes the camera pose in the world frame"""
159
+
160
+ ##########################
161
+ # 3D and point cloud types
162
+ ##########################
163
+
164
+ BoundingBox3DType = Tuple[Tuple[float, float, float], Tuple[float, float, float]]
165
+ """ a tuple of two tuples that represent the min and max corners of a 3D bounding box"""
166
+
167
+ PointCloudPositionsType = Vector3DArrayType
168
+ """ a (N,3) float32 numpy array that represents a point cloud"""
169
+
170
+ PointCloudColorsType = np.ndarray
171
+ """ a (N,3) uint8 numpy array that represents the RGB colors of a point cloud"""
172
+
173
+ PointCloudAttributesType = Dict[str, np.ndarray]
174
+ """ a dictionary of numpy arrays that represent additional attributes of a point cloud, e.g. normals, confidence, etc. """
175
+
176
+
177
+ @dataclass
178
+ class PointCloud:
179
+ points: PointCloudPositionsType
180
+ colors: Optional[PointCloudColorsType] = None
181
+ attributes: Optional[PointCloudAttributesType] = None
File without changes
@@ -0,0 +1,11 @@
1
+ Metadata-Version: 2.4
2
+ Name: airo_typing
3
+ Version: 2025.4.0
4
+ Summary: Python type definitions for use in the python packages at the Ghent University AI and Robotics Lab
5
+ Author: Thomas Lips
6
+ Author-email: thomas.lips@ugent.be
7
+ Requires-Dist: numpy<2.0
8
+ Dynamic: author
9
+ Dynamic: author-email
10
+ Dynamic: requires-dist
11
+ Dynamic: summary
@@ -0,0 +1,10 @@
1
+ README.md
2
+ setup.py
3
+ airo_typing/__init__.py
4
+ airo_typing/py.typed
5
+ airo_typing.egg-info/PKG-INFO
6
+ airo_typing.egg-info/SOURCES.txt
7
+ airo_typing.egg-info/dependency_links.txt
8
+ airo_typing.egg-info/requires.txt
9
+ airo_typing.egg-info/top_level.txt
10
+ test/test_stub.py
@@ -0,0 +1 @@
1
+ numpy<2.0
@@ -0,0 +1 @@
1
+ airo_typing
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,12 @@
1
+ import setuptools
2
+
3
+ setuptools.setup(
4
+ name="airo_typing",
5
+ version="2025.4.0",
6
+ description="Python type definitions for use in the python packages at the Ghent University AI and Robotics Lab",
7
+ author="Thomas Lips",
8
+ author_email="thomas.lips@ugent.be",
9
+ install_requires=["numpy<2.0"],
10
+ packages=setuptools.find_packages(exclude=["test"]),
11
+ package_data={"airo_typing": ["py.typed"]},
12
+ )
@@ -0,0 +1,5 @@
1
+ def test_stub():
2
+ # each package should have at least one test to make the CI pipeline happy
3
+ # pytest returns an error if no tests are found
4
+ # cf https://github.com/pytest-dev/pytest/issues/2393
5
+ assert True