1. A method for controlling a robot in the presence of a moving object, comprising: capturing a plurality of frames from a three-dimensional camera system; analyzing a frame to identify a connected object; comparing the frame to a previous frame to identify a moving connected object (MCO); determining if an unexpected MCO is in the frame; and, if so, instructing the robot to take an action.