The presence range for workpieces (the internal edge of a container's opening) is defined with a visual sensor attached to a robot and the range is divided into a specified number of sectional regions. A robot position suitable for sensing each of the sectional regions is determined, and sensing is performed at the position so that workpieces in the container are picked up.