To make it easy to test the basics of our environment implementation, we will implement a simple main() routine so we can run the environment as a script. This will show us if the basic interfaces have been set up correctly, as well as how the environment actually looks!
The main routine of the carla_env.py file is shown in the following snippet. This file creates an instance of the default CarlaEnv and runs five episodes with a fixed action of going forward. The ENV_CONFIG action, which we created during initialization, can be changed to use discrete or continuous action spaces, as follows:
# Part of https://github.com/PacktPublishing/Hands-On-Intelligent-Agents-with-OpenAI-Gym/ch7/carla-gym/carla_gym/envs/carla_env.py ...