Motivation


In Mobile Robotics we started to discuss different types of sensors and how robots localize themselves. A common design pattern is to use a combination of dead reckoning (wheel encoders, IMU data) and GPS data and to get a more accurate measurement than any singular measurement.

<aside> 💡 This sensor fusion is done with Kalman filters, which essential to pretty much all of robotics. I’ll discuss them in a future entry.

</aside>

GPS is the most common and well known approach to robot localization, and it important that I understand it.

The Basics


GPS relies on a distance,distance,distance position fixing scheme in order to fix the position of a given target.

The concept is easier to visualize in 2D:

Screenshot 2023-10-05 at 3.53.18 PM.png

The idea is that if we know the position of 3 bases (satellites) and the respective distance of each to the target, then there is a a unique location where the target can exist. Notice that with just 2 satellites this does not hold true because the circles intersect at two locations, so there is no longer a unique position.

This same concept holds in 3 dimensional space (in 3d space, 3 satellites actually only narrows your location down to 2 points, but one of those points is infeasible/unrealistic, so we can toss it) which forms the basis of GPS.

<aside> đź’ˇ

I questioned why we don’t use angles of some sort, which would eliminate the need for 3 base stations, but I quickly realized that obtaining the angle from which a signal was received from is not easy, and is very error prone. What if the signal bounces?

</aside>

But how do we get the distances D1, D2, and D3? The answer is time. We know the speed of light which is what the signal will travel at, but we don’t know this distance. If we can include a “timestamp” with the signal though, that specifies when it was sent, and we know the current time, we can figure out the distance the signal travelled when we receive it.

<aside> 💡 Not actually a timestamp. In reality PRNs are used (Pseudorandom Number Noise Codes) which serve two purposes: They uniquely identify the satellite and they allow for the receiver to calculate the phase difference between it’s local PRN and the received PRN to find the time delay. This is of course oversimplified, but I don’t have the time to learn signal processing theory behind this.

</aside>

So theoretically, if you knew that amount of time it took for each signal to arrive and you knew the position of each satellite, you could trivially solve for your position with the following SOE.

$$ R_1 = \sqrt{(x_{s1} - x_i)^2 + (y_{s1} - y_i)^2 + (z_{s1} - z_i)^2} $$

$$ R_2 = \sqrt{(x_{s2} - x_i)^2 + (y_{s2} - y_i)^2 + (z_{s2} - z_i)^2} $$