In planar robot control, the singularity problem is frequently encountered when determining the geometric or kinematic robot model. To overcome this problem, a new method is presented in this paper. Indeed, this method is used to compute the joint positions of 3R robots with high accuracy. The main idea of the proposed method is to use a metaheuristic algorithm for retrieving the coordinates of four reference points in the object image that is captured by a hand-eye camera of the 3R robot. Then, the joint positions are estimated by using a metaheuristic algorithm. The resulting positions are then used for controlling the 3R robot for moving to the desired position. The simulation experiments are conducted by using several metaheuristic algorithms with the same population size (N = 400). The obtained results show the high accuracy of the proposed method in terms of determining the exact positions of the 3R robot joints, which leads to finding the optimal robot trajectory.