The function iterates through the buffer in 6-byte chunks, extracting
velocity and torque for each sample. The velocity is converted from
Q15 fixed-point format to a floating-point number and rounded to an integer.
Each returned sample is a tuple of the form:
[velocityQ15, torque, velocity], where:
velocityQ15 is the original 32-bit Q15 integer from the buffer
torque is the 16-bit signed integer from the buffer
velocity is the floating-point velocity value converted from Q15 and rounded to an integer
If the buffer length is not a multiple of 6, an error is logged and
an empty array is returned.
Returns
An array of [velocityQ15, torque, velocity] tuples,
one per sample, or an empty array if the buffer is invalid.
Parses a binary HRD data buffer into an array of velocity/torque samples.
Each sample in the buffer consists of:
The function iterates through the buffer in 6-byte chunks, extracting velocity and torque for each sample. The velocity is converted from Q15 fixed-point format to a floating-point number and rounded to an integer.
Each returned sample is a tuple of the form:
[velocityQ15, torque, velocity], where:velocityQ15is the original 32-bit Q15 integer from the buffertorqueis the 16-bit signed integer from the buffervelocityis the floating-point velocity value converted from Q15 and rounded to an integerIf the buffer length is not a multiple of 6, an error is logged and an empty array is returned.
Returns
An array of
[velocityQ15, torque, velocity]tuples, one per sample, or an empty array if the buffer is invalid.