Continuous action space in CARLA

While driving, we don't usually accelerate and brake at the same time; because the action space in CARLA is continuous, and the agent will apply an action at every step, it may be enough to have one command for accelerating and decelerating. Let's now combine the throttle and brake commands into one with a value range of -1 to +1, using the value range between -1 and 0 for the brake command and the value range between 0 and 1 for the throttle or acceleration command. We can define this using the following command:

action_space = gym.space.Box(-1.0, 1.0, shape=2(,))

action[0] signifies the command for steering, while action[1] signifies the value for our combined throttle and brake commands. For now, we will ...

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.