Hello
I am currently involved in a project to teach FlightGear how to land with artificial intelligence using a selected aircraft.
Part of this project includes the implementation of a correct environment reset function which should re-position our selected aircraft (Cessna 172p Skyhawk) in the simulator (implied by given parameters like latitude, longitude, altitude, airspeed, ...) after a specified amount of time.
We already implemented a prototype script in Nasal for said purpose (and it seems to work in most situations), but in case of an accident the reset results in complete chaos. While our reset function repairs all damage before setting the aircraft back and does place the aircraft in the correct reset position, the aircraft behaves erratically. It turns upside down after it flies for 0.5 seconds, does barrel rolls etc. After a few subsequent resets, the plane stops behaving erratically.
Does anyone have experience with the reset function? Is such a reset procedure even possible without changing the internal subsystems to an inconsistent state?
Kind Regards
Reset Properties:
var cp2_aileron = 0;
var cp2_elevator = 0.3;
var cp2_rudder = 0;
var cp2_flaps = 1;
var cp2_throttle = 0.2;
var cp2_mixture = 0.5;
var cp2_latitude_deg = 21.3252466948;
var cp2_longitude_deg = -157.946;
var cp2_altitude_ft = 66;
var cp2_airspeed_kt = 33;
var cp2_pitch_deg = -5;
var cp2_roll_deg = 0;
var cp2_heading_deg = 90;