Implementation:CARLA simulator Carla Control API Spec
| Knowledge Sources | |
|---|---|
| Domains | Simulation, Autonomous Driving, API Specification |
| Last Updated | 2026-02-15 05:00 GMT |
Overview
YML specification file that defines vehicle and walker control classes in the CARLA Python API, including VehicleControl, VehicleAckermannControl, and related physics control types.
Description
This YML file specifies the control-related classes for managing vehicle and walker movement in the CARLA simulator. VehicleControl provides typical driving controls with properties for throttle (0.0-1.0), steer (-1.0 to 1.0), brake (0.0-1.0), hand_brake, reverse, manual_gear_shift, and gear. VehicleAckermannControl offers an alternative control model based on Ackermann steering geometry, with steer (radians), steer_speed (rad/s), speed (m/s), acceleration (m/s2), and jerk (m/s3). The file also contains definitions for VehiclePhysicsControl, WalkerControl, and WalkerBoneControlIn/Out classes for fine-grained physics and animation control.
Usage
Use these control classes to programmatically drive vehicles or move walkers in the simulation. VehicleControl is used for standard throttle/brake/steer input, while VehicleAckermannControl provides physics-based Ackermann steering.
Code Reference
Source Location
- Repository: CARLA
- File: PythonAPI/docs/control.yml
Signature
- module_name: carla
classes:
- class_name: VehicleControl
instance_variables:
- var_name: throttle # type: float [0.0, 1.0]
- var_name: steer # type: float [-1.0, 1.0]
- var_name: brake # type: float [0.0, 1.0]
- var_name: hand_brake # type: bool
- var_name: reverse # type: bool
- var_name: manual_gear_shift # type: bool
- var_name: gear # type: int
methods:
- def_name: __init__
- def_name: __eq__
- def_name: __ne__
- def_name: __str__
- class_name: VehicleAckermannControl
instance_variables:
- var_name: steer # type: float (rad)
- var_name: steer_speed # type: float (rad/s)
- var_name: speed # type: float (m/s)
- var_name: acceleration # type: float (m/s2)
- var_name: jerk # type: float (m/s3)
Import
import carla
control = carla.VehicleControl(throttle=1.0, steer=0.0)
ackermann = carla.VehicleAckermannControl(steer=0.1, speed=10.0)
I/O Contract
| Property | Type | Range | Description |
|---|---|---|---|
| throttle | float | [0.0, 1.0] | Vehicle throttle amount |
| steer | float | [-1.0, 1.0] | Steering amount (negative=left, positive=right) |
| brake | float | [0.0, 1.0] | Brake amount |
| hand_brake | bool | True/False | Hand brake engaged |
| reverse | bool | True/False | Move backwards |
| manual_gear_shift | bool | True/False | Manual transmission mode |
| gear | int | 0+ | Current gear |
Usage Examples
import carla
client = carla.Client('localhost', 2000)
world = client.get_world()
# Spawn a vehicle
bp = world.get_blueprint_library().find('vehicle.tesla.model3')
sp = world.get_map().get_spawn_points()[0]
vehicle = world.spawn_actor(bp, sp)
# Apply standard vehicle control
control = carla.VehicleControl(throttle=0.5, steer=0.0, brake=0.0)
vehicle.apply_control(control)
# Apply Ackermann control
ackermann = carla.VehicleAckermannControl(steer=0.1, speed=15.0, acceleration=2.0)
vehicle.apply_ackermann_control(ackermann)