Skip to content

Commit

Permalink
feat: add JSONStreamRadar
Browse files Browse the repository at this point in the history
  • Loading branch information
tklockau committed Nov 4, 2024
1 parent 4f6e0e3 commit 3b86427
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions raillabel/json_format/stream_radar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Copyright DB InfraGO AG and contributors
# SPDX-License-Identifier: Apache-2.0

from __future__ import annotations

from typing import Literal

from pydantic import BaseModel


class JSONStreamRadar(BaseModel):
"""A stream describes the source of a data sequence, usually a sensor.
This specific object contains the intrinsics of a radar sensor.
"""

type: Literal["radar"]
"A string encoding the type of the stream."

stream_properties: JSONStreamRadarProperties
"Intrinsic calibration of the stream."

uri: str
"A string encoding the subdirectory containing the sensor files."

description: str | None
"Description of the stream."


class JSONStreamRadarProperties(BaseModel):
"""Intrinsic calibration of the stream."""

intrinsics_radar: JSONIntrinsicsRadar


class JSONIntrinsicsRadar(BaseModel):
"""JSON object defining an instance of the intrinsic parameters of a radar."""

resolution_px_per_m: float
"Number correlating pixel in the output image to a position relative to the sensor in meters."

height_px: int
"Height of the radar output in pixel."

width_px: int
"Width of the radar output in pixel."

0 comments on commit 3b86427

Please sign in to comment.