Path planning obtains the trajectory from one point to another with the robot’s kinematics model and environment understanding. However, as the localization uncertaining through the odometry sensors is inevitably affected, the position of the moving path will deviate further and further compared to the original path, which leads to path drift in GPS denied environments. This paper proposes a novel path planning algorithm based on Dijkstra to address such issues. By combining statistical characteristics of localization error caused by dead-reckoning, the replanned path with minimum cumulative error is generated with uniforming distribution in the searching space. The simulation verifies the effectiveness of the proposed algorithm. Compared with the path generated by traditional planning algorithm, the result of the proposed algorithm has achieved an effective reduction in cumulative errors. Even if the accuracy of the odometry sensor is quite low, our method can still effectively eliminate the cumulative error during the planning process.