We investigate optimal trajectory design for a two-dimensional space robot floating in space. The movement of arms of a space robot induces attitude changes of the base body called the so-called geometric phase and we illustrate that the optimal solution of minimizing the hand trajectory and of removing the final attitude change of the base body is to be a circular path. Then, we propose some ideas for trajectory generation from the view point of variational problems. We examine numerical experiments for the optimal trajectory design.