Instruments for detecting orientation or position have always represented a very desirable technology that could change the way trade, navigation, warfare, land surveys and many other things function. Naval navigation represented one of the big reasons why many governments, scientific institutes, and independent inventors put so much time and effort into discovering new ways that could help ship locate their exact position into open seas and enable them to travel easily over very long distances away from the coasts that could be used as landmarks for their journeys. While the magnetic compasses and various other devices that used the position of the sun to calculate position and orientation of the ship in the sea were useful, they were not 100% reliable all the time and they could not be used in all situations (most notably, the sun and solar compasses were useless if the ship experienced heavy clouds over period of several days). Even though magnetic compasses were accurate (distinction between true north of the Earth and magnetic north that they pointed to was not problematic in all but some most limiting cases when the ships or land parties were very close to the polar regions), those compasses started experiencing erratic behavior when they started being used on ships that were made from metal hulls. Metal from the ship construction interfered with the way compass worked, twisting the magnetic field of the earth around the ship and thus changing the direction of the compass.
To combat this, many investors around the world tackled the problem of the naval navigation and came to several non-magnetic solutions, many not good enough for regular use but few who had tremendous potential. The most successful one was without the doubt gyrocompass, complicated but very precise non-magnetic compass that was based on a technology that could detect and react to the rotation of the Earth (thus not mislead ships by pointing to the magnetic north which can naturally change position over time), and maintain the position pointed toward the trough north even though any ship rotation. Since gyrocompass was not relying on any magnetic readings, it could be safely used on metal-hull ships, although the reduced amount of rotation very near the polar regions would make even these devices unreliable. They would also work without issues during bad weather and night.
The history of gyrocompass started in the mid to late 1800s. The first model was created the French inventor Jean-Bernard-Leon Foucault in 1852. After it followed several failed attempts in the form of gyrostat made by mathematical physicist and engineer William Thomson (1st Baron of Kelvin) in 1880, and Arthur Krebs' early gyrocompass that enabled French submarine ability to travel automatically in a straight line (which was one of the earliest examples of naval autopilot capability).
The first patent for working model of gyrocompass was awarded to Marinus Gerardus van den Bos in 1885. However, since his design was not practical for use on naval ships, the first usable design was provided by German inventor Hermann Anschütz-Kaempfe in 1906. After a period of testing, his device was successfully integrated into the German Imperial Navy in 1908. United States ships quickly adopted the gyrocompasses that were produced by the Elmer Ambrose Sperry who patented his design in 1908. Devices made by Sperry Gyroscope Company were placed on all US Navy ships during the World War I, and some naval projects also started using gyrocompasses as means in creation automated movement of the ships and submarines. After the WW1, gyrocompass technology was regularly used on ships, submarines, airplanes and zeppelins. In Europe, commercial sale of the gyrocompass started in 1913.