Implementation:CARLA simulator Carla WheelPhysicsControl
| Knowledge Sources | |
|---|---|
| Domains | Vehicle Physics, RPC Serialization |
| Last Updated | 2026-02-15 05:00 GMT |
Overview
WheelPhysicsControl is an RPC-serializable struct that defines the complete physics parameters for a single vehicle wheel, including tire, suspension, braking, and steering properties.
Description
Defined in the carla::rpc namespace (~260 lines), this struct provides exhaustive per-wheel physics configuration with over 35 parameters organized into categories:
Wheel Properties: axle_type, offset, wheel_radius (30.0f), wheel_width (30.0f), wheel_mass (30.0f), cornering_stiffness (1000.0f), friction_force_multiplier (3.0f), side_slip_modifier, slip_threshold, skid_threshold, max_steer_angle (70.0f).
Drive Configuration: affected_by_steering, affected_by_brake, affected_by_handbrake, affected_by_engine (all default true), abs_enabled, traction_control_enabled (default false), max_wheelspin_rotation, external_torque_combine_method.
Suspension: suspension_axis, suspension_force_offset, suspension_max_raise/drop (10.0f), suspension_damping_ratio (0.5f), wheel_load_ratio, spring_rate (250.0f), spring_preload (50.0f), suspension_smoothing, rollbar_scaling.
Braking: max_brake_torque (1500.0f), max_hand_brake_torque (3000.0f).
State: wheel_index, location, old_location, velocity.
The struct supports UE4 conversion via FromFWheelPhysicsControl static method and operator FWheelPhysicsControl, equality comparison, and MsgPack serialization.
Usage
Use this type as part of VehiclePhysicsControl to configure per-wheel physics behavior for vehicles in the CARLA simulation.
Code Reference
Source Location
- Repository: CARLA
- File:
LibCarla/source/carla/rpc/WheelPhysicsControl.h
Signature
namespace carla {
namespace rpc {
struct WheelPhysicsControl {
uint8_t axle_type = 0;
geom::Vector3D offset;
float wheel_radius = 30.0f;
float wheel_width = 30.0f;
float wheel_mass = 30.0f;
float cornering_stiffness = 1000.0f;
float friction_force_multiplier = 3.0f;
float max_steer_angle = 70.0f;
bool affected_by_steering = true;
bool affected_by_brake = true;
bool affected_by_handbrake = true;
bool affected_by_engine = true;
// Suspension
float suspension_max_raise = 10.0f;
float suspension_max_drop = 10.0f;
float suspension_damping_ratio = 0.5f;
float spring_rate = 250.0f;
// Braking
float max_brake_torque = 1500.0f;
float max_hand_brake_torque = 3000.0f;
// ... additional parameters
bool operator==(const WheelPhysicsControl &rhs) const;
bool operator!=(const WheelPhysicsControl &rhs) const;
MSGPACK_DEFINE_ARRAY(...);
};
} // namespace rpc
} // namespace carla
Import
#include "carla/rpc/WheelPhysicsControl.h"
I/O Contract
| Category | Key Fields | Description |
|---|---|---|
| Wheel | wheel_radius, wheel_width, wheel_mass | Physical wheel dimensions and mass |
| Tire | cornering_stiffness, friction_force_multiplier, slip_threshold | Tire grip characteristics |
| Steering | max_steer_angle, affected_by_steering | Steering behavior |
| Drive | affected_by_engine, affected_by_brake, abs_enabled | Drivetrain connection |
| Suspension | spring_rate, damping_ratio, max_raise, max_drop | Suspension geometry and response |
| Braking | max_brake_torque, max_hand_brake_torque | Braking force limits |
| State | location, velocity, wheel_index | Runtime wheel state |
Usage Examples
#include "carla/rpc/WheelPhysicsControl.h"
auto physics = vehicle->GetPhysicsControl();
// Modify front wheel suspension
for (size_t i = 0; i < 2 && i < physics.wheels.size(); ++i) {
physics.wheels[i].spring_rate = 300.0f;
physics.wheels[i].suspension_damping_ratio = 0.7f;
physics.wheels[i].max_steer_angle = 50.0f;
}
vehicle->ApplyPhysicsControl(physics);