UDM Event & Builder¶
UDMEvent¶
UDMEvent ¶
UDMEventBuilder¶
UDMEventBuilder ¶
UDMEventBuilder(source_id: str, source_type: SourceType, event_type: EventType = TELEMETRY_PERIODIC)
Fluent builder for constructing UDM events.
Provides a convenient API for building events with proper defaults and type safety.
Example
event = ( UDMEventBuilder(source_id="robot-001", source_type=SourceType.AMR) .with_event_type(EventType.TELEMETRY_PERIODIC) .with_location(latitude=41.8781, longitude=-87.6298) .with_motion(speed_mps=1.2) .build() )
Initialize the builder with required fields.
| PARAMETER | DESCRIPTION |
|---|---|
source_id | Unique identifier for the source robot/system TYPE: |
source_type | Type classification of the source TYPE: |
event_type | Type of event being created TYPE: |
Source code in phytrace/core/builder.py
Functions¶
with_event_id ¶
with_captured_at ¶
with_session ¶
with_sequence ¶
with_identity ¶
with_identity(source_name: str | None = None, platform: str | None = None, platform_version: str | None = None, firmware_version: str | None = None, hardware_revision: str | None = None, serial_number: str | None = None, fleet_id: str | None = None, site_id: str | None = None, zone_id: str | None = None, organization_id: str | None = None, tags: list[str] | None = None) -> Self
Set identity domain information.
Source code in phytrace/core/builder.py
with_location ¶
with_location(latitude: float | None = None, longitude: float | None = None, altitude_m: float | None = None, heading_deg: float | None = None, heading_reference: HeadingReference | None = None, coordinate_system: CoordinateSystem = WGS84, horizontal_accuracy_m: float | None = None, vertical_accuracy_m: float | None = None, floor: int | None = None, building: str | None = None, local: LocalCoordinates | None = None, grid: GridPosition | None = None, semantic: SemanticLocation | None = None) -> Self
Set location domain information.
Source code in phytrace/core/builder.py
with_local_coordinates ¶
with_local_coordinates(x_m: float, y_m: float, z_m: float = 0.0, yaw_deg: float | None = None, roll_deg: float | None = None, pitch_deg: float | None = None, coordinate_frame: str = 'map') -> Self
Set local coordinate position (convenience method).
Source code in phytrace/core/builder.py
with_motion ¶
with_motion(speed_mps: float | None = None, vx_mps: float | None = None, vy_mps: float | None = None, vz_mps: float | None = None, angular_velocity_yaw_dps: float | None = None, angular_velocity_roll_dps: float | None = None, angular_velocity_pitch_dps: float | None = None, distance_traveled_m: float | None = None, distance_session_m: float | None = None, motion_state: MotionState | None = None) -> Self
Set motion domain information.
Source code in phytrace/core/builder.py
with_power ¶
with_power(battery_soc_pct: float | None = None, battery_soh_pct: float | None = None, battery_voltage_v: float | None = None, battery_current_a: float | None = None, battery_temperature_c: float | None = None, time_to_empty_min: int | None = None, is_charging: bool | None = None, is_plugged_in: bool | None = None, charging_power_w: float | None = None, charger_id: str | None = None, power_state: PowerState | None = None, power_consumption_w: float | None = None) -> Self
Set power domain information.
Source code in phytrace/core/builder.py
with_operational ¶
with_operational(mode: OperationalMode | None = None, state: OperationalState | None = None, sub_state: str | None = None, availability: str | None = None, enabled: bool | None = None, e_stop_active: bool | None = None, uptime_sec: int | None = None, task_id: str | None = None, task_type: str | None = None, task_state: str | None = None, task_progress_pct: float | None = None) -> Self
Set operational domain information.
Source code in phytrace/core/builder.py
with_navigation ¶
with_navigation(localization_status: LocalizationStatus | None = None, localization_confidence: float | None = None, localization_method: str | None = None, map_id: str | None = None, has_path: bool | None = None, path_length_m: float | None = None, path_blocked: bool | None = None, goal_id: str | None = None, goal_x_m: float | None = None, goal_y_m: float | None = None, distance_to_goal_m: float | None = None, nearest_obstacle_m: float | None = None, obstacle_count: int | None = None) -> Self
Set navigation domain information.
Source code in phytrace/core/builder.py
with_safety ¶
with_safety(safety_state: SafetyState | None = None, e_stop_active: bool | None = None, e_stop_source: str | None = None, protective_stop_active: bool | None = None, reduced_speed_active: bool | None = None, zone_speed_limit_mps: float | None = None, nearest_human_m: float | None = None, nearest_robot_m: float | None = None, nearest_obstacle_m: float | None = None, collision_imminent: bool | None = None, safety_score: float | None = None, violations: list[SafetyViolation] | None = None) -> Self
Set safety domain information.
Source code in phytrace/core/builder.py
with_detections ¶
Add object detections to perception domain.
Source code in phytrace/core/builder.py
with_simulation ¶
with_simulation(is_simulated: bool = True, simulator: str | None = None, scenario_id: str | None = None, scenario_name: str | None = None) -> Self
Mark event as from simulation.
Source code in phytrace/core/builder.py
with_extensions ¶
with_raw_payload ¶
build ¶
build() -> UDMEvent
Build and return the UDM event.
| RETURNS | DESCRIPTION |
|---|---|
UDMEvent | A fully constructed UDMEvent instance. |