Implementation:CARLA simulator Carla VehicleAckermannControl
| Knowledge Sources | |
|---|---|
| Domains | Vehicle Control, RPC Serialization |
| Last Updated | 2026-02-15 05:00 GMT |
Overview
VehicleAckermannControl is an RPC-serializable class that holds the Ackermann steering control inputs for a vehicle, including steer angle, steer speed, target speed, acceleration, and jerk.
Description
Defined in the carla::rpc namespace (~84 lines), this class represents the control commands for Ackermann steering, which is a kinematically accurate steering model. The five control parameters are:
- steer (float, default 0.0f): desired steering angle
- steer_speed (float, default 0.0f): rate of steering change
- speed (float, default 0.0f): target vehicle speed
- acceleration (float, default 0.0f): target acceleration
- jerk (float, default 0.0f): rate of acceleration change
The class supports MsgPack serialization, equality operators, and UE4 conversion to/from FVehicleAckermannControl when compiled within Unreal Engine.
Usage
Use this type to apply Ackermann steering control commands to vehicles via the CARLA client API, as an alternative to the standard throttle/brake/steer model.
Code Reference
Source Location
- Repository: CARLA
- File:
LibCarla/source/carla/rpc/VehicleAckermannControl.h
Signature
namespace carla {
namespace rpc {
class VehicleAckermannControl {
public:
VehicleAckermannControl() = default;
VehicleAckermannControl(float steer, float steer_speed,
float speed, float acceleration, float jerk);
float steer = 0.0f;
float steer_speed = 0.0f;
float speed = 0.0f;
float acceleration = 0.0f;
float jerk = 0.0f;
bool operator!=(const VehicleAckermannControl &rhs) const;
bool operator==(const VehicleAckermannControl &rhs) const;
MSGPACK_DEFINE_ARRAY(steer, steer_speed, speed, acceleration, jerk);
};
} // namespace rpc
} // namespace carla
Import
#include "carla/rpc/VehicleAckermannControl.h"
I/O Contract
| Field | Type | Default | Description |
|---|---|---|---|
| steer | float |
0.0f | Desired steering angle |
| steer_speed | float |
0.0f | Rate of steering change |
| speed | float |
0.0f | Target vehicle speed |
| acceleration | float |
0.0f | Target acceleration |
| jerk | float |
0.0f | Rate of acceleration change |
Usage Examples
#include "carla/rpc/VehicleAckermannControl.h"
carla::rpc::VehicleAckermannControl control;
control.steer = 0.1f; // slight right turn
control.speed = 10.0f; // 10 m/s target speed
control.acceleration = 2.0f; // 2 m/s^2
// Apply Ackermann control to vehicle
vehicle->ApplyAckermannControl(control);