This paper proposes a dynamic window with virtual goal (DW-VG) method for local collision avoidance in dynamic environments. Firstly, the debounce filter and polynomial curve-fitting algorithm are combined to predict the trajectory of the obstacles with timestamps. Based on the motion prediction of the obstacles, the virtual goal is proposed to replace the real goal, so that the robot can escape from the concave trap and avoid the dynamic obstacles. According to the timestamps and virtual goal, the optimal linear and angular velocities are selected from the dynamic window, which drive the robot toward its real goal. The simulation and experimental results show that the DW-VG method can not only escape the local minima and avoid dynamic obstacles but also is applicable to the dense environment. Furthermore, the simulation results also verify that the DW-VG method drives the robot to reach its goal faster and safer than other reactive obstacle avoidance methods.