Spaces:
Runtime error
Runtime error
IWR6843: Modify GUI sample code to adapt with UART crash | |
Part Number: IWR6843 Sometimes when the IWR6843 sends data to PC via UART, it got crashed and GUI stops working. With the current GUI version, we must reset both GUI and IWR6843. But my customers may think that device has problem. I want to modify the GUI code to make it work normally without having to reset device, so my customers will believe that problem comes from UART, not from device. We only need to re-open GUI and enter COM port, then data continue transfer. Please tell me which part in python code of GUI can be modified to meet this requirement. | |
Hi Hector, Please see the file gui_main.py. When the send cfg button is pressed, you will see that it does two things: Tells the parser object to send the configuration Starts a timer with duration frame period, which calls the parse function periodically. For your application needs, you will need to add a button that does #2 above. See the sendCfg() function in gui_main.py - essentially you have to have a button activated function that calls the following line: self.parseTimer.start(self.frameTime) self.frameTime is set when the configuration is loaded into the gui, you may need to set it to 50 as default (this is 50 ms). If you are getting an error message when the GUI crashes, can you send a picture? Regards, Justin | |
Hi Justin, GUI only stopped frame numbers and target tracking when it crashed. I don't have any error message. I'll think of the way you mentioned and ask you more later. | |
Hi Justin, I'm not sure what you mean. sendCfg() is made a button in setConfigLayout() as self.sendConfig.clicked.connect(self.sendCfg). Why do I need to make another button? Do you mean by setting self.frameTime = 50, even if GUI crashes, I don't need to reset device, only re-open GUI and can keep getting data? Just simple like that? Please enlighten me if my understanding is wrong. | |
Hi Hector, Your initial problem is that the gui is crashing, but the device is not - correct? So if GUI crashes, you have to restart the gui. Currently, there is no option to start parsing the UART with sending a config to the device (which will usually crash the device, behavior is undefined). So my suggestion is to add an option in the gui to restart the UART parsing without sending a configuration. Regards, Justin | |
Hi Justin, So the reason why I had to reset device even though it's still ok because current GUI version only can parse data after sending Cfg? If we skip it, there's no need to reset device anymore, right? But I think self.parseTimer.start() as you mentioned is only to set timing to parse data after we sent Cfg, not to skip sending Cfg after re-open GUI. Is there any other function in python code I need to notice? | |
Hi Hector, When the timer ticks to 0, it automatically calls the parse thread, and the rest of the gui will do what its supposed to after that. So really the only function to worry about is starting the timer. Regards, Justin | |
Hi Justin, 1. I made GUI work normally without resetting device after GUI crashes. But the fact is, the 1st time I power on the device and send Cfg, I see a boundary box simulating the space we want limit for tracking (room's size, I think). my new GUI can re-open and work well, but I don't see boundary box anymore. Please tell me which part to modify for boundary display after re-open GUI. I think it's in parseCfg(), please tell me more details for it. 2. I attach my video here. You can see there's no boundary after re-open GUI. Besides, another problem is: If I rebuild 3D people count in toolbox and flash program again, the device didn't work. Then, I modified toolbox code a little, now it can work but you can see in the video the tracking box flickering (target number switch between 0 & 1 continuously). This problem doesn't happen if I flash prebuilt bin file from TI, only happen when I rebuild toolbox code. Please see video below and tell me solution for GUI optimization and tracking box flickering problem. https://youtu.be/cn2H3XIp7dI | |
Hi Justin, 1. I made GUI work normally without resetting device after GUI crashes. But the fact is, the 1st time I power on the device and send Cfg, I see a boundary box simulating the space we want limit for tracking (room's size, I think). my new GUI can re-open and work well, but I don't see boundary box anymore. Please tell me which part to modify for boundary display after re-open GUI. I think it's in parseCfg(), please tell me more details for it. 2. I attach my video here. You can see there's no boundary after re-open GUI. Besides, another problem is: If I rebuild 3D people count in toolbox and flash program again, the device didn't work. Then, I modified toolbox code a little, now it can work but you can see in the video the tracking box flickering (target number switch between 0 & 1 continuously). This problem doesn't happen if I flash prebuilt bin file from TI, only happen when I rebuild toolbox code. Weirdly, my manager used the same toolbox version and rebuilt code, ha can do tracking normally. But my PC can't track target, only see point cloud. He said maybe CCS , SDK or other software on my PC are not suitable. I installed all the same as his PC but still has weird status. Previously, I could track normally. But after I flashed another program of HVAC, I couldn't track 3D people count correctly as before. Please see video below and tell me solution for GUI optimization and tracking box flickering problem. Here're 2 versions of my code that does not track normally File 1. Tracking box flickering (file name 3D_4.2) 3D_4.2 toolbox.zip File 2. Tracking ok on my manager PC but only see point cloud without tracking box on my PC (file name 3D_4.2.1) 3D_4.2.1.zip Please tell me if I need to modify any environment settings on PC to get tracking normally as before. | |
Hi Hector, For the issue of the boundary box not appearing, when you reopen the gui, just check the boundary box option "Enable Box" and make sure the right values are set in the menu. These are automatically set when the config is loaded, so if you are reloading the config you have to set it yourself. For the issue of the tracks disappearing - the gui is fairly dumb, it only shows exactly what the device tells it. With this is mind, it is possible that your PC is missing the occasional frame of data - since the gui doesn't get the frame info, it may not draw the track, leading to a flicker. However, it is also possible that somehow the wrong tracker got linked. Do you know how to check the linker settings in CCS? Please ensure that the gtrack library from the 3D People Counting lab is being linked in the linker settings. Regards, Justin | |
Hi Justin, I checked linker library pathin CCS. It linked to toolbox->lab->3D count. It should be correct. But it can't get normal tracking as before. About Enable Box, is there any way to make box automatically enabled without having to click on that check-box? | |