This paper introduces a sophisticated trajectory capture and playback mechanism for collaborative robots, aimed at enhancing accuracy and operational efficiency through several innovative techniques. The Ju-Gibbs attitude quaternion is utilized for enhanced kinematic modeling across multi-axis systems, which simplifies variables, reduces dimensions, and enhances symbolic clarity, thus surpassing the limitations of traditional rotation vectors and unit quaternions. A new sliding filter is developed to effectively reduce noise and optimize trajectory details more efficiently. Additionally, an automated mechanism is implemented for adjusting the sampling rate and removing static data points at the trajectory’s start and end, further refining data collection accuracy. These advancements have been successfully replicated on the Kuka robot LBR iiwa 7 R800, demonstrating the practical applicability of the solutions in real-world settings.