If there are pedestrians spawned with AI controllers, this line will return a bounding box with x and y being -Inf for the AI controllers and causes an cannot convert float NaN to integer error. Seems like it's because the segregated pedestrian actors group contain a mix of carla.libcarla.WalkerAIController and carla.libcarla.Walker.