Qualify route gain and observe native gate context through ordinary input
This commit is contained in:
@@ -2,6 +2,20 @@
|
||||
class ERR_AircraftRouteRules
|
||||
{
|
||||
static bool Length(float distance) { return distance >= 18 && distance <= 20.05; }
|
||||
// Candidate route-only gain. Desired speed and cyclic magnitude remain bounded
|
||||
// exactly as in the short-translation controller; landing keeps its old gain.
|
||||
static vector Demand(vector target, vector position, vector velocity)
|
||||
{
|
||||
vector error = target - position; error[1] = 0;
|
||||
vector desired = error * 0.25;
|
||||
float speed = desired.Length();
|
||||
if (speed > 0.5) desired = desired * (0.5 / speed);
|
||||
velocity[1] = 0;
|
||||
vector demand = (desired - velocity) * 0.10;
|
||||
float magnitude = demand.Length();
|
||||
if (magnitude > 0.03) demand = demand * (0.03 / magnitude);
|
||||
return demand;
|
||||
}
|
||||
static vector Nearest(vector start, vector end, vector point)
|
||||
{
|
||||
vector leg = end - start; leg[1] = 0;
|
||||
|
||||
Reference in New Issue
Block a user