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.

AWR6843AOPEVM: Cannot save the point cloud output while running 3D People Counting lab

Part Number: AWR6843AOPEVM
Other Parts Discussed in Thread: AWR6843AOP

Hi, TI team, 

I'm using AWR6843AoP EVM to run the 3D people counting lab in mmwave_industrial_toolbox_4_11_0. And I have successfully run the lab and see point cloud data shown on GUI.

But I can't save the point cloud output.

According to the "People Counting Visualizer User's Guide", I have installed python 3.6, and also checked the "self.saveBinary" parameter in "oob_parser.py", which was already set to 1.

It should write out a .bin file in binData folder, but I cannot find any one.

Are there anything wrong or misunderstanding of the setting? Please give me a guidance.

Thank you.

Shihyu.

  • Hi Shihyu,

    Did you let it run to 1000 frames? Notice the second line in the code provided tells the python script to only save the output every 1000 frames. You could set this value lower too if you want to save more frequently.

    Best,

    Nate

  • Hi,

    I have modified this frame number from 1000 to 100, and it show "TLV Header Parsing Failure" message on command line while self.saveBinary is 1. And it show "Point Cloud TLV Parser Failed" message while self.saveTextFile is 1.

    How to fix this issue?

    Thanks,

    Shihyu.

  • Hi Shihyu,

    Are you resetting the device between runs? ITB 4.11 should work with this feature. Also make sure you're using device code and python code both from toolbox 4.11 too. There was an output format change between 4.10 and 4.11.

    Best,

    Nate

  • Hi, Nate

    Still cannot save either the binary nor csv file after retry. Here are my whole setup steps and please give me some hints if I miss anything:

    1. Flash my AWR6843AoP wih firmware in "mmwave_industrial_toolbox_4_11_0\labs\People_Counting\3D_People_Counting\prebuilt_binaries\3D_people_count_68xx_demo.bin"

    2. Install "python-3.6.0-amd64.exe" and also run the script "setupEnvironment.bat".

    3. Using "AOP_6m_default.cfg" while running the lab, which works well and be able to see point clouds shown on GUI.

    4. Turn on the self.saveBinary and self.saveTextFile in oob_parser.py file in "mmwave_industrial_toolbox_4_11_0\labs\People_Counting\visualizer" folder.

    Results:

    • Still have "TLV Header Parsing Failure" issue.
    • Sometimes it emerge IndexError while running the lab after running about 2~3000 frames.

    And I also add another codes to print the self.frameNum every 100 frames, but it seems didn't work!

    Can't figure out the reason.

    Thanks.

    Shihyu.

  • Hi Shihyu,

    Your steps look correct to me. Does that TLV Parsing error happen on each frame? Or only once in a while?

    Additionally, maybe you could place a breakpoint at the line that's supposed to save the frames to see what's going on? I'm able to get it working with the same hardware/software without an issue.

    Best,

    Nate

  • Hi, Nate,

    Now I can save out the point cloud data in csv file finally.

    However, after I retry this lab twice time again, it still output error messages, which looks very similar in both tries, following figures are the my description:

    1. I modified 2 python source codes according to the "TLV Header Parsing Failure" and "Point Cloud TLV Parser Failed" to show the current variable values:

    2. The error messages while lab is running and saving csv file are:

    My questions are:

    1. It seems that both 2 Parsing Fail error happen once in a while, are those errors related to the missing TLV header data during UART is transferring? Or even the FW even don't transfer the TLV header data in these specific frames? (Because most of them belong the the 4th numTLVs.)

    2. "Point Cloud TLV Parser Failed" happened after the file starts to write, and "TLV HeaderParsing Failure" happened before it. Are these two errors are related to the same reason?

    3. I found there is very few missing frames in the csv file, (this also happens once in a while and not in every save files.) is this the root cause of the error messages?

    Thanks.

    Shihyu.

  • Hi Shihyu, 

    Have you made any changes to the code running on the IWR device? Please run the prebuilt binary file for the people counting lab with an unmodified configuration from the toolbox to make sure. Additionally, are there many processing running on your computer concurrently with the visualizer? We don't get nearly this many errors per frame (if we get any at all) when we run this demo.

    Best,

    Nate

  • Hi, Nate,

    I do sure I didn't change any codes. I use the prebuilt binary file and the AOP_6m_default.cfg configuration directly .

    I only modified those 2 codes I mentioned above in oob_parser.py to the print out error messages.

    And I found those error messages always appear during the first file starts to save. I think it relate to the #detected points. See my video:

    Shihyu.

  • Hi Shihyu,

    Are you running other programs on your computer at the same time? Please run the python and keep the other processes on your computer to a minimum. Additionally, have you run the batch script setUpEnvironment.bat? Finally, what cables are you using to connect the devices? Are they relatively short? 

    This error is not reproducible on our end, but you could also trace it deeper in the tlvHeaderDecode function to learn more.

    Best,

    Nate

  • Hi Nate,

    I have re-run the setUpEnvironment.bat script to make sure those 5 libraries have been correctly installed already.

    I did not run anything else at the same time, and also use the cable which was original equipped.

    After checking the contents of saved csv files, I found that there are some un-expected values as following figure:

    => It appears all zeros of the decoded frame header structure!

    Is this to be the root cause of the error message?

    Shihyu.

  • Hi Shihyu,

    How did those csv files get generated? Those appear to be generated by the saveTextFile flag. Please turn this flag off and only save the binary. This is what I do. If this does not generate any errors, I can give you a script to decode the binary into a readable format.

    Best,

    Nate

  • Hi Nate,

    Those csv files were generate through saveTextFile flag is set to 1.

    And I have tried another save binary file solution, those Point Cloud TLV Parser Failure messages didn't show anymore after the first binary file starts to save.

    However, TLV Header Parsing Failure still exists, and there are some missing frames. Is it normal?

    BTW, would you please sent me the binary file decoder script, I can make sure which frames were missing.

    Thanks a lot.

    Shihyu.

  • Hi Shihyu,

    Please set the saveTextFile flag to 0 and the saveBinaryFile flag to 1 and see if the errors still occur. This is the format I use for testing and it works fine for me.

    Best,

    Nate

  • Hi Nate,

    I have turned the saveTextFile flag off already!

    Shihyu

  • Hi Shihyu,

    The picture you have shown above indicates to me that the visualizer is failing about every 200 frames, is that correct? If so, I think the problem is likely with the compatibility between the visualizer and your computer, and I would suggest just using the data that it's giving, seeing as it only loses one frame out of every 200.

    Best,

    Nate

  • HI Nathan,

    I'm waiting for his reply because this will also resolve my issue.

    If this does not generate any errors, I can give you a script to decode the binary into a readable format.

    Can you please upload the script for us?

    I have a question as well.

    > This all things only available in ITB 4.10 or 4.11 but how we can save data by using ITB 4.12 as there was no saveTextFile flag or saveBinaryfile flag in gui_parser.py. So how we get UART output and parser script for it.

    Thank you.

    Fahad

  • Hi Fahad,

    We are working on adding the save data functionality back into the visualizer. If you look through the code, you'll see the visualizer was significantly updated from ITB 4.11 to ITB 4.12, and this prevented us from adding the save function in. You're more than welcome to modify 4.12 to add it back. It is just a python script after all. I am reviewing with the team to see if we're able to offer this script online. I will follow up soon.

    Best,

    Nate

  • Hi Nate,

    Thank you very much for your response. I understand and I'm looking through python script but I didn't understand it fully because we have to add different things in the scripts because ITB 4.11 is long enough. So better from your side will be highly appreciated. so is there any way in 4.12 to save the data.

    > I'm just thinking and want to ask if possible that I run the gui_main.py and at the same time call the parser function as well for 4.11 or 4.12? so it can save the UART data or read the data so we can then add script to get the data saved.

    kind regards,

    Fahad

  • Hi Nate,

    Is that possible to modify the baud rate of UART in those python codes?

    BTW, you mentioned about the compatibility, can I ask both the hardware spec. of your used computer? (e.g. USB 2.0 or 3.0, etc.)

    Shihyu.

  • Hi Shihyu,

    That is possible. Another thing you might try to do is lower the 1000 frames down to 10 or 50 frames. I know you tried with 100, but it seems clear to me that your computer is having trouble processing the data fast enough for the PC. You might also make sure your laptop is plugged into power and it's set to performance mode to keep the CPU running fast enough. My computer uses USB 3.0 too if you think that's relevant.

    Best,

    Nate

  • Hi Nate,

    So if possible, would you please tell me how and where to modify the baud rate in codes?

    Thanks

    Shihyu.

  • Hi Nate,

    Please also check my question as well and also please give me some suggestion that after getting the bin file from people counting lab how we can parse that data for readable purpose.

    Kind regards,

    Fahad

  • Hi Fahad,

    Attached is the script I use to convert between the two. It is written in MATLAB, so it may need to be modified if you don't use MATLAB.

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/1023/bin2fhist_5F00_3DPC.m

  • Hi Nate,

    Thank you for sharing. Can this script is also useful when I collect UART data through tera term and then parse through script is it work? or Data through DCA1000 or data through the above suggestion when we set flag of savebin file to 1.

    Kind regards,

    Fahad

  • Hi Nate,

    I saved some of the data as shown below through set self.savebin file flag to 1. But I have a question what does this so many file means by name of phistbytes?

    Second question is that I put all details in matlab script is this correct as shown below.

    Third question I ran the script and got an error and also .mat file is empty shown below.

    Last question is: Can this script is also useful when I collect UART data through tera term and then parse through script is it work? or Data through DCA1000 or data through the above suggestion when we set flag of savebin file to 1.

    Your help is highly appreciated.

    Kind regards,

    Fahad

  • Hi Fahad,

    Please review the code before posting questions online. In the python code, you will see that every 1000 frames (or whatever number you set to) the code saves a file of the previous 1000 (or however many) frames. 

    Third question I ran the script and got an error and also .mat file is empty shown below.

    This looks like a bad file path. You can debug it in MATLAB. You may be missing a backslash or you have an extra one in your filename.

    Last question is: Can this script is also useful when I collect UART data through tera term and then parse through script is it work? or Data through DCA1000 or data through the above suggestion when we set flag of savebin file to 1.

    This script will also work on data taken through a serial tool like tera term, but it does not support the DCA1000 data output.

    Best,

    Nate

  • Hi Nate,

    I'm still waiting the answer about how to modify the UART baud rate in codes.

    Would you please give me the steps to achieve, thanks.

    Shihyu.

  • Hi Shihyu,

    You'll have to modify the baud rate on the device in the Pcount3DDemo_platformInit() function of mss_main.c

    You can modify the baud rate of the python in the connectComPorts function of gui_parser.py

    Best,

    Nate

  • Hi Nate,

    Would it be possible that provide another Matlab script; bin2fhist_3DPC.m for me which can decode the point cloud data in binary file for "mmwave_industrial_toolbox_4_11_0" version?

    I found that this script can only feasible for version 4.12. Since the Frame Header structure is different and some variables used in codes make the error while running.

    Thanks a lot.

    Shihyu.

  • Hi Shihyu,

    Yo can try this version. I would say that all of the code given here may need modification. It's not kept up-to-date (as you can see), so don't be afraid to make changes to the code.

    Best,

    Nate

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/1023/1565.bin2fhist_5F00_3DPC.m

  • Hi Nate,

    In the python code, you will see that every 1000 frames (or whatever number you set to) the code saves a file of the previous 1000 (or however many) frames. 

    It means if I set 10 frames so it gives me 10 pHistbytes_0.bin files. From pHistbytes_0 to pHistBytes_10 right?

    You cannot give me my second question answer also attached here. Is this correct? I just made these changes.

    This looks like a bad file path. You can debug it in MATLAB. You may be missing a backslash or you have an extra one in your filename.

    So I attached my filename above and also please clarify it more to me please. I tries by adding and removing the backslash in the above filename and file path but the same error I got.

    > Please also help me about the different bin files as given in question 1 above. How I can parse them and get readable results.

    Kind regards,

    Fahad

  • Hi Fahad

    It means if I set 10 frames so it gives me 10 pHistbytes_0.bin files. From pHistbytes_0 to pHistBytes_10 right?

    This is not correct. If you set to 10 frames, then the file will save every 10 frames, and you will have pHistBytes files containing 10 frames each, with a number that depends on how long the sensor runs for.

    So I attached my filename above and also please clarify it more to me please. I tries by adding and removing the backslash in the above filename and file path but the same error I got.

    I suspect it's a compatibility issue with your computer. You will have to see if the file exists in the path that the script searches for it. This is not a script that we provide product support for, as it's just used by me locally to parse my own data. Hence, you will have to port it to your own system.

    Best,

    Nate

  • Hi Nate,

    Thank you for your response.

    This is not correct. If you set to 10 frames, then the file will save every 10 frames, and you will have pHistBytes files containing 10 frames each, with a number that depends on how long the sensor runs for.

    Alright I understand now, it means I got 20 different files with name of pHistBytes.bin and all these files contains 10 frames of data each. After every 10 frames it creates 1 bin file right? and it depends how long sensor runs and creates a bin files that contains 10 frames of data and so on. 

    You cannot give me my second question answer also attached here. Is this correct? I just made these changes.

    > please also help me in parsing the pHistbytes files.

    Kind regards,

    Fahad

  • Hi Fahad,

    The script given will parse these files into a .mat file that is readable. You will need to debug this script yourself if it does not work as expected, as it is not a part of our supported collateral.

    Best,

    Nate

  • Hi Nate,

    Please also told me about the MATLAB version best for it I found that my matlab version is not good for the TI scripts or the scripts you share with me. Currently I'm using 2022a.

    Thank you very much for your support and help.

    Fahad

  • Hi Nate,

    As from the above error I solved it but again found a new error which is:

    Index exceeds the number of array elements (0).

    Error in bin2fhist_3DPC (line 123)
    magicBytes = typecast(uint8(rxHeader(1:8)), 'uint64');

    I tried it alot but never solved it.

    kind regards,

    Fahad

  • Hi Fahad,

    As I said before, you will need to debug this script yourself if it does not work as expected, as it is not a part of our supported collateral. I am closing this thread now as it has drifted well beyond the initial inquiry.

    Best,

    Nate