An arrangement for attaching teat cups (C1, C2, C3, C4) to the teats (T1, T2, T3, T4) of a milking animal, each teat cup having a teat-receiving end configured to receive one teat of the animal, the arrangement comprising: a teat cup magazine configured to store teat cups (C1, C2, C3, C4), a gripper means configured to grip and remove teat cups from the teat cup magazine and hold at least one removed teat cup (C1, C2) during transport thereof towards an udder where the teats (T1, T2, T3, T4) are located, a robotic arm carrying the gripper means and configured to transport the gripper means holding the at least one removed teat cup, between the teat cup magazine and the teats (T1, T2, T3, T4), a positioning means configured to determine position estimates representing at least one spatial characteristic of the udder, and a control means configured to, based on the position estimates, control the robotic arm and the gripper means to grip and remove at least one teat cup from the teat cup magazine, and to attach the at least one teat cup (C1, C2, C3, C4) to at least one of the teats (T1, T2, T3, T4) and to receive the position estimates representing said at least one spatial characteristic of the udder characterised in that the control means is further configured to in response thereto to determine the horizontal level at which the at least one teat cup shall be gripped relative to its teat-receiving end and to control the robotic arm and the gripper means to remove the at least one teat cup (C1, C2, C3, C4) from the teat cup magazine by gripping the at least one teat cup at the determined horizontal level relative to its teat-receiving end in such a manner that the teat-receiving end of each of the at least one teat cup (C1, C2) attains a horizontal level (z C1, z C2) in the gripper means which horizontal level (z C1, z C2) is adapted to the at least one spatial characteristic of the udder. a teat cup magazine configured to store teat cups (C1, C2, C3, C4), a gripper means configured to grip and remove teat cups from the teat cup magazine and hold at least one removed teat cup (C1, C2) during transport thereof towards an udder where the teats (T1, T2, T3, T4) are located, a robotic arm carrying the gripper means and configured to transport the gripper means holding the at least one removed teat cup, between the teat cup magazine and the teats (T1, T2, T3, T4), a positioning means configured to determine position estimates representing at least one spatial characteristic of the udder, and a control means configured to, based on the position estimates, control the robotic arm and the gripper means to grip and remove at least one teat cup from the teat cup magazine, and to attach the at least one teat cup (C1, C2, C3, C4) to at least one of the teats (T1, T2, T3, T4) and to receive the position estimates representing said at least one spatial characteristic of the udder characterised in that the control means is further configured to in response thereto to determine the horizontal level at which the at least one teat cup shall be gripped relative to its teat-receiving end and to control the robotic arm and the gripper means to remove the at least one teat cup (C1, C2, C3, C4) from the teat cup magazine by gripping the at least one teat cup at the determined horizontal level relative to its teat-receiving end in such a manner that the teat-receiving end of each of the at least one teat cup (C1, C2) attains a horizontal level (z C1, z C2) in the gripper means which horizontal level (z C1, z C2) is adapted to the at least one spatial characteristic of the udder.