1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
| class FeetOnDashboardTest: """ Euro NCAP OOP-FD 场景测试 检测要求: - 位置分类: inboard / centerline / outboard - 检测时延: ≤5秒 - 准确率: ≥95% """ TEST_CASES = { 'OOP-FD-01': { 'name': '左脚放仪表盘内侧', 'setup': '乘客将左脚放在仪表盘左侧', 'expected': '检测到feet_inboard', 'warning_time': '30秒内', 'hardware': ['3D深度相机', '压力传感器'] }, 'OOP-FD-02': { 'name': '双脚放仪表盘中部', 'setup': '乘客将双脚放在仪表盘中央', 'expected': '检测到feet_centerline', 'warning_time': '30秒内', 'hardware': ['3D深度相机', '压力传感器'] }, 'OOP-FD-03': { 'name': '右脚放仪表盘外侧', 'setup': '乘客将右脚放在仪表盘右侧', 'expected': '检测到feet_outboard', 'warning_time': '30秒内', 'hardware': ['3D深度相机', '压力传感器'] } } @staticmethod def execute_test(test_id: str, sensor_data: dict) -> dict: """ 执行测试 Args: test_id: 测试场景ID sensor_data: 传感器数据 Returns: 测试结果 """ import time start_time = time.time() detected = detect_feet_position(sensor_data['depth_image']) latency = time.time() - start_time return { 'test_id': test_id, 'detected': detected is not None, 'position': detected, 'latency_sec': latency, 'pass': latency <= 5.0 and detected is not None }
|