How to have the autonomous stack on a vehicle


My question maybe is very basic. I want to know if it is possible to have the autonomous software stack on a vehicle in Carla. I mean having perception, prediction, planning, control etc. Are there available somewhere or should I write all from scratch?

For more clarifications, Apollo has the full stack of all required modules for self-driving. Does Carla have the same or similar capabilities or it just provides the simulation environment?