Third person driving of remote controlled vehicles (such as robots, drones et cetera) is usually done relatively to the direction in which remote car is facing. Usually it means that driver must face the same direction or at least have some mental image of the car position, in order to decide where to turn. In these cases, the reference of directional angle is the frame of the joystick and frame of the car. The problem here is that absolute frame positions are not linked and moving freely in the space. If absolute reference is introduced in the system, movements of the joystick and path of the car can be synchronized in space, such that the remote car will move in the proper direction from the driver perspective. Denoting angle between frame and reference as φ and desired displacement angle as θ, with this formula we get final instruction angle α :

$\alpha=\theta_{j}+(\phi_{j}-\phi_{c})$

Values for generic car and joystick are denoted by j and c indexes respectively. Very good and robust reference for such application is magnetic north.

Using this logic, I have built a prototype system, using two LSM303DLHC compass/accelerometers, two nRF24l01 transciever modules, and two Atmega328p microcontrollers. Each system had improvised directional indicator made of 7-segment LED display.

Every time the wire setup on the each module was changing, I had to re-calibrate the magnetometer to get rid of Hard iron and Soft iron distortions. It is beneficial for the hand held joystick to be also tilt compensated, which would introduce one more reference to the system, the gravitational center of the Earth. By extrapolating the idea, even quadrocopter drones can be controlled by 2 degree-of-freedom joystick, given that its remote control frame could be rotated in three dimensions freely.