0

I've got 4 sensors with known positions in a square. Each sensor reports the distance, but not vector, between itself and an object (point P). Unfortuanately the sensors aren't perfectly accurate.

Point P can be anywhere inside or outside the square formed by the sensors.

I'm trying to calculate the best-guess position of the point P.

Diagram of sensors and point

Diagram of sensors and point

Just to make it a bit more real - the sides of the sensor square are 2 meters and the sensor inaccuracy is between 0 and 15cm.

Thinking about it visually - it feels like it could be the geometric center of the area intersection between donuts drawn around each sensor point.

Doing it visually with donuts

The grey area is where point P could be.

Doing it visually with donuts

henster
  • 21
  • Does each sensor report just the distance or the vector to the object? – peter.petrov Jan 26 '21 at 15:57
  • Just the distance @peter.petrov. I'll update the question to be clearer. – henster Jan 26 '21 at 16:00
  • 1
    Why are the donuts in your drawing of different widths? I would expect them to each be the equivalent of 30cm wide, given what you said about the sensory inaccurary. Or does "between 0 and 15cm" mean that some sensors might be known to give a perfectly accurate distance reading while others are known to be off by as much as 15cm? (In any event, some of the widths look close to the separation between the sensors, which seems too large.) – Barry Cipra Jan 26 '21 at 16:07
  • You're right @BarryCipra - the distance between the two circles of each donut should be 30cm. My understanding is that they can be 15cm off in any direction. I've been a bit sloppy and uploaded an image I made while I was thinking about it. Any sensor might be bang on or up to 15cm off at any time. – henster Jan 26 '21 at 16:13
  • The sensor error is linear as the distance increases @PM2Ring. At 0 meters and 10 meters the 15cm error is the same. – henster Jan 26 '21 at 16:16
  • I'll make a better donut diagram.. – henster Jan 26 '21 at 16:18
  • @henster, thanks for the clarification; if you are able to redraw the figure, it might help to do so. Your red region seems to be the correct answer. Keep in mind, though, that in the "real" real world, sensors errors are rarely so sharply defined. – Barry Cipra Jan 26 '21 at 16:20
  • I've attempted to redraw it @BarryCipra. Hopefully it's clearer.. it's certaintly turned out quite pretty. In my words - I'd like to calculate the mid point of the intersection of the outer circles omitting the difference of the inner circles. If that sounds rightish, where would I start reading on how to do that? Ultimately I need to write software to do it. I hear the warning on the sensor error. In reality I might pad that 15cm. – henster Jan 26 '21 at 16:51
  • Do you know how to calculate the intersection points of 2 circles, given their centres and radii? – PM 2Ring Jan 26 '21 at 16:56
  • I have been reading @PM2Ring. Here is an answer from this stack exchange: https://math.stackexchange.com/questions/256100/how-can-i-find-the-points-at-which-two-circles-intersect – henster Jan 26 '21 at 17:00
  • Ok, there's good info in the answers & comments there. In your case, you have 6 pairs of main circles, so that helps you to choose the correct point when a pair of circles has 2 intersections. – PM 2Ring Jan 26 '21 at 17:08
  • 1
    @henster, it is indeed a pretty picture. (It might be easier to understand, though, if only the donuts were colored in, not the inner interior circles as well.) As for computing a "best guess" position for the point P, I could imagine setting up a somewhat messy integral for the centroid of the gray region, or perhaps just computing the six "vertices" of the region and then taking their average. What you do depends in part on how you plan (or need) to interpret the final result. – Barry Cipra Jan 26 '21 at 17:45

2 Answers2

1

Here is a less than beautiful solution using the donuts as described. It places random points and then progressively eliminates irrelevant ones with a simple check whether it's inside/outside a circle bound.

The speed and accuracy are very affected by the number of sampled points.

Creating a polygon from the intersections to get it's centroid would be preferrable, but I haven't been able to figure it out so far.

https://ht-random.s3-eu-west-1.amazonaws.com/sampled-position.html

henster
  • 21
0

Your intuition is almost right. Draw a circle around each of the points A, B, C, D with a radius equal to the distance from the points, if we account for the possible inaccuracy you would want two more circles for each point with a radius $\displaystyle \pm$15cm. The intersection of all the circles would tell you an area of where the position of the point might be however you can not guarantee the exact position of the point. This is a lot like how gps works and maybe understanding that from a youtube video might help you understand this.

John Smith
  • 120
  • 7