Hi,
I'm working on the 2D People Counting Lab Demo trying to create the python version of the validatechecksum function with respect to the the matlab one released for mmwave Industrial Toolbox 4.0.0.
I'm using the SDK 03.04.00.03 and the binary released with the mmwave IT 4.0.0 for 2D People Counting 68xx.
I tried to convert the matlab validatechecksum function, that is:
function CS = validateChecksum(header)
h = typecast(uint8(header),'uint16');
a = uint32(sum(h));
b = uint16(sum(typecast(a,'uint16')));
CS = uint16(bitcmp(b));
end
in a python equivalent, that I hope could be, as follows:
def checkSum(header):
header = np.frombuffer(header, dtype='uint8')
h = np.frombuffer(header.tobytes(), 'uint16')
a = np.array(np.sum(h), 'uint32')
b = np.array(np.sum(np.frombuffer(a.tobytes(), 'uint16')), 'uint16')
CS = np.array(np.invert(b), 'uint16')
return CS
I did a few experiment, and it seemed to make sense, and the same of the matlab one, but to be secure, I ask you to give me your opinion about it.
Also, I saw that exists a python script from mmwave Industrial Toolbox 4.4.1 and on, that could be used for different demo, including the 2D People Counting. Unfortunately, I didn't find the validation of the checksum function in the python scripts given. Was there a particular choice to not check the checksum value as it was done for the matlab script ?
Finally, Why in the data of the header of the packets received from the mmwave device there is the checksum field ? You 'd like to implement this validation directly in the code the runs on the processor of the device, wouldn't you ? I ask you this question because for what concern the value returned, they are not the same values returned by applying the validation function.
Best Regards
Angelo Claudio Re