This paper presents a generalized complete coverage path planning (CCPP) algorithm and its implementation for a mobile robot. The proposed planner contains two concerns: 1) low working time or low energy consumption, and 2) high human safety. For the first concern, we design the optimal path by incorporating two factors: time and energy costs. Describing the working time and energy in terms of a turning parameter simplifies the optimal path design either for minimizing the time or energy cost. For obstacle avoidance in the CCPP, fixed or moving objects are avoided by proposing a field method describing the effects of factors such as working dangerousness and difficulty on the current robot navigation. The human safety is simultaneously guaranteed by this method. Furthermore, a backstepping controller considering constraints imposed on the control input is established to track the optimal route. An implementation of the proposed CCPP for the experimentally mobile robot equipped with this controller is presented; the verification results demonstrate significant performance and practicality of the proposed strategy.