You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
alexha 4a9ccdcda3
init audio sentinel
1 week ago
configs init audio sentinel 1 week ago
testdata init audio sentinel 1 week ago
.gitignore init audio sentinel 1 week ago
README.md init audio sentinel 1 week ago
audio_controller.py init audio sentinel 1 week ago
config_manager.py init audio sentinel 1 week ago
main.py init audio sentinel 1 week ago
models.py init audio sentinel 1 week ago
reporter.py init audio sentinel 1 week ago
requirements.txt init audio sentinel 1 week ago
speed_evaluator.py init audio sentinel 1 week ago

README.md

AudioSentinel

障碍物测速与超速分级音频提示系统。通过订阅 Apollo Cyber RT 的感知障碍物数据检测每个物体的运动速度km/h判断是否超过 25 km/h 阈值,并按超速等级输出音频提示。

核心功能

  1. 检测物体 — 订阅 /apollo/perception/obstacles,解析所有障碍物(车辆、行人、自行车等)
  2. 测量速度 — 根据障碍物的 velocity 矢量计算实际速度km/h
  3. 超速判定 — 以 25 km/h 为阈值,按超出程度分级
  4. 音频提示 — 每级对应不同的提示音 + 语音合成音

超速分级

等级 条件 音频输出
OK ≤ 25 km/h 30s 一次轻柔扫描提示
WARN 25~35 km/h 1声提示音 + "注意超速"
ERROR 35~50 km/h 3声急促提示音 + "超速危险"
FATAL > 50 km/h 5声紧急提示音 + "严重超速"

依赖

  • Apollo Cyber RTPython bindings
  • Python 3.10+
  • pyyaml
  • aplayALSA 音频播放)

配置

编辑 configs/audio_sentinel_conf.yaml

  • speed_thresholds.threshold_kph — 速度阈值(默认 25 km/h
  • speed_thresholds.*_over_kph — 各级报警的超速幅度
  • audio.speech.*.text — 各级语音提示文案
  • detection.max_distance_m — 检测范围

运行

cd /path/to/audiosentinel
python main.py

输出

  • reports/status.json — 当前超速状态和最快的物体信息
  • 音频通过系统扬声器播放aplay

测试数据

  • cyber_recorder play -l -f ./demo_3.5.record

环境搭建播放器设置

  • sudo apt install -y alsa-utils