How to do a compass/heading indicator
Damped track, locked track.

The compass has a limit distance/surface constraint to keep it on the surface of the earth.  There are other options.  It uses a damped track constraint to keep its local -Z axis pointing at the center of the earth.
The needle is parented to the compass.  It uses a locked track constraint to allow it to rotate in only a single axis.  It tracks a marker I've placed at the sphere's pole, parented to the sphere.
No matter how you move the sphere or the compass, the compass will remain glued to the surface of the sphere and oriented with it, and the needle will point at the north pole.
Your own axes are going to depend on how your orient your objects.  I've used empties here for my constraints, but strictly speaking, they're unnecessary; you can give constraints directly to objects and they will behave the same.
If you want to do it to something that's not a sphere, you might no longer be able to just use the origin of the object (definitely not for a limit distance constraint), but you can use shrinkwrap constraints instead, and you can locked track empties that are shrinkwrapped to non-rendering, negatively displaced copies of your mesh to acquire orientation.