Skip to content

flyingTeng/loong96_reading

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

触觉传感器数据采集项目

华威科触觉传感器数据采集系统,支持单传感器和双传感器模式。

项目结构

tactile_sensor_project/
├── tactile_core.py      # 核心模块:协议处理和串口通信
├── test_connection.py   # 传感器连接测试
├── dual_sensor.py       # 双传感器数据采集
├── single_sensor.py     # 单传感器数据采集
├── data/                # 数据保存目录
└── README.md            # 本文件

环境要求

  • Python 3.8+
  • pyserial 库
  • conda 环境: realman

快速开始

1. 激活环境

conda activate realman

2. 安装依赖

pip install pyserial

3. 测试连接

python test_connection.py

4. 数据采集

单传感器模式(约40Hz)

python single_sensor.py

双传感器模式(总约30Hz,每传感器约15Hz)

python dual_sensor.py

性能参数

模式 超时 帧率 成功率
单传感器 10ms ~40Hz ≥99%
双传感器 20ms ~15Hz/传感器 100%

详细使用说明

test_connection.py - 连接测试

python test_connection.py                # 检测所有传感器
python test_connection.py --id 0x1       # 检测指定传感器
python test_connection.py --port /dev/ttyUSB1  # 使用其他串口

single_sensor.py - 单传感器采集

python single_sensor.py                  # 自动检测传感器
python single_sensor.py --id 0x1         # 指定传感器ID
python single_sensor.py --timeout 12     # 手动设置超时(ms)
python single_sensor.py --auto-tune      # 运行调优测试

dual_sensor.py - 双传感器采集

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: 传感器ID
  • Rows, Cols: 阵列尺寸 (12×8)
  • Pressure_Data: 96个压力值

协议信息

  • 波特率: 921600
  • 传感器阵列: 12×8 = 96个传感单元
  • 数据类型: uint16 (0-65535)

停止采集

Ctrl+C 停止,数据自动保存。

About

A little project allowing users to directly get the original data of tactile sensor loong96

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages