To-Do-List:
modify the centroid code to account for inverse pressure numbers.
Details:
The maximum possible number that we can see in the pressure map is 1023 and it should correspond to zero force/pressure. But we never see that because of many different sources of measurement error such as noise, electrical current leaking, etc. We cannot have negative numbers for the pressure. If you ever see negative numbers in the pressure matrix, it means the code is buggy.
The simplest approach to convert these numbers is to subtract them all from 1023. Then zero pressure will correspond to zero (which we will never observe because of measurement error) and max pressure will correspond to 1023 (we will probably see lots of that in the matrix). Just try that one and see how it works.At this point, I only changed the centroid method to calculate the centroid position accounting for the inverse pressure numbers.
1. subtracting each element of the pressure matrix from 1023.
Using this method, the centroid when the creature is not moving and is in NoTouch position, is calculated to be (5.8, 2.7) which is around the middle of the sensor but more to the upper right corner which as Kerem pointed out is the actual place the extra pressure is mounted.
2. taking logarithm of the numbers in the matrix in base 2 and subtracting them all from 10.
Using this method, the centroid for the same position is calculated to be (5.3, 3.1) which is roughly equal to the other method of calculation but has moved to the right by 1 more block, getting closer to the black spot.
checking in. had a good talk with Bita yesterday.
ReplyDelete