A system includes a robotic arm, a laser, and a processor. The processor is configured to command the robotic arm to move to a first location corresponding to an expected teat position of a first teat. The processor is further configured to determine whether the first teat is found in a first scan by the laser, and if so, command the robotic arm to move to a second location corresponding to the location in the scan. The processor is further configured to determine whether the first teat is found in a second scan by the laser, and if so, determine whether the first teat is within a predetermined distance from a current location of the robotic arm. If the first teat is within the predetermined distance from the current location of the robotic arm, the processor commands the robotic arm to attach a teat cup to the first teat.