This paper considers the time-optimal motion and obstacle avoidance trajectory generation for industrial robots. Although there are many previous works that had a similar objective, the generation of the trajectory for a general type of robot is still challenging because high computation time is required. This research focuses on a common type of robot that has a simple structure and moving environment. This limitation allows us to generate the trajectory in a much simpler and practical manner. In addition, oscillation suppression can be considered in the trajectory generation in the proposed approach. The real-time modification of the optimal trajectory is often required from a practical point of view. To avoid the recalculation of the trajectory that requires high computation time, we propose a real-time modification method of the trajectory. Simulation and experimental results demonstrate the effectiveness of the proposed methods.