The complex marine environment and the high energy consumption of shipboard equipment pose challenges to the long-term navigation of autonomous unmanned ships. In wave-induced motion, inertial gyro antirolling technology is used to offset the energy transmitted by waves, but the massive consumption of energy is not conducive to long-term navigation of the unmanned ships. This paper attempts to exploit the wave energy transmitted by the gyro to improve the power supply of the unmanned ship. Firstly, a nonlinear coupling model of the gyro antirolling device and the unmanned ship is established. Secondly, considering various model constraints and physical constraints of the equipment, the energy evaluation objective function of nonlinear model predictive control (NMPC) is designed. In the simulation, the proposed control method can effectively extract electric energy from different waves.