Fishes have evolved different excellent swimming strategies. To study the influence of tail fin swing on the swimming performance of bionic robot fish, with one joint under the same tail swing frequency and amplitude, we designed a novel robot fish, driven by a double-cam mechanism. By designing the profile of the cam in the mechanism, the robot fish can achieve different undulatory motion trajectory of the caudal fin under the same tail swing frequency and amplitude. The mechanism simulated the undulatory motion of crucian carp. We studied the influence of undulatory motion on the swimming speed of robot fish, which was analyzed by dynamic analysis of the undulatory motion and experiments. According to the experimental results, we can find that the swimming speed of the robotic fish is different under various wave motions. When other conditions are the same, the speed that the robot fish can achieve by imitating the swing motion of the real fish is 1.5 times that of the robot fish doing the cycloid motion. The experimental results correspond to the kinetic analysis results. Furthermore, it is proven that the robot fish with a low caudal peduncle stiffness swims faster under a low swinging frequency, and the speed of a robot fish with a high caudal peduncle stiffness is higher under a high tail swinging frequency.