An automatic drilling and riveting robot was designed, consisting of end actuators and a multi-joint rotary robotic arm.The end-effector achieves the operation substitution between different executions unit stations through swinging a conversion table by virtue of its indexing swinging structure.The end-effector works together with the rotary joints of the manipulator to achieve the flexible automation of processing and assembling.The MATLAB simulation was adopted to obtatin the arm motion trajectory, and then the characteristics of the motion space of rotary mechanical arm were tested by using ADMAS simulation.The motion trajectory of the arm can meet the needs of variable curvature panel production.