18 lines
443 B
C++
18 lines
443 B
C++
#pragma once
|
|
|
|
// Longitudinal vehicle dynamics: converts wheel torque into road speed.
|
|
class Vehicle {
|
|
public:
|
|
void step(double dt, double wheel_torque_nm);
|
|
|
|
double speed_mps() const;
|
|
double wheel_rpm() const;
|
|
|
|
private:
|
|
double m_speed_mps = 0.0;
|
|
|
|
static constexpr double kMassKg = 1400.0;
|
|
static constexpr double kWheelRadiusM = 0.32;
|
|
static constexpr double kDragCoeff = 0.35; // simplified quadratic drag term
|
|
};
|