Teat cups are fetched from a teat cup magazine by a gripper carried on a robotic arm. The gripper grips and removes teat cups from the teat cup magazine. The gripper also holds at least one teat cup during transport thereof towards an udder where an animals teats are located. A positioning element determines position estimates representing at least one spatial characteristic of the udder. Based on the position estimates, the robotic arm and the gripper are controlled to attach the teat cups to the teats where the position estimates constitutes a basis for controlling the robotic arm and the gripper to remove teat cups from the teat cup magazine in such a manner that a teat-receiving end of the teat cup attains a horizontal level in the gripper, which horizontal level is adapted to the at least one spatial characteristic of the udder.