A periscope.
Google it for the diagram and u will understand why.
To see over walls and in submarines
A Periscope or Radar
periscope
On the newer class submarines that don't employ optics, they're called "Photonics Masts". But it's still a Periscope.
They were used in the first world war in submarines. The are used now also for submarines and also war tanks. The outer coating of the periscope for the submarines were firm and waterproof for protection from the water pressure. As for the war tank the periscope is able to turn 360 degrees.
It depends on the submarine. If measure the distance from the top a fully extended periscope to the bottom of the boat you will get the "Depth of the Keel" at which the periscope is out of the water. Generally between 30 feet and 70 feet.
PERISCOPE
Yes sonar can be used at periscope depth. Surface ships also have sonar arrays on them. They are usually used to detect submarines.
The Captain used the periscope to locate the enemy ships.A periscope is the eye of a submarine.
Basically to see around corners, do it twice and you have the device that's common on submarines.