A method for controlling the trajectory of a robot, in which, in the
cooperative operation of a leading robot having a work tool and a
tracking robot gripping a workpiece, the position and the orientation of
the work tool may be desirably controlled, even when the interpolative
motion is carried out. The robots are cooperatively controlled such that
the position and the orientation of a first tool coordinate system set on
the work tool attached to the leading robot is moved along a desired
trajectory on a second tool coordinate system set on the workpiece
gripped by the tracking robot. During a playback operation after a
teaching operation, the interpolative position data of the tracking robot
is calculated by using the interpolative position data of the leading
robot and the relative positions and the relative orientations data of
the robots. The invention may be applied to a manual feed. The trajectory
may be smoothed by filtering the interpolative position data.