The cost of producing offshore renewable energy could be reduced with underwater robots that can predict waves in real-time.