Skip to content

Commit

Permalink
feat: update ego pose table (#39)
Browse files Browse the repository at this point in the history
Signed-off-by: ktro2828 <[email protected]>
  • Loading branch information
ktro2828 authored Nov 16, 2024
1 parent c070c73 commit 3fadf9b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
24 changes: 23 additions & 1 deletion t4_devkit/schema/tables/ego_pose.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@
from .registry import SCHEMAS

if TYPE_CHECKING:
from t4_devkit.typing import RotationType, TranslationType
from t4_devkit.typing import (
AccelerationType,
GeoCoordinateType,
RotationType,
TranslationType,
TwistType,
)

__all__ = ["EgoPose"]

Expand All @@ -27,8 +33,24 @@ class EgoPose(SchemaBase):
translation (TranslationType): Coordinate system origin given as [x, y, z] in [m].
rotation (RotationType): Coordinate system orientation given as quaternion [w, x, y, z].
timestamp (int): Unix time stamp.
twist (TwistType | None): Linear and angular velocities in the local coordinate system of
the ego vehicle (in m/s for linear and rad/s for angular), in the order of
(vx, vy, vz, yaw_rate, pitch_rate, roll_rate).
acceleration (AccelerationType | None): Acceleration in the local coordinate system of
the ego vehicle (in m/s2), in the order of (ax, ay, az).
geocoordinate (GeoCoordinateType | None): Coordinates in the WGS 84 reference ellipsoid
(latitude, longitude, altitude) in degrees and meters.
"""

translation: TranslationType = field(converter=np.asarray)
rotation: RotationType = field(converter=as_quaternion)
timestamp: int
twist: TwistType = field(
default=None, converter=lambda x: np.asarray(x) if x is not None else x
)
acceleration: AccelerationType = field(
default=None, converter=lambda x: np.asarray(x) if x is not None else x
)
geocoordinate: GeoCoordinateType = field(
default=None, converter=lambda x: np.asarray(x) if x is not None else x
)
4 changes: 3 additions & 1 deletion t4_devkit/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
"NDArrayFloat",
"TranslationType",
"VelocityType",
"TwistType",
"AccelerationType",
"RotationType",
"VelocityType",
"SizeType",
"TrajectoryType",
"CamIntrinsicType",
Expand All @@ -44,10 +44,12 @@
# 3D
TranslationType = NewType("TranslationType", NDArrayF64)
VelocityType = NewType("VelocityType", NDArrayF64)
TwistType = NewType("TwistType", NDArrayF64)
AccelerationType = NewType("AccelerationType", NDArrayF64)
RotationType = NewType("RotationType", Quaternion)
SizeType = NewType("SizeType", NDArrayF64)
TrajectoryType = NewType("TrajectoryType", NDArrayF64)
GeoCoordinateType = NewType("GeoCoordinateType", NDArrayF64)
CamIntrinsicType = NewType("CamIntrinsicType", NDArrayF64)
CamDistortionType = NewType("CamDistortionType", NDArrayF64)

Expand Down
3 changes: 3 additions & 0 deletions tests/schema/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ def ego_pose_dict() -> dict:
"translation": [1.0, 1.0, 1.0],
"rotation": [1.0, 0.0, 0.0, 0.0],
"timestamp": 1603452042983183,
"twist": [1.0, 1.0, 1.0, 1.0, 1.0, 1.0],
"acceleration": [1.0, 1.0, 1.0],
"geocoordinate": [35.0, 140.0, 5.0],
}


Expand Down

0 comments on commit 3fadf9b

Please sign in to comment.