Advanced Theory of Constraint and Motion Analysis for Robot Mechanisms