Hi Josh,
My understanding is that you are trying to integrate a batch of rays into an occupancyMap and are looking to improve your performance. I believe insertRay might be the answer here. Based on your inputs, the following syntax should offer better performance and a more concise API:
% Problem setup
map = occupancyMap(1000,1000);
hitUpdate = 0.9;
freeUpdate = 0.2;
invModel = [freeUpdate hitUpdate];
% Integrate clouds
for i = 1:10
pose = [500 + (rand(1,2)-0.5)*100 rand*2*pi];
pts = (rand(9000,2)-.5)*100 + pose(1:2);
tic;
insertRay(map,pose(:,1:2),pts,invModel);
t = toc
show(map,FastUpdate=1);
end
Note that the overall performance of this code will depend on your machine, the length of rays, and the resolution of the map, but using insertRay to process the pointcloud in batches will likely help.
Best,
Cameron