Skip to content

[Task]PC上CSI数据处理工具 #4

@Lixeer

Description

@Lixeer

💡 背景 / 动机 (Context / Motivation)

现阶段已经完成了在esp32c6对WIFI CSI 原生数据的高频采集和传输,但是采集数据毫无规律,直接可视化也无法区分出数据意义(输出大致如下)

len:256 index:<表示数据包索引> data:[0,0,0,0,0,0,0,0,0,0,0,0,26,7,26,9,27,10,28,11,29,12,29,13,28,14,29,15,31,14,32,15,32,16,32,15,36,13,34,15,34,16,33,14,36,15,36,14,36,14,39,16,42,13,35,14,38,10,37,11,37,12,38,8,37,8,36,6,39,5,37,3,38,1,39,1,37,0,36,-1,37,-3,37,-7,36,-7,37,-10,37,-10,36,-14,35,-13,34,-17,34,-17,34,-21,33,-18,33,-23,33,-22,33,-25,32,-23,26,-25,31,-27,43,-33,32,-25,24,-29,28,-35,26,-29,32,-33,0,0,0,0,0,0,-31,-29,-31,-26,-32,-25,-28,-23,-32,-23,-31,-22,-29,-21,-30,-18,-28,-18,-26,-16,-27,-14,-26,-12,-27,-12,-26,-12,-26,-11,-25,-9,-27,-10,-24,-7,-24,-7,-24,-4,-22,-4,-24,-3,-22,-5,-21,-3,-21,-3,-20,-1,-20,-4,-19,-2,-19,-2,-18,1,-15,-1,-16,-2,-15,-2,-14,-2,-14,-2,-12,-1,-12,-4,-9,-2,-9,-3,-6,-1,-5,0,-5,-1,-5,0,-3,0,-1,0,-1,0,0,1,-1,1,1,0,0,1,1,2,1,1,2,2,2,2,1,2,2,4,2,3,0,0,0,0,0,0,0,0,0,0]

我们迫切需要一个工具用来处理这些数据

📝 目标 (Objective)

了解数据意义,对数据进行实时预处理且可视化,并且为后续数据标注留出可能性(例如人的剧烈运动可能引起波形的变化,但是在这堆数据中我们并不能知道哪个时间段是变化的)。

📕 任务指南

查看乐鑫源代码注释

typedef struct wifi_csi_info_t {
    wifi_pkt_rx_ctrl_t rx_ctrl;/**< received packet radio metadata header of the CSI data */
    uint8_t mac[6];            /**< source MAC address of the CSI data */
    uint8_t dmac[6];           /**< destination MAC address of the CSI data */
    bool first_word_invalid;   /**< first four bytes of the CSI data is invalid or not, true indicates the first four bytes is invalid due to hardware limitation */
    int8_t *buf;               /**< valid buffer of CSI data */
    uint16_t len;              /**< valid length of CSI data */
    uint8_t *hdr;              /**< header of the wifi packet */
    uint8_t *payload;          /**< payload of the wifi packet */
    uint16_t payload_len;      /**< payload len of the wifi packet */
    uint16_t rx_seq;           /**< rx sequence number of the wifi packet */
} wifi_csi_info_t;

buf是csi的原生数据,并且通过官方的文档

  • 元数据字段:包括 type, id, mac, ... first_word等。
  • CSI 数据:由最后一项 data 数组存储,用 [...] 框起。包含每个子载波的信道状态信息。
  • 具体结构可参考 ESP-WIFI-CSI Guide 的 Long Training Field (LTF) 部分。对于每一个子载波,先储存虚数部分,再储存实数部分(即:[子载波1的虚部,子载波1的实部,子载波2的虚部,子载波2的实部,子载波3的虚部,子载波3的实部,...])。
    LTF的顺序为:LLTF、HT-LTF、STBC-HT-LTF。根据通道和分组信息,可能不会出现所有3个LTF。
    he order of LTF is: LLTF, HT-LTF, STBC-HT-LTF. Depending on the channel and grouping information, not all 3 LTFs may appear.
    大致得知数据意义

在仓库根目录tool/下有可视化工具的基本代码和管理文件,你需要在这下面完成你的任务设计
这个工具采用uv管理器进行管理(什么是uv uv 一个高性能python项目管理器)
你需要将他运行起来,并且以这个为参考继续开发

📋 待办列表 (To-Do List)

  • 编译并烧录固件到esp32c6上,或者直接在action中选择tagc6 的bin文件进行烧录
  • 成功运行/tools/main.py 并且与开发板建立连接采集到数据
  • 完成滤波算法
  • 实时数据可视化可以响应人体动作

🎯 完成定义 (验收标准 / Definition of Done)

  • 完成待办列表
  • 代码经过运行测试且经过不少于一个review
  • 必要的文档

🔗 相关 Issue / PR

Pinned by Lixeer

Metadata

Metadata

Assignees

No one assigned

    Labels

    task标记需要执行的工作步骤。可用于跟踪待办事项、功能开发或文档更新,便于团队成员了解下一步工作

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions