Optimizing NeRF-based SLAM with Trajectory Smoothness Constraints