I'm attempting to implement a variant of Monte Carlo localization in a 2D space with obstacles. While the object is moving around the obstacles the particles flow around the obstacle like in images below. But the weighted mean (arithmetic) of all particles falls outside the distribution on the obstacle. What are other ways of calculating the mean such that the estimate is actually in the distribution outside the obstacle?
(shaded area is non-free space)