When it is not possible to use remotely operated vehicles (ROVs) or autonomous underwater vehicles (AUVs) with predefined missions to explore complex underwater structures, efficient and safe algorithms for autonomous online exploration are required. In this work we present a robotic exploration algorithm for AUVs which is able to autonomously explore 3D underwater structures. In our proposal, the explored structure must have vertical relief, and the exploration is performed in 2D at a user defined depth. No assumptions are made about the shape of the object, so this makes the algorithm particularly useful to explore unstructured environments. Our approach is able to plan the robot maneuvers to achieve full coverage of the scene with data f...