Looking for the Cartesian coordinates of another smartphone?

Given that I have two smartphones, A and B. If I hold smartphone A, is there a way to determine the location of B in relation to myself?

So, if we had a situation with this image:

cartesian coordinates :

this will tell me that B is in position (2, 1).

Inventive methods, such as using Wi-Fi signal strength to gain a position, are more welcome. Can I also determine if there is a wall between the two phones?

+4
source share
2 answers

As far as I understand, Bluetooth and Wi-Fi signals are moving in a radial wave in all directions, so while you can measure the distance between the two terminals, I doubt that this will give you the correct reading, since it can either be on your "side" circular region, or another equidistant signal source.

Although GPS may be the obvious solution, as it provides exactly what you are looking for, I am not sure if you include this as an option. Once you get two sets of coordinates for devices, it is a matter of calculating the offset (N / S and E / W) from device 1.

This makes me think about the accuracy that GPS gives, given that you have included this issue in Bluetooth, and since Bluetooth has a range of about 15-30 feet (type 2-3), and GPS has an error edge of 25-35 feet, this too may not be the best.

If you make it possible to establish a connection (Bluetooth) between the two devices, you already know your value in this range, but not in which direction. You can get the signal strength measurement from Android 2.1: how can I poll the RSSI value of an existing Bluetooth connection? but again Iโ€™m not sure how to determine in which direction the user relates to you, how close he is, in any direction. Hell, another device may be on top of you or below you, and you will get almost the same thing as near you, at equal distances.

All this is on a โ€œstaticโ€ approach, which means that both devices are stationary. However, if you measure this value, and then take a step to your left and repeat the measurement, you can determine whether you are closer or farther from the source, so with a little trial and error of one of the devices you can determine the relative position, this, however , it may turn out to be inappropriate for you, because you either need to manually inform the phone that you have moved to the left, or re-measure or use something more complicated, for example, observe the phoneโ€™s accelerometer, which could tell you in which direction When you are there, the phone moves and displays the strength of the signal.

Am I losing my mind? Possibly .

There is no answer as far as I'm interested now, just thoughts. Depending on what the application will do, there may be other viable approaches. This is my answer to the dump of my brain, so I hope someone else can read it and come up with a more complex answer, rather than loud thoughts.

+3
source

If the distance from A to B is more than a few meters, then if you can get the GPS coordinates of both A and B, you can easily calculate the distance and support between them using Location.distanceTo () and Location. ToT () method.

Depending on the physical environment, it is likely that two GPS devices that are physically close to each other will use the same satellites to calculate and that the errors will be the same in both. Therefore, in some cases, using GPS can work over short distances.

0
source

Source: https://habr.com/ru/post/1411884/


All Articles