On local real algebraic geometry and applications to kinematics