init commit
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
// Gear ratio + final drive coupling between engine and wheels.
|
||||
// Torque flows engine -> wheels; rpm flows wheels -> engine (reflected).
|
||||
class Transmission {
|
||||
public:
|
||||
void set_gear(int gear); // 0 = neutral, 1..N = forward gears
|
||||
int gear() const;
|
||||
|
||||
double output_torque_nm(double engine_torque_nm) const;
|
||||
double reflected_engine_rpm(double wheel_rpm) const;
|
||||
|
||||
private:
|
||||
double ratio() const;
|
||||
|
||||
int m_gear = 1;
|
||||
|
||||
static constexpr double kFinalDrive = 3.42;
|
||||
static constexpr double kGearRatios[] = {0.0, 3.5, 2.1, 1.4, 1.0, 0.8};
|
||||
static constexpr int kNumGears =
|
||||
static_cast<int>(sizeof(kGearRatios) / sizeof(kGearRatios[0])) - 1;
|
||||
};
|
||||
Reference in New Issue
Block a user