55import shapely .geometry as geom
66
77from py123d .common .utils .mixin import ArrayMixin
8- from py123d .geometry .geometry_index import EulerStateSE3Index , Point3DIndex , PoseSE2Index , PoseSE3Index
8+ from py123d .geometry .geometry_index import EulerPoseSE3Index , Point3DIndex , PoseSE2Index , PoseSE3Index
99from py123d .geometry .point import Point2D , Point3D
1010from py123d .geometry .rotation import EulerAngles , Quaternion
1111
@@ -279,7 +279,7 @@ def transformation_matrix(self) -> npt.NDArray[np.float64]:
279279 return transformation_matrix
280280
281281
282- class EulerStateSE3 (ArrayMixin ):
282+ class EulerPoseSE3 (ArrayMixin ):
283283 """
284284 Class to represents a 3D pose as SE3 (x, y, z, roll, pitch, yaw).
285285
@@ -293,17 +293,17 @@ class EulerStateSE3(ArrayMixin):
293293
294294 def __init__ (self , x : float , y : float , z : float , roll : float , pitch : float , yaw : float ):
295295 """Initialize PoseSE3 with x, y, z, roll, pitch, yaw coordinates."""
296- array = np .zeros (len (EulerStateSE3Index ), dtype = np .float64 )
297- array [EulerStateSE3Index .X ] = x
298- array [EulerStateSE3Index .Y ] = y
299- array [EulerStateSE3Index .Z ] = z
300- array [EulerStateSE3Index .ROLL ] = roll
301- array [EulerStateSE3Index .PITCH ] = pitch
302- array [EulerStateSE3Index .YAW ] = yaw
296+ array = np .zeros (len (EulerPoseSE3Index ), dtype = np .float64 )
297+ array [EulerPoseSE3Index .X ] = x
298+ array [EulerPoseSE3Index .Y ] = y
299+ array [EulerPoseSE3Index .Z ] = z
300+ array [EulerPoseSE3Index .ROLL ] = roll
301+ array [EulerPoseSE3Index .PITCH ] = pitch
302+ array [EulerPoseSE3Index .YAW ] = yaw
303303 object .__setattr__ (self , "_array" , array )
304304
305305 @classmethod
306- def from_array (cls , array : npt .NDArray [np .float64 ], copy : bool = True ) -> EulerStateSE3 :
306+ def from_array (cls , array : npt .NDArray [np .float64 ], copy : bool = True ) -> EulerPoseSE3 :
307307 """Constructs a PoseSE3 from a numpy array.
308308
309309 :param array: Array of shape (6,) representing the state [x, y, z, roll, pitch, yaw], indexed by \
@@ -312,24 +312,24 @@ def from_array(cls, array: npt.NDArray[np.float64], copy: bool = True) -> EulerS
312312 :return: A PoseSE3 instance.
313313 """
314314 assert array .ndim == 1
315- assert array .shape [0 ] == len (EulerStateSE3Index )
315+ assert array .shape [0 ] == len (EulerPoseSE3Index )
316316 instance = object .__new__ (cls )
317317 object .__setattr__ (instance , "_array" , array .copy () if copy else array )
318318 return instance
319319
320320 @classmethod
321- def from_transformation_matrix (cls , transformation_matrix : npt .NDArray [np .float64 ]) -> EulerStateSE3 :
322- """Constructs a EulerStateSE3 from a 4x4 transformation matrix.
321+ def from_transformation_matrix (cls , transformation_matrix : npt .NDArray [np .float64 ]) -> EulerPoseSE3 :
322+ """Constructs a EulerPoseSE3 from a 4x4 transformation matrix.
323323
324324 :param array: A 4x4 numpy array representing the transformation matrix.
325- :return: A EulerStateSE3 instance.
325+ :return: A EulerPoseSE3 instance.
326326 """
327327 assert transformation_matrix .ndim == 2
328328 assert transformation_matrix .shape == (4 , 4 )
329329 translation = transformation_matrix [:3 , 3 ]
330330 rotation = transformation_matrix [:3 , :3 ]
331331 roll , pitch , yaw = EulerAngles .from_rotation_matrix (rotation )
332- return EulerStateSE3 (
332+ return EulerPoseSE3 (
333333 x = translation [Point3DIndex .X ],
334334 y = translation [Point3DIndex .Y ],
335335 z = translation [Point3DIndex .Z ],
@@ -344,47 +344,47 @@ def x(self) -> float:
344344
345345 :return: The x-coordinate.
346346 """
347- return self ._array [EulerStateSE3Index .X ]
347+ return self ._array [EulerPoseSE3Index .X ]
348348
349349 @property
350350 def y (self ) -> float :
351351 """Returns the y-coordinate of the 3D state.
352352
353353 :return: The y-coordinate.
354354 """
355- return self ._array [EulerStateSE3Index .Y ]
355+ return self ._array [EulerPoseSE3Index .Y ]
356356
357357 @property
358358 def z (self ) -> float :
359359 """Returns the z-coordinate of the 3D state.
360360
361361 :return: The z-coordinate.
362362 """
363- return self ._array [EulerStateSE3Index .Z ]
363+ return self ._array [EulerPoseSE3Index .Z ]
364364
365365 @property
366366 def roll (self ) -> float :
367367 """Returns the roll (x-axis rotation) of the 3D state.
368368
369369 :return: The roll angle.
370370 """
371- return self ._array [EulerStateSE3Index .ROLL ]
371+ return self ._array [EulerPoseSE3Index .ROLL ]
372372
373373 @property
374374 def pitch (self ) -> float :
375375 """Returns the pitch (y-axis rotation) of the 3D state.
376376
377377 :return: The pitch angle.
378378 """
379- return self ._array [EulerStateSE3Index .PITCH ]
379+ return self ._array [EulerPoseSE3Index .PITCH ]
380380
381381 @property
382382 def yaw (self ) -> float :
383383 """Returns the yaw (z-axis rotation) of the 3D state.
384384
385385 :return: The yaw angle.
386386 """
387- return self ._array [EulerStateSE3Index .YAW ]
387+ return self ._array [EulerPoseSE3Index .YAW ]
388388
389389 @property
390390 def array (self ) -> npt .NDArray [np .float64 ]:
@@ -444,20 +444,32 @@ def transformation_matrix(self) -> npt.NDArray[np.float64]:
444444 rotation_matrix = self .rotation_matrix
445445 transformation_matrix = np .eye (4 , dtype = np .float64 )
446446 transformation_matrix [:3 , :3 ] = rotation_matrix
447- transformation_matrix [:3 , 3 ] = self .array [EulerStateSE3Index .XYZ ]
447+ transformation_matrix [:3 , 3 ] = self .array [EulerPoseSE3Index .XYZ ]
448448 return transformation_matrix
449449
450450 @property
451451 def euler_angles (self ) -> EulerAngles :
452- return EulerAngles .from_array (self .array [EulerStateSE3Index .EULER_ANGLES ])
452+ """Returns the :class:`~py123d.geometry.EulerAngles` representation of the state's orientation.
453+
454+ :return: An EulerAngles instance representing the state's orientation.
455+ """
456+ return EulerAngles .from_array (self .array [EulerPoseSE3Index .EULER_ANGLES ])
453457
454458 @property
455459 def pose_se3 (self ) -> PoseSE3 :
460+ """Returns the :class:`~py123d.geometry.PoseSE3` representation of the state.
461+
462+ :return: A PoseSE3 instance representing the state.
463+ """
456464 quaternion_se3_array = np .zeros (len (PoseSE3Index ), dtype = np .float64 )
457- quaternion_se3_array [PoseSE3Index .XYZ ] = self .array [EulerStateSE3Index .XYZ ]
465+ quaternion_se3_array [PoseSE3Index .XYZ ] = self .array [EulerPoseSE3Index .XYZ ]
458466 quaternion_se3_array [PoseSE3Index .QUATERNION ] = Quaternion .from_euler_angles (self .euler_angles )
459467 return PoseSE3 .from_array (quaternion_se3_array , copy = False )
460468
461469 @property
462470 def quaternion (self ) -> Quaternion :
471+ """Returns the :class:`~py123d.geometry.Quaternion` representation of the state's orientation.
472+
473+ :return: A Quaternion instance representing the state's orientation.
474+ """
463475 return Quaternion .from_euler_angles (self .euler_angles )
0 commit comments