Implementation:CARLA simulator Carla AckermannControllerSettings
| Knowledge Sources | |
|---|---|
| Domains | Vehicle Control, RPC Serialization |
| Last Updated | 2026-02-15 05:00 GMT |
Overview
AckermannControllerSettings is an RPC-serializable class that holds the PID controller gain parameters for Ackermann steering vehicle control in the CARLA simulator.
Description
Defined in the carla::rpc namespace, this class stores six float parameters for two PID controllers: speed control (speed_kp, speed_ki, speed_kd) and acceleration control (accel_kp, accel_ki, accel_kd). The class supports MsgPack serialization via MSGPACK_DEFINE_ARRAY, equality comparison operators, and conditional conversion to/from the Unreal Engine type FAckermannControllerSettings when compiled within UE4 (LIBCARLA_INCLUDED_FROM_UE4). All gain parameters default to 0.0f.
Usage
Use this type to configure or query Ackermann steering controller parameters for vehicles via the CARLA client-server RPC interface.
Code Reference
Source Location
- Repository: CARLA
- File:
LibCarla/source/carla/rpc/AckermannControllerSettings.h
Signature
namespace carla {
namespace rpc {
class AckermannControllerSettings {
public:
AckermannControllerSettings() = default;
AckermannControllerSettings(
float speed_kp, float speed_ki, float speed_kd,
float accel_kp, float accel_ki, float accel_kd);
float speed_kp = 0.0f;
float speed_ki = 0.0f;
float speed_kd = 0.0f;
float accel_kp = 0.0f;
float accel_ki = 0.0f;
float accel_kd = 0.0f;
bool operator!=(const AckermannControllerSettings &rhs) const;
bool operator==(const AckermannControllerSettings &rhs) const;
MSGPACK_DEFINE_ARRAY(speed_kp, speed_ki, speed_kd,
accel_kp, accel_ki, accel_kd);
};
} // namespace rpc
} // namespace carla
Import
#include "carla/rpc/AckermannControllerSettings.h"
I/O Contract
| Field | Type | Default | Description |
|---|---|---|---|
| speed_kp | float |
0.0f | Proportional gain for speed PID controller |
| speed_ki | float |
0.0f | Integral gain for speed PID controller |
| speed_kd | float |
0.0f | Derivative gain for speed PID controller |
| accel_kp | float |
0.0f | Proportional gain for acceleration PID controller |
| accel_ki | float |
0.0f | Integral gain for acceleration PID controller |
| accel_kd | float |
0.0f | Derivative gain for acceleration PID controller |
Usage Examples
#include "carla/rpc/AckermannControllerSettings.h"
carla::rpc::AckermannControllerSettings settings(
0.15f, 0.0f, 0.25f, // speed PID gains
0.01f, 0.0f, 0.01f // accel PID gains
);
if (settings != carla::rpc::AckermannControllerSettings()) {
// Non-default settings configured
}