suboptimumg.vehicle.irl_vehicle#

class suboptimumg.vehicle.irl_vehicle.IrlCar(vehicle_model)[source]#

Bases: Car

Car extended with real-world session setup parameters for log analysis.

Accepts an ExtendedVehicleModel which bundles both the simulation car parameters (mass, geometry, aero, etc.) and the session-specific setup (alignment, ackermann curve, suspension stiffness/motion ratios).

Parameters:

vehicle_model (ExtendedVehicleModel) – Unified model containing both car.yaml and vehicle_setup.yaml data.

aero_force_from_pots(front_pot_delta_mm, rear_pot_delta_mm, ax_g=0.0)[source]#

Estimate front/rear aero downforce from shock pot deltas.

Parameters:
  • front_pot_delta_mm (float | ndarray[tuple[Any, ...], dtype[float64]]) – Change in average axle pot displacement from a zero-aero reference state (mm). Positive = compression.

  • rear_pot_delta_mm (float | ndarray[tuple[Any, ...], dtype[float64]]) – Change in average axle pot displacement from a zero-aero reference state (mm). Positive = compression.

  • ax_g (float | ndarray[tuple[Any, ...], dtype[float64]]) – Longitudinal acceleration in g’s. Used to subtract the spring-borne portion of longitudinal weight transfer (accounting for anti-dive/squat).

Returns:

Estimated aero downforce at each axle (N).

Return type:

(front_aero_N, rear_aero_N)

heave_to_force(heave_m, axle)[source]#

Converts Heave displacement (m) to vertical spring force (N).

Parameters:
  • heave_m (float | npt.NDArray[np.float64]) – Heave displacement in meters. Positive = compression.

  • axle (str) – “front” or “rear”, used to select the correct heave stiffness.

Returns:

Vertical spring force in Newtons. Positive = compression.

Return type:

float | npt.NDArray[np.float64]

lateral_weight_transfer(ay_g)[source]#

Lateral weight transfer per axle (elastic component only).

Parameters:

ay_g (float or array) – Lateral acceleration in g’s (positive = turning left).

Returns:

Elastic weight transfer at front and rear axles (N). Positive = load transfer to the outside wheel.

Return type:

(front_wt_N, rear_wt_N)

left_tire_angle(sw_deg)[source]#

Left tire steer angle via ackermann symmetry: -f(-x).

Parameters:

sw_deg (float | ndarray)

Return type:

ndarray

longitudinal_weight_transfer(ax_g)[source]#

Longitudinal weight transfer on the front axle.

Parameters:

ax_g (float or array) – Longitudinal acceleration in g’s (positive = forward accel).

Returns:

Change in front axle normal force (N). Negative under acceleration, positive under braking.

Return type:

float or np.ndarray

pot_to_force(pot_mm, axle)[source]#

Converts shock pot displacement (mm) to vertical spring force (N).

Parameters:
  • pot_mm (float | npt.NDArray[np.float64]) – Shock pot displacement in millimeters. Positive = compression.

  • axle (str) – “front” or “rear”, used to select the correct motion ratio and heave stiffness.

Returns:

Vertical spring force in Newtons. Positive = compression.

Return type:

float | npt.NDArray[np.float64]

pot_to_heave(pot_mm, axle)[source]#

Converts shock pot displacement (mm) to chassis heave displacement (m).

Parameters:
  • pot_mm (float | npt.NDArray[np.float64]) – Shock pot displacement in millimeters. Positive = compression.

  • axle (str) – “front” or “rear”, used to select the correct motion ratio.

Returns:

Heave displacement in meters. Positive = compression.

Return type:

float | npt.NDArray[np.float64]

right_tire_angle(sw_deg)[source]#

Right tire steer angle from the ackermann curve.

Positive sw_deg = right turn (right tire is inner, steers more).

Parameters:

sw_deg (float | ndarray)

Return type:

ndarray

roll_stiffness_distribution()[source]#

Front roll stiffness as a fraction of total (0-1).

Return type:

float

roll_stiffness_total()[source]#

Total roll stiffness (front + rear) in Nm/rad.

Return type:

float

tire_angles(sw_deg)[source]#

Return (left_deg, right_deg) for a given steering input.

Parameters:

sw_deg (float | ndarray)

Return type:

tuple[ndarray, ndarray]