Skip to content

evalio.types

Duration

Duration class for representing a positive or negative delta time, uses int64 as the underlying data storage for nanoseconds.

nsec property

nsec: int

Underlying nanoseconds representation

__add__

__add__(arg: Duration) -> Duration

Add two Durations

__eq__

__eq__(arg: Duration) -> bool

Check for equality

__gt__

__gt__(arg: Duration) -> bool

Compare two Durations

__lt__

__lt__(arg: Duration) -> bool

Compare two Durations

__ne__

__ne__(arg: Duration) -> bool

Check for inequality

__sub__

__sub__(arg: Duration) -> Duration

Compute the difference between two Durations

from_nsec staticmethod

from_nsec(nsec: int) -> Duration

Create a Duration from nanoseconds

from_sec staticmethod

from_sec(sec: float) -> Duration

Create a Duration from seconds

to_nsec

to_nsec() -> int

Convert to nanoseconds

to_sec

to_sec() -> float

Convert to seconds

ImuMeasurement

ImuMeasurement is a simple structure for storing an IMU measurement.

accel property

accel: ArrayLike

Accelerometer measurement as a 3D vector.

gyro property

gyro: ArrayLike

Gyroscope measurement as a 3D vector.

stamp property

stamp: Stamp

Timestamp of the IMU measurement.

__eq__

__eq__(arg: ImuMeasurement) -> bool

Check for equality

__ne__

__ne__(arg: ImuMeasurement) -> bool

Check for inequality

ImuParams

ImuParams is a structure for storing the parameters of an IMU

accel property

accel: float

Accelerometer standard deviation, in m/s^2/sqrt(Hz).

accel_bias property

accel_bias: float

Accelerometer bias standard deviation, in m/s^3/sqrt(Hz).

bias_init property

bias_init: float

Initial bias standard deviation.

brand property

brand: str

Brand of the IMU sensor.

gravity property

gravity: ArrayLike

Gravity vector as a 3D vector.

gyro property

gyro: float

Gyroscope standard deviation, in rad/s/sqrt(Hz).

gyro_bias property

gyro_bias: float

Gyroscope bias standard deviation, in rad/s^2/sqrt(Hz).

integration property

integration: float

Integration standard deviation.

model property

model: str

Model of the IMU sensor.

down staticmethod

down() -> ImuParams

Simple helper for initializing with a down gravity vector.

up staticmethod

up() -> ImuParams

Simple helper for initializing with an up gravity vector.

LidarMeasurement

LidarMeasurement is a structure for storing a point cloud measurement, with a timestamp and a vector of points. Note, the stamp always represents the start of the scan. Additionally, the points are always in row major format.

points property writable

points: list[Point]

List of points in the point cloud. Note, this is always in row major format.

stamp property writable

stamp: Stamp

Timestamp of the point cloud, always at the start of the scan.

__eq__

__eq__(arg: LidarMeasurement) -> bool

Check for equality

__ne__

__ne__(arg: LidarMeasurement) -> bool

Check for inequality

to_vec_positions

to_vec_positions() -> list[ArrayLike]

Convert the point cloud to a (n,3) numpy array.

to_vec_stamps

to_vec_stamps() -> list[float]

Convert the point stamps to a list of durations.

LidarParams

LidarParams is a structure for storing the parameters of a lidar sensor.

brand property

brand: str

Brand of the lidar sensor.

max_range property

max_range: float

Maximum range of the lidar sensor, in meters.

min_range property

min_range: float

Minimum range of the lidar sensor, in meters.

model property

model: str

Model of the lidar sensor.

num_columns property

num_columns: int

Number of columns in the point cloud, also known as the number of points per scanline.

num_rows property

num_rows: int

Number of rows in the point cloud, also known as the scanlines.

rate property

rate: float

Rate of the lidar sensor, in Hz.

delta_time

delta_time() -> Duration

Get the time between two consecutive scans as a Duration. Inverse of the rate.

Point

Point is a general point structure in evalio, with common point cloud attributes included.

col property writable

col: int

Column index of the point in the point cloud.

intensity property writable

intensity: float

Intensity value as a float.

range property writable

range: int

Range value as a uint32.

row property writable

row: int

Row index of the point in the point cloud. Also known as the scanline index.

t property writable

Timestamp of the point as a Duration. In evalio, this is always relative to the point cloud stamp, which occurs at the start of the scan.

x property writable

x: float

X coordinate

y property writable

y: float

Y coordinate

z property writable

z: float

Z coordinate

__eq__

__eq__(arg: Point) -> bool

Check for equality

__init__

__init__(
    *,
    x: float = 0,
    y: float = 0,
    z: float = 0,
    intensity: float = 0,
    t: Duration = ...,
    range: int = 0,
    row: int = 0,
    col: int = 0,
) -> None

Create a Point from x, y, z, intensity, t, range, row, col

__ne__

__ne__(arg: Point) -> bool

Check for inequality

SE3

SE3 class for representing a 3D rigid body transformation using a quaternion and a translation vector. This is outfitted with some basic functionality, but mostly intended for storage and converting between types.

rot property

rot: SO3

Rotation as a SO3 object.

trans property

trans: ArrayLike

Translation as a 3D vector.

__eq__

__eq__(arg: SE3) -> bool

Check for equality

__init__

__init__(rot: SO3, trans: ArrayLike) -> None

Create a SE3 from a rotation and translation.

__mul__

__mul__(arg: SE3) -> SE3

Compose two rigid body transformations.

__ne__

__ne__(arg: SE3) -> bool

Check for inequality

fromMat staticmethod

fromMat(mat: ArrayLike) -> SE3

Create a SE3 from a 4x4 transformation matrix.

identity staticmethod

identity() -> SE3

Create an identity SE3.

inverse

inverse() -> SE3

Compute the inverse.

toMat

toMat() -> ArrayLike

Convert to a 4x4 matrix.

SO3

SO3 class for representing a 3D rotation using a quaternion. This is outfitted with some basic functionality, but mostly intended for storage and converting between types.

qw property

qw: float

Scalar component of the quaternion.

qx property

qx: float

X component of the quaternion.

qy property

qy: float

Y component of the quaternion.

qz property

qz: float

Z component of the quaternion.

__eq__

__eq__(arg: SO3) -> bool

Check for equality

__mul__

__mul__(arg: SO3) -> SO3

Compose two rotations.

__ne__

__ne__(arg: SO3) -> bool

Check for inequality

exp staticmethod

exp(v: ArrayLike) -> SO3

Create a rotation from a 3D vector.

fromMat staticmethod

fromMat(mat: ArrayLike) -> SO3

Create a rotation from a 3x3 rotation matrix.

identity staticmethod

identity() -> SO3

Create an identity rotation.

inverse

inverse() -> SO3

Compute the inverse of the rotation.

log

log() -> ArrayLike

Compute the logarithm of the rotation.

rotate

rotate(v: ArrayLike) -> ArrayLike

Rotate a 3D vector by the rotation.

toMat

toMat() -> ArrayLike

Convert the rotation to a 3x3 matrix.

Stamp

Stamp class for representing an absolute point in time, uses uint32 as the underlying data storage for seconds and nanoseconds.

nsec property

nsec: int

Underlying nanoseconds storage

sec property

sec: int

Underlying seconds storage

__add__

__add__(arg: Duration) -> Stamp

Add a Duration to a Stamp

__eq__

__eq__(arg: Stamp) -> bool

Check for equality

__gt__

__gt__(arg: Stamp) -> bool

Compare two Stamps to see which happened first

__init__

__init__(*, sec: int, nsec: int) -> None

Create a Stamp from seconds and nanoseconds

__lt__

__lt__(arg: Stamp) -> bool

Compare two Stamps to see which happened first

__ne__

__ne__(arg: Stamp) -> bool

Check for equality

from_nsec staticmethod

from_nsec(nsec: int) -> Stamp

Create a Stamp from nanoseconds

from_sec staticmethod

from_sec(sec: float) -> Stamp

Create a Stamp from seconds

to_nsec

to_nsec() -> int

Convert to nanoseconds

to_sec

to_sec() -> float

Convert to seconds

Trajectory dataclass

metadata class-attribute instance-attribute

metadata: dict = field(default_factory=dict)

Metadata associated with the trajectory, such as the dataset name or other information.

poses instance-attribute

poses: list[SE3]

List of poses, in the same order as the timestamps.

stamps instance-attribute

stamps: list[Stamp]

List of timestamps for each pose.

from_csv staticmethod

from_csv(
    path: Path,
    fieldnames: list[str],
    delimiter=",",
    skip_lines: Optional[int] = None,
) -> Trajectory

Flexible loader for stamped poses stored in csv files.

Will automatically skip any lines that start with a #. Is most useful for loading ground truth data.

from evalio.types import Trajectory

fieldnames = ["sec", "nsec", "x", "y", "z", "qx", "qy", "qz", "qw"]
trajectory = Trajectory.from_csv(path, fieldnames)

Parameters:

  • path (Path) –

    Location of file.

  • fieldnames (list[str]) –

    List of field names to use, in their expected order. See above for an example.

  • delimiter (str, default: ',' ) –

    Delimiter between elements. Defaults to ",".

  • skip_lines (int, default: None ) –

    Number of lines to skip, useful for skipping headers. Defaults to 0.

Returns:

from_experiment staticmethod

from_experiment(path: Path) -> Trajectory

Load a saved experiment trajectory from file.

Works identically to from_tum, but also loads metadata from the file.

Parameters:

  • path (Path) –

    Location of trajectory results.

Returns:

  • Trajectory ( Trajectory ) –

    Loaded trajectory with metadata, stamps, and poses.

from_tum staticmethod

from_tum(path: Path) -> Trajectory

Load a TUM dataset pose file. Simple wrapper around from_csv.

Parameters:

  • path (Path) –

    Location of file.

Returns: