The trajectory tracking control of a 6-degree-offreedom (DOF) rigid robot arm is described in this paper. The trajectories for the joint variables are generated in third-order spline form using general constrained nonlinear optimization, taking into consideration the joint position, velocity, acceleration, jerk and overall current consumption constraints during the movement. The trajectory tracking of the individual joints is solved using a discrete-time linear controller design. The obtained trajectories are previously checked to avoid collisions using oriented bounding boxes and their separating axis theorem tests. The complete inverse kinematics of the arm is symbolically calculated in the Mathematica computing environment and implemented in C++. Simulations and measurements show the applicability of the proposed method.