The body of the robot fish is made out of 3D printed material. But one of the problems with 3D printed materials is that it's a little bit porous and not watertight.
I ended up putting a clear coat over it which had some acetone in it, which melted the surface of the plastic and made it a little bit more watertight, finishing it with plumber's tape applied around the seals.
I chose to use a silicon cased fish tail, which isn't as efficient as using propellers most common for underwater vehicles, but I wanted to try make it a little bit bio-inspired.
The robot is controlled thanks to a camera, which has a visual input, and a servo motor. The servo motor controls the position of the fin which will waggle on one side or the other depending on which direction it wants to swim.
By using the camera input I am able to choose a target to track. I can select the colour of the target I would like to track and it will then use a visual processing library called OpenCV to find this specific colour and draw a circle around it. I can then find the position in the image where that object is.
Whether the object is found on the left or right will change the direction the fish will swim in, because I want the fish to swim towards the object. Depending on how big the object is will affect the speed it swims.