In this paper, the problem of path planning for active simultaneous localization and mapping (SLAM) is addressed. In order to improve its localization accuracy while autonomously exploring an unknown environment the robot needs to revisit positions seen before. To that end, we propose a path planning algorithm for active SLAM that continuously improves robot’s localization while moving smoothly, without stopping, toward a goal position. The algorithm is based on the D* shortest path graph search algorithm with negative edge weights for finding the shortest path taking into account localization uncertainty. The proposed path planning algorithm is suitable for exploration of highly dynamic environments with moving obstacles and dynamic changes in localization demands. While the algorithm operation is illustrated in simulation experiments, its effectiveness is verified experimentally in real-world scenarios.