On f-invariant and attractive affine varieties for continuous-time polynomial systems: The case of robot motion planning