The bug was resolved after skipping out-of-area processing in the octomap addition process.
Changed parameter names because they were confusing.
When displaying an octomap in rviz, you can switch between OccupiedVoxels, FreeVoxels, and AllVoxels by changing MotionPlannning->SceneGeometry->VoxelRendering, and all will fit within the specified area.
In particular, I think the FreeVoxels did not fit within the area, and that was the cause of the bug.
However, the order of execution of the original code was strange, so it is possible that there are other causes.
Description
The bug was resolved after skipping out-of-area processing in the octomap addition process. Changed parameter names because they were confusing. When displaying an octomap in rviz, you can switch between OccupiedVoxels, FreeVoxels, and AllVoxels by changing MotionPlannning->SceneGeometry->VoxelRendering, and all will fit within the specified area. In particular, I think the FreeVoxels did not fit within the area, and that was the cause of the bug. However, the order of execution of the original code was strange, so it is possible that there are other causes.