mirror of https://github.com/ArduPilot/ardupilot
SITL: improve ICEngine simulation
This commit is contained in:
parent
02babb71b3
commit
e73d43d4f9
|
@ -84,9 +84,12 @@ float ICEngine::update(const Aircraft::sitl_input &input)
|
|||
}
|
||||
if (start_time_us != 0 && state.starter) {
|
||||
uint32_t starter_time_us = (now - start_time_us);
|
||||
if (starter_time_us > 3000*1000UL) {
|
||||
if (starter_time_us > 3000*1000UL && !overheat) {
|
||||
overheat = true;
|
||||
printf("Starter overheat\n");
|
||||
}
|
||||
} else {
|
||||
overheat = false;
|
||||
}
|
||||
|
||||
output:
|
||||
|
|
|
@ -54,5 +54,6 @@ private:
|
|||
};
|
||||
uint8_t value;
|
||||
} state, last_state;
|
||||
bool overheat:1;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -250,6 +250,9 @@ void Plane::calculate_forces(const struct sitl_input &input, Vector3f &rot_accel
|
|||
Vector3f force = getForce(aileron, elevator, rudder);
|
||||
rot_accel = getTorque(aileron, elevator, rudder, force);
|
||||
|
||||
// simulate engine RPM
|
||||
rpm1 = thrust * 7000;
|
||||
|
||||
// scale thrust to newtons
|
||||
thrust *= thrust_scale;
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ protected:
|
|||
bool reverse_elevator_rudder;
|
||||
bool ice_engine;
|
||||
|
||||
ICEngine icengine{2, 4, 5, 6, 100};
|
||||
ICEngine icengine{2, 14, 12, 13, 100};
|
||||
|
||||
float liftCoeff(float alpha) const;
|
||||
float dragCoeff(float alpha) const;
|
||||
|
|
Loading…
Reference in New Issue