namespace RobotNet10.RobotApp.Shared.NavigationMonitor; /// /// Real-time telemetry snapshot from NavigationMonitorService /// public class NavigationTelemetryDto { public long TimestampMs { get; set; } public double X { get; set; } public double Y { get; set; } public double Theta { get; set; } // radians public double LinearVelocity { get; set; } // m/s public double AngularVelocity { get; set; } // rad/s public double LinearAcceleration { get; set; } // m/s² public double AngularAcceleration { get; set; } // rad/s² public string NavigationState { get; set; } = "Idle"; public bool Driving { get; set; } public double CrossTrackError { get; set; } // meters (0 if no path) public double HeadingError { get; set; } // radians (0 if no path) public double DistanceToGoal { get; set; } // meters (0 if no path) public double ModelConfidence { get; set; } /// /// DockTo-specific telemetry (null when not docking) /// public DockToTelemetryDto? DockTo { get; set; } /// /// Current navigation path waypoints (downsampled for visualization). /// Empty when not navigating. /// public List Waypoints { get; set; } = []; } /// /// Safety violation detected by NavigationSafetyChecker /// public class NavigationSafetyViolationDto { public long TimestampMs { get; set; } public SafetyViolationType Type { get; set; } public SafetyViolationSeverity Severity { get; set; } public double Value { get; set; } public double Threshold { get; set; } public string Message { get; set; } = string.Empty; } public enum SafetyViolationType { LinearVelocity = 1, AngularVelocity = 2, LinearAcceleration = 3, CrossTrackError = 4, HeadingError = 5 } public enum SafetyViolationSeverity { Warning = 1, Critical = 2 } /// /// Current state of NavigationMonitorService /// public class NavigationMonitorStateDto { public bool TelemetryEnabled { get; set; } public bool SafetyStopEnabled { get; set; } public bool SafetyStopLatched { get; set; } public string SafetyStopReason { get; set; } = ""; public NavigationSafetyConfigDto SafetyConfig { get; set; } = new(); public double UpdateFrequencyHz { get; set; } = 10; } /// /// Configurable safety thresholds /// public class NavigationSafetyConfigDto { public double MaxLinearVelocity { get; set; } = 1.5; // m/s public double MaxAngularVelocity { get; set; } = 6.0; // rad/s public double MaxLinearAcceleration { get; set; } = 3.0; // m/s² public double MaxCrossTrackError { get; set; } = 0.5; // meters public double MaxHeadingError { get; set; } = 45.0; // degrees } /// /// DockTo-specific telemetry data, included when robot is in Docking or FinePositioning state /// public class DockToTelemetryDto { public string Phase { get; set; } = ""; // "Approaching", "Aligning", "Advancing" public string Direction { get; set; } = ""; // "FORWARD" or "BACKWARD" public int RetryCount { get; set; } public int MaxRetries { get; set; } public double GoalX { get; set; } public double GoalY { get; set; } public double GoalTheta { get; set; } // radians public int TotalWaypoints { get; set; } public double StartX { get; set; } public double StartY { get; set; } public double StartTheta { get; set; } // radians public List Waypoints { get; set; } = []; } public class DockWaypointDto { public double X { get; set; } public double Y { get; set; } } /// /// Navigation path waypoint for visualization /// public class WaypointDto { public double X { get; set; } public double Y { get; set; } public string Direction { get; set; } = "FORWARD"; // "FORWARD" or "BACKWARD" }