A convex programming approach to the inverse kinematics problem for manipulators under constraints