华威科触觉传感器数据采集系统,支持单传感器和双传感器模式。
tactile_sensor_project/
├── tactile_core.py # 核心模块:协议处理和串口通信
├── test_connection.py # 传感器连接测试
├── dual_sensor.py # 双传感器数据采集
├── single_sensor.py # 单传感器数据采集
├── data/ # 数据保存目录
└── README.md # 本文件
- Python 3.8+
- pyserial 库
- conda 环境:
realman
conda activate realmanpip install pyserialpython test_connection.pypython single_sensor.pypython dual_sensor.py| 模式 | 超时 | 帧率 | 成功率 |
|---|---|---|---|
| 单传感器 | 10ms | ~40Hz | ≥99% |
| 双传感器 | 20ms | ~15Hz/传感器 | 100% |
python test_connection.py # 检测所有传感器
python test_connection.py --id 0x1 # 检测指定传感器
python test_connection.py --port /dev/ttyUSB1 # 使用其他串口python single_sensor.py # 自动检测传感器
python single_sensor.py --id 0x1 # 指定传感器ID
python single_sensor.py --timeout 12 # 手动设置超时(ms)
python single_sensor.py --auto-tune # 运行调优测试python dual_sensor.py # 使用默认参数
python dual_sensor.py --timeout 25 # 手动设置超时(ms)
python dual_sensor.py --auto-tune # 运行调优测试sudo chmod 666 /dev/ttyUSB0- 检查供电是否正常
- 检查串口连接
- 确认传感器ID(默认0x1, 0x2)
CSV文件列:
Timestamp: 可读时间戳Unix_Time: Unix时间戳(微秒精度)Sensor_ID: 传感器IDRows,Cols: 阵列尺寸 (12×8)Pressure_Data: 96个压力值
- 波特率: 921600
- 传感器阵列: 12×8 = 96个传感单元
- 数据类型: uint16 (0-65535)
按 Ctrl+C 停止,数据自动保存。