IWR6843-Read-Data-Python-MMWAVE-SDK icon indicating copy to clipboard operation
IWR6843-Read-Data-Python-MMWAVE-SDK copied to clipboard

[FEATURE]A suggestion on the code in file mmw_parse_script.py and what is the protocol of serial port communication between PC and the board?

Open ecefreshman opened this issue 10 months ago • 0 comments

Thanks if you can provide the communication protocol of serial port communication between PC and the board or where it was memtioned.

The class MyWidget can be modified as follows. Then you can see the GUI though still without any points.

class MyWidget(pg.GraphicsLayoutWidget):
    
    def __init__(self, parent=None):
        super().__init__(parent=parent)

        self.timer = QtCore.QTimer(self)
        self.timer.setInterval(100) # in milliseconds
        self.timer.start()
        self.timer.timeout.connect(self.onNewData)

        self.plotItem = self.addPlot(title="Lidar points")

        self.plotDataItem = self.plotItem.plot([], pen=None, 
            symbolBrush=(255,0,0), symbolSize=5, symbolPen=None)


    def setData(self, x, y):
        self.plotDataItem.setData(x, y)

    # Funtion to update the data and display in the plot
    def update(self):
        
        dataOk = 0
        global detObj
        x = []
        y = []
        
        # Read and parse the received data
        dataOk, frameNumber, detObj = readAndParseData14xx(Dataport, configParameters)
        if dataOk and len(detObj["x"]) > 0:
            #print(detObj)
            x = detObj["x"]
            y = detObj["y"]

        return dataOk, x, y


    def onNewData(self):
        
        # Update the data and check if the data is okay        
        dataOk,newx,newy = self.update()

        #if dataOk:
            # Store the current frame into frameData
            #frameData[currentIndex] = detObj
            #currentIndex += 1
        
        x = newx
        y = newy
        self.setData(x, y)

ecefreshman avatar Feb 23 '25 11:02 ecefreshman