Merge remote-tracking branch 'origin/master' into master
This commit is contained in:
commit
32f242983b
|
@ -67,6 +67,12 @@ expected<float> BoostController::observePlant() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
expected<float> BoostController::getSetpoint() const {
|
expected<float> BoostController::getSetpoint() const {
|
||||||
|
// If we're in open loop only mode, disregard any target computation.
|
||||||
|
// Open loop needs to work even in case of invalid closed loop config
|
||||||
|
if (engineConfiguration->boostType != CLOSED_LOOP) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
float rpm = GET_RPM();
|
float rpm = GET_RPM();
|
||||||
|
|
||||||
auto tps = Sensor::get(SensorType::DriverThrottleIntent);
|
auto tps = Sensor::get(SensorType::DriverThrottleIntent);
|
||||||
|
|
|
@ -15,6 +15,7 @@ TEST(BoostControl, Setpoint) {
|
||||||
.WillRepeatedly([](float xRpm, float tps) { return tps * 2; });
|
.WillRepeatedly([](float xRpm, float tps) { return tps * 2; });
|
||||||
|
|
||||||
WITH_ENGINE_TEST_HELPER(TEST_ENGINE);
|
WITH_ENGINE_TEST_HELPER(TEST_ENGINE);
|
||||||
|
engineConfiguration->boostType = CLOSED_LOOP;
|
||||||
|
|
||||||
BoostController bc;
|
BoostController bc;
|
||||||
INJECT_ENGINE_REFERENCE(&bc);
|
INJECT_ENGINE_REFERENCE(&bc);
|
||||||
|
|
Loading…
Reference in New Issue