This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] AWR6843ISK:二进制数据的实时解析

Guru**** 2460850 points
Other Parts Discussed in Thread: AWR6843ISK

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/sensors-group/sensors/f/sensors-forum/1483090/awr6843isk-live-parsing-of-binary-data

器件型号:AWR6843ISK
主题中讨论的其他器件: AWR6843

工具与软件:

您好!

目标:检索点云中每个点的实时坐标、并将其存储在变量中以供进一步开发(统计分析、ML、跟踪等)

我的初始策略是将 AWR6843ISK 到终端的二进制数据实时发布与 SDK 包中提供的解析脚本相结合。 由于正确使用了解析脚本、所需的输出(如下所示)是可生产的、其中在执行之前引用了记录数据段后生成的二进制文件(X:exmpl//radardata//radarFile)。

到目前为止,我正在检索我想要的初始翻译,但在它之前,它错误与不同的代码,每次我处理问题(索引超出范围,等)。 我将发布不同的剪贴和主题标题来解释内容。

到目前为止需要注意的事项:

-"魔数"可以找到,它似乎改变了错误消息的更大的二进制块(如下面)。

-我写了我的代码,只有当它后面有内容时才提交数据(例如:将阻止 b'',但将允许通过 b'x02\x01\x04\...') 以及仅允许其在字节大小大于1000时提交。

我已随附一个文件、其中包含正在运行的过程并继续执行崩溃实例。

感谢这里的所有支持。

实时将二进制数据发布到终端(波特率:921600)

---

#B''
#B''
#b"\x02\x01\x04\x03\x06\x05\x08\x07\x00\x02\x06\x03\xe0\x02\x00Ch\n\x00\xd1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\@@
#B''
#B''
---
转换为变量所需的输出
---
第1个 TLV
#  类型1
#  len 96字节
#the 2nd TLV
#  类型7
  len 24字节
#          X (m)     y (m)     Z (m)    v (m/s)  Com0range (m) 方位 角(deg) elevAngle (deg) SNR (0.1dB)  噪声(0.1dB)
#  obj 0:  0.000000  1.916780  -0.085113  0.000000  1.918669  0.000000      -2.      154.      571.
#  OBJ 1:  0.903464  1.959940  -0.536816 0.000000 2.23912      24.748058      -13.      152.      631.
#  obj 2:  0.000000  1.777730 1.544160    0.000000  2.354730  0.000000      40.      117      623.
#  obj 3:  1.177365 1.929768    -0.659212 0.000000    2.354730 31.387661.        -16.      117      623.
#  obj 4:  -0.117191  3.718607  -0.470819 0.000000 3.750126 -1.805072            -7.      159.      569.
#  OBJ 5:  -1.389945  0.145061 -0.495113 -0.120712      1.482608 -84.041904       -19.      145.      486.
#Parser 结果: 0
#totalBytesParsed: 115232.
#headerStartIndex  = 0
#totalPacketNumBytes = 768
#platform       = B'000a6843'
#frameNumber     = 3667
#timeCpuCycles   = 1076861767
#numDetObj      = 6
#numTlv        = 5
#subFrameNumber   = 0
---

 

发布要发送给解析脚本的数据和过滤信息的代码:

---

import serial
import os
import sys
import time
from parser_mmw_demo import parser_one_mmw_demo_output_packet

comport = input("mmWave COM Port = ")
ser = serial.Serial(comport, 921600)

while True:
        time.sleep(0.1)
        byteCount = ser.inWaiting()
        s = ser.read(byteCount)
        NumBytes = sys.getsizeof(s)
        #print(s)
        print(NumBytes)
       
        if (str(s) != "b''" and NumBytes > 1000 ):
                print("s::", s)
                parser_one_mmw_demo_output_packet(s,NumBytes)
                
---
终端
---------------
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Adam、
      我已经加入了我们的软件专家。 请允许我们在一天左右提供回复。

    谢谢。此致、
    Sivaprasad

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    大家好:

    您使用的是哪个演示? 您可以使用哪个可视化工具来记录 TLV 信息吗?

    此致!

    Zigang

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Zigang:

    我将使用基本演示可视化工具(v3.6)来发送 cfg 文件并启动雷达。 这也是同一个可视化工具、它可以选择记录有限时间段的雷达数据。 (另存为.bin)。 通过从可视化工具 GUI/SW 断开雷达连接并运行我的软件(如上所示)来查看实时原始数据、该软件可读取 COM 端口并输出到终端。 被视为可接受的数据(如上所述)将被发送到解析脚本、然后打印到终端。

    Im 基本上试图使用最初设计用于处理有限文件的解析脚本、将其转换为可以连续解析输入的新数据的脚本。 如果您还有其他需要说明的内容、请告诉我、

    谢谢!

    Adam J

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    嗨、Adam、  

    您是否可以尝试在雷达工具箱中的以下位置使用可视化工具:

    Applications_Visualizer Body_And_Chassis_Visualizer

    您还可以 在此处找到用户指南 、其中概述了如何直接保存数据。 我相信这可能会节省您一些时间。

    此致!

    Vignesh K.

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    此输出似乎也是可以接受的、显示了坐标和其他 MISC 属性。 目前存在的问题仍然是在雷达运行时实时损坏和转换此数据的能力。

    谢谢

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    嗨、Adam、

    您仍然可以使用此方法开发转换此数据,在 Applications_Visualizer common/gui_parser.py 函数中,您可以看到此数据写入 JSON 文件的位置(单 COM 端口-第160行)。 您可以在执行所需的转换后改为打印此数据、而不是将此数据写入其中。  

    此致!

    Vignesh K.

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!
    感谢您提供此提示、经过一段时间后、我能够检索数据并根据需要进行转换。 我已经将它连接到单 COM 端口解析器和连接、但仍然必须使用 GUI 来启动和运行雷达。 仍然很重要  两个后续问题
    -我仍然有困难 启动雷达提供的代码。 它可以正常连接到双 com 端口、但写入 CLI 端口时遇到问题。 我将附上尝试运行雷达的那部分代码和后续的输出。
    -雷达数据的分类是什么? 我知道它的 X、Y、Z、多普勒?、SNR? 感谢您的讲解  

    代码

    inst = UARTParser("DoubleCOMPort")
    cli = input("CLI COM Port = ")
    datacom = input("data COM Port = ")
    inst.connectComPorts(cliCom= cli, dataCom= datacom)
    inst.sendCfg("C:\\Files\\BOSCH\\TI-RADAR\\Radar-Transformer\\DEFAULT-profile_2024_09_10T08_23_10_835.cfg")
    

    输出

    CLI COM Port = COM5
    data COM Port = COM6
    b'C\n'
    b"'C' is not recognized as a CLI command\n"
    b'\rmmwDemo:/>:\n'
    b"':' is not recognized as a CLI command\n"
    b'\rmmwDemo:/>\\\n'
    b"'\\' is not recognized as a CLI command\n"
    b'\rmmwDemo:/>F\n'
    b"'F' is not recognized as a CLI command\n"
    b'\rmmwDemo:/>i\n'
    b"'i' is not recognized as a CLI command\n"
    b'\rmmwDemo:/>l\n'
    b"'l' is not recognized as a CLI command\n"
    b'\rmmwDemo:/>e\n'
    b"'e' is not recognized as a CLI command\n"
    .......##This continues till it iterates through each character in the file path
    ERROR: No data detected on COM Port, read timed out
            Be sure that the device is in the proper SOP mode after flashing with the correct binary, and that the cfg you are sending is valid
    ERROR: No data detected on COM Port, read timed out
            Be sure that the device is in the proper SOP mode after flashing with the correct binary, and that the cfg you are sending is valid
    ERROR: No data detected on COM Port, read timed out
            Be sure that the device is in the proper SOP mode after flashing with the correct binary, and that the cfg you are sending is valid
    ERROR: No data detected on COM Port, read timed out
            Be sure that the device is in the proper SOP mode after flashing with the correct binary, and that the cfg you are sending is valid
    .....

    雷达输出(在当前模式下)

                        [
                            3.4367072582244873,
                            2.4658055305480957,
                            0.0,
                            0.0,
                            16.3,
                            87.0,
                            255.0
                        ]

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    嗨、Adam、

    我很高兴您取得了进步!  

    使用 sendCfg 的方法是正确的、但我认为该函数需要整个 cfg 的字符串。 这可能是函数尝试解析文件位置字符串而不是 cfg 本身的原因。

    在 gui_core.py 文件中、我们有一个名为 parseCfg 的函数、它可以让您了解如何输入 sendCfg 文件的字符串。 我建议在调用 sendCfg 之前先添加以下代码:

    inst = UARTParser("DoubleCOMPort")
    cli = input("CLI COM Port = ")
    datacom = input("data COM Port = ")
    inst.connectComPorts(cliCom= cli, dataCom= datacom)
    inst.parseCfg("C:\\Files\\BOSCH\\TI-RADAR\\Radar-Transformer\\DEFAULT-profile_2024_09_10T08_23_10_835.cfg")
    inst.sendCfg(inst.cfg)

    如果这出于任何原因导致问题、我建议通过运行以下代码并改为发送 cfg_string 变量作为 sendCfg 的输入来自行解析:

    inst = UARTParser("DoubleCOMPort")
    cli = input("CLI COM Port = ")
    datacom = input("data COM Port = ")
    inst.connectComPorts(cliCom= cli, dataCom= datacom)
    
    fname = "C:\\Files\\BOSCH\\TI-RADAR\\Radar-Transformer\\DEFAULT-profile_2024_09_10T08_23_10_835.cfg"
    with open(fname, "r") as cfg_file:
        cfg_string = cfg_file.readlines()
    
    inst.sendCfg(cfg_string)

    关于您的另一个问题、我建议查看 这个 页面。 简而言之、我们通过 TLV 从雷达器件发送数据、并且这些器件在启动传感器时根据您向其发送的演示和配置设置以不同的方式输出数据。  对于类型标识符1、数据以 X、Y、Z、 多普勒等格式表示其他标识符。

    我希望这有助于我们随时了解您的最新进展!

    此致!

    Vignesh K

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    谢谢你。 唯一的延迟点似乎是 TLV 标头解析失败、其中 Key Error 为"numDetectedPoints"。 这有时会在运行雷达一段时间后发生、您想知道这可能是什么原因造成的吗? 我正在处理点云、然后再调用解析函数、这样的延迟是否是原因?

    TLV Header Parsing Failure: Ignored frame due to parsing error
    Traceback (most recent call last):
      File "c:\Files\HOME\TI-RADAR\Radar-Transformer\TI-Radar6843-Embed.py", line 36, in <module>
        points = output['numDetectedPoints'] #total number of points in Pointcloud
    KeyError: 'numDetectedPoints'

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Adam、

    这会在运行雷达多长时间后发生? 您是否可以通过输出到 txt 文件并查看 TLV 数据发生了什么情况来保留所有处理过的数据的日志? 这可能会让我们更深入地了解为什么会发生这种情况。  

    点数= output['numDetectedPoints']#Pointcloud 中的总点数

    您还可以尝试将上述行放入除块之外的尝试中、以查看是否在接下来的帧中继续发生、因为我假设您在发生此错误后重新启动该过程。

    此致!

    Vignesh K.

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    嗨、Adam、

    我会在几天内回复您、我将 更深入地探讨此问题、并需要更多时间。

    雷达数据应完全完成处理、尤其是因为这只是毫米波演示、并不是过程密集型的。  

    如果您有任何更新、请告诉我。

    此致!

    Vignesh K.