Implementing the step function for the CARLA environment

Once we have initialized the CARLA simulator by sending the CARLA settings object to the CARLA server and calling client.start_episode(start_spot), the driving simulation will begin. We can then use the client.read_data() method to get the data produced by the simulation at a given step. We can do this using the following line of code:

measurements, sensor_data = client.read_data()

Get Hands-On Intelligent Agents with OpenAI Gym now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.