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.

IWR1843BOOST: Read the data in a form of xyz in python

Part Number: IWR1843BOOST
Other Parts Discussed in Thread: AWR1843, IWR1843

Hi Experts,

May I ask for help? Our customer have a concern as shown below:

"we just bought a IWR1843BOOST
it is now working and the data can be seen in mmwave demo visualizer
however, we would like to read the data in a form of xyz in python
do you have a solution for this?"

I hope you can help us. Thank you.

Kind regards,
Gerald

  • Hi Vaibhav,

    To further support our customer, kindly see his concerns below:

    • I have found this RWR1843 git site code written in python; it is now working with the radar xRWR1843 we bought from Texas Instruments. The problem with this code is that as you can see it in the figure, only few objects are detected. I hardly understand the code, maybe someone who could help me what to change to get more points.
    • I also found this ros-package, It is working now, I am running the file 1843es1_long_range.launch, I get many points but hard to see if they correspond to the objects. Because the farthest object is about 6-7 meters and in RVIZ I can see points even to 16 meters.

    I hope you can further help us.

    Kind regards,
    Gerald

  • Hello Gerald,

    I am not sure what figure you are referring to. That git repository is not from TI so we can't support it here. If you are looking for an example of reading OOB UART data in python you can see the visualizer at the location below (if you have downloaded the toolbox)

    C:\ti\mmwave_industrial_toolbox_4_9_0\labs\people_counting\visualizer

    The visualizer there supports OOB UART data. See the oob_parser.py file for an example of parsing. An example of offline parsing is also included with the SDK at the location below.

    C:\ti\mmwave_sdk_03_05_00_04\packages\ti\demo\parser_scripts

    Regards,

    Jackson

  • Hi Jackson,

    Thank youn for your response. Customer still have questions, please see below:

    "I download the toolbox mmwave_industrial_toolbox_4_9_0 and I took a look at the ti\mmwave_industrial_toolbox_4_9_0\labs\people_counting\visualizer folder, however I do not know where to take a look at.

    I also took a look at the ti\mmwave_sdk_03_05_00_04\packages\ti\demo\parser_scripts but I do not see any scrip that contains a main method that allows me to get the [x,y,z] values.

    The issue is that I just need a script in python that can give me the online values [x,y,z] which are reliable and with good resolution.

    Well, I can find a scrip called readData_AWR1843.py in the git repository that is not from the TI team. I just made few modifications where I take away what is related with qt. This script gives me the [x,y,z] values. But they are very sparse and there is a delay.

    My question is: Where can I get a similar script that it is from the TI team?

    addtionaly, when I try to run the python script mmw_demo_example_script.py situated in  ti/mmwave_sdk_03_05_00_04/packages/ti/demo/parser_scripts I get the following error:
          Error: provide file name of the saved stream from Visualizer for OOB demo
    Then I run the following:
        python mmw_demo_example_script.py iwr1843.cfg   The .cfg is the configuration file obtained from the mmwave demo visualizaer. Then, I get the following error:
         ************ Frame Fail, cannot find the magic words *****************

    I do have another question for the IT group.
     I have installed the mmwave demo visualizer locally, however when I run it, the visualizer cannot detect the ports, it gives the following error:
    An error has occurred which indicates that the GUI Composer Runtime was not properly installed.

    Please click the link below to download the Runtime installer, install the runtime and ensure that this application is located as a sub-folder of the installed runtime.

    I have loaded the gcruntime-7.4.1-linux-x64-installer.run  in the folder guicomposer/runtime/gcruntime.v7 and run it, but I still get the same error"

    I hope you can further help us. Thank you.

    Kind regards,
    Gerald
  • Hi Jackson,

    Customer also sent a response as shown below:

    "To be sincere it is hard for me to understand the code.
    Based on the post:
    I have concatenated the parse_mmw_demos.py  placed at  ti\mmwave_sdk_03_05_00_04\packages\ti\demo\parser_scripts with some code. Then I manage to get the  [xyz] values.
    I send you the code, well I do not know whether it is possible for the IT team can run it and see it the 3d plot is correct. For me it looks very sparse and the points are jumping all time.
    The main script is data_ti.py I named it data_ti.python(py) so I could attach it, the same with the other script."
    CS0773459.zip

    Kind regards,
    Gerald
  • Hi Jackson,

    Kindly see below as addional concern of customer:

    "I was trying the radar WR1843     on the mmWave demo visualizer  and I can see there are two options in the plot tab->Real-Time Tunning:
            Range Detection
            Doppler detection
    Range detection enables peak grouping in the range direction and one for enabling
    peak grouping in the Doppler direction.
    With these options I can manage to get a cluster of detected neighboring points.
    The question is:
    How can I manage to tune these parameters in the code?

    I have checked the mmwave  Demo Visualizer User's Guide to change the range direction and doppler direction, but this guide is mainly for the GUI which I have done it.
    I want to change that in python code."

    Kind regards,
    Gerald

  • Hi Jackson,

    Please see customer updates below in regards to his progress in his side:

    "I have been trying some things, well I update with the last two questions. I hope I can get help Slight smile

    • I made a mistake with the code I have sent before. Based on the replay of Jackson I have tried the parse_mmw_demos.py  placed at  ti\mmwave_sdk_03_05_00_04\packages\ti\demo\parser_scripts with some code. Then I manage to get the  [xyz] values.
                The issue I get here is that I get a delay of the data of 5 seconds, and to be sincere I do not know how to solve that issue. I mean to make it more in real time.
                The main script is data_ti.py I named it data_ti.python(py) so I could attach it, the same with the other script."
    • I took a look at oob_parser.py placed at \ti\mmwave_industrial_toolbox_4_9_0 \labs\people_counting\visualizer.   Then, based on this site I adapted to my situation:
       from oob_parser import uartParserSDK
     
       #initialize parser
      parser = uartParserSDK(type='(Legacy) 2D People Counting')
      #parser.frameTime = 50 #50 ms frame time
     
    try:
     uart = "/dev/ttyACM0" #deb_gp
     data = "/dev/ttyACM1" #deb_gp
     
     parser.connectComPorts(uart, data)
     
    except:
     print('Com port connection failed')
     #open config file
     fname = 'iwr1843.cfg'
     cfg_file = open(fname, 'r')
     cfg = cfg_file.readlines()
     parser.sendCfg(cfg)
     
    while(1):
      print(parser.readAndParseUart())
    When I run it, I get the following error:
       read fail: not enough data
    (array([[0., 0., 0., ..., 0., 0., 0.],
           [0., 0., 0., ..., 0., 0., 0.],
           [0., 0., 0., ..., 0., 0., 0.],
           [0., 0., 0., ..., 0., 0., 0.],
           [0., 0., 0., ..., 0., 0., 0.]]), array([[0.],
    I hope the TI team can help me Slight smile"

    Kind regards,
    Gerald
  • Hi,

    Sorry for the delayed response and thank you for your patience.

    You can adjust settings through the CFG file being sent to the EVM. Please refer to section 3.4 of the mmWave SDK user's guide on the parameters and commands contained in the cfg file. http://software-dl.ti.com/ra-processors/esd/MMWAVE-SDK/latest/exports/mmwave_sdk_user_guide.pdf

    In terms of addressing the question about adjusting the range and doppler detection settings from the mmWave Demo GUI, there are settings for the cfarCfg command that deals with range and doppler settings and enabling peak grouping. 

    Additionally you can use this tool to help learn about and configure the chirp diagram parameters for your specific application. These values can then be used to help modify and fine tune the configuration parameters that will be sent to the EVM. 

    https://dev.ti.com/gallery/view/1792614/mmWaveSensingEstimator/ver/1.3.0/

    Thanks,

    Alex Chan

  • Hi Alex,

    Thank you for your response. I got feedback from our customer as shown below:

    "Well, the main issue is to have a python script where I can get the [xyz] point cloud of the detected objects with a good resolution, I mean enough points in 3D.

    For that I have been trying few things based on the previous comments in this post.  Just to say that I have not been successful in the task. I mentioned what I have done, maybe somebody can help me. Just to say I am using Ubuntu 20.04.
    • Based on the replay of Jackson I have tried the parse_mmw_demos.py  placed at  ti\mmwave_sdk_03_05_00_04\packages\ti\demo\parser_scripts with some code. Then I manage to get the  [xyz] values.
                The issue I get here is that I get a delay of the data of 5 seconds, and to be sincere I do not know how to solve that issue. I mean to make it more in real time. For instance, I can see in the mmwave demo visualizer, when I place an object in front of the radar it reacts quite fast.  The code can be seen above in this site CS0773459.zip
    • I have tried to run gui_main.py  and also oob_parser.py, however the only type I can get data is with type='SDK Out of Box Demo'   and I do not get the z coordinate even though the config file was exported with elevation.

        when I try the other modes, e.g  '(Legacy): Overhead People Counting' etc. I get:
                                                  read fail: not enough data.
    The script to use oob_parse.py is shown in the following:
    import time
    from oob_parser import uartParserSDK
    from matplotlib import pyplot as plt
    import numpy as np
    import os
    import sys
    def on_close(event):
     print('\n')
     print('\n')
     print('\n')
     print('\n')
     print("//-------------------------------------------------------------------//")
     print("//-------------------------------------------------------------------//")
     print("//-------------------------------------------------------------------//")
     print('//----!!!!!   THE PROGRAM HAS BEEN SHUTDOWN, BYE BYE :-)   !!!!!!----//')
     print("//-------------------------------------------------------------------//")
     print("//-------------------------------------------------------------------//")
     print("//-------------------------------------------------------------------//")
     print('\n')
     print('\n')
     print('\n')
     print('\n')
     sys.exit()
    #initialize parser
    parser = uartParserSDK(type='SDK Out of Box Demo')
    parser.frameTime = 50 #50 ms frame time
    try:
     uart = "/dev/ttyACM0" #deb_gp
     data = "/dev/ttyACM1" #deb_gp
     parser.connectComPorts(uart, data)
     
    except Exception as E:
     print(E)
     print('Com port connection failed')
     #open config file
     fname = 'iwr1843.cfg'
     cfg_file = open(fname, 'r')
     cfg = cfg_file.readlines()
     parser.sendCfg(cfg)
     
    plt.ion()
    fig = plt.figure()
    fig.canvas.mpl_connect('close_event', on_close)
    ax = fig.add_subplot(111, projection='3d')
    while(1):
      time.sleep(0.1) #50 ms
      #print(parser.readAndParseUart())
      pcBufPing=parser.readAndParseUart()
      print("\n")
      #print(pcBufPing[0][1])
      #print("lenX",len(pcBufPing[0][0]))
      #print("lenY",len(pcBufPing[0][1]))
      #print("lenZ",len(pcBufPing[0][2]))
      XX=pcBufPing[0][0]
      YY=pcBufPing[0][1]
      ZZ=pcBufPing[0][2]
      print(XX)
      print(YY)
      print(ZZ)
      print("\n")
      #print(pcBufPing)
      print("\n")
      ax.clear()
      ax.set_xlim([-6, 6])
      ax.set_ylim([0, 8])
      ax.set_zlim([-2, 3])
      plt.xlabel("X")
      plt.ylabel("Y")
      ax.plot(XX,YY,ZZ,'o', color='blue',markersize=5)
         
          #mng = plt.get_current_fig_manager()
          #mng.full_screen_toggle()
      plt.pause(0.1)
      fig.canvas.draw()
    Well, I hope somebody can help me"

    Kind regards,
    Gerald
  • Hi Gerald,

    This may be out of the scope of our support. The EVM appears to connect and work to some extent with the customers code and this seems like a software issue the customer wrote as the normal TI visualizer code works fine. I would suggest using a python debugger tool to help narrow down what may be slowing down the code because it does not seem to be a radar issue since the EVM works fine with the TI mmWave Visualizer and the same EVM is being used with the customers code. 

    In terms of the config type,  please check the out of box flashed onto the IWR1843 is from the latest SDK 3.5 and only the SDK Out of Box Demo will work none of the other config types are supported with the IWR1843. 

    Thanks,

    Alex Chan