moved getObstacles function from simulator to environment