In this paper, we introduce a cleaner-robot, which has arm-like mechanism for vacuum cleaning, and we also propose the control method, which realizes complex task with the cleaner-robot. This method is based on the real-time optimization for nonlinear dynamical systems. Our method has three features. The first is to include penalty concerning main body of robot and arm in performance index. The second is to use feedback timing of real-time optimization for sweeping around targets. The third is to change weight matrices in performance index, during control is going on, using the above timing. By applying the method, robot can perform complex task with simple arm-mechanism.