Determining the end of episodes in the CARLA environment