In this study, we propose a real-time model predictive control method for leg/wheel mobile robots which simultaneously achieves both obstacle avoidance and wheel allocation at a flexible position. The proposed method generates both obstacle avoidance path and dynamical wheel positions, and controls the heading angle depending on the slope of the predicted path so that the robot can keep a good balance between stability and mobility in narrow and complex spaces like indoor environments. Moreover, we reduce the computational effort of the algorithm by deleting usage of mathematical function in the repetitive numerical computation. Thus the proposed real-time optimization method can be applied to low speed on-board CPUs used in commercially-produced vehicles. We conducted experiments to verify efficacy and feasibility of the real-time implementation of the proposed method. We used a leg/wheel mobile robot which is equipped with two laser range finders to detect obstacles and an embedded CPU whose clock speed is only 80MHz. Experiments indicate that the proposed method achieves improved obstacle avoidance comparing with the previous method in the sense that it generates an avoidance path with balanced allocation of right and left side wheels.