Implementing the function to calculate the centroid of the pressure sensor.
Details:
The previous function calculated a number, but we were looking for an x and a y so I changed the function to calculate a position.
Running it as a test without touching the creature will give me position (4,8) as the centroid which does not seem too strange not being (3,5) since the wires are having extra pressure on the sensor and even without any touch we have a black spot at the very bottom of the map.
According to the picture though, one would guess that the centroid should be around (2,3) rather than (4,8). Reason for the seemingly wrong numbers is that the pressure map seems to have numbers that are inversely correlated with the pressure exerted. For example, when the creature is not touched (the above picture), the pressure associated is 0 for the black spot and on average 670 for the white spots.

No comments:
Post a Comment