Skip to content

pixano.core.pose

Pose(cam_r_m2c, cam_t_m2c)

Bases: PixanoType, BaseModel

Pose type using orientation and translation matrices

Attributes:

Name Type Description
_cam_r_m2c list[float]

3*3 orientation matrix

_cam_t_m2c list[float]

3*1 translation matrix

Parameters:

Name Type Description Default
cam_r_m2c list[float]

3*3 orientation matrix

required
cam_t_m2c list[float]

3*1 translation matrix

required
Source code in pixano/core/pose.py
def __init__(self, cam_r_m2c: list[float], cam_t_m2c: list[float]):
    """Initialize pose from orientation and translation matrices

    Args:
        cam_r_m2c (list[float]): 3*3 orientation matrix
        cam_t_m2c (list[float]): 3*1 translation matrix
    """

    # Define public attributes through Pydantic BaseModel
    super().__init__()

    # Define private attributes manually
    self._cam_r_m2c = cam_r_m2c
    self._cam_t_m2c = cam_t_m2c

cam_r_m2c: list[float] property

Return Pose orientation matrix

Returns:

Type Description
list[float]

3*3 orientation matrix

cam_t_m2c: list[float] property

Return Pose translation matrix

Returns:

Type Description
list[float]

1*3 translation matrix

to_struct() staticmethod

Return Pose type as PyArrow Struct

Returns:

Type Description
StructType

Custom type corresponding PyArrow Struct

Source code in pixano/core/pose.py
@staticmethod
def to_struct() -> pa.StructType:
    """Return Pose type as PyArrow Struct

    Returns:
        pa.StructType: Custom type corresponding PyArrow Struct
    """

    return pa.struct(
        [
            pa.field("cam_r_m2c", pa.list_(pa.float64(), list_size=9)),
            pa.field("cam_t_m2c", pa.list_(pa.float64(), list_size=3)),
        ]
    )