Example #1
0
 public override void Init()
 {
     base.Init();
     Dtol = LTRJ.Dtol;
     CorrectionTimer.Period = LTRJ.CorrectionTimer;
     StageTimer.action      = () =>
     {
         VSL.ActivateNextStage();
         Message("Have to drop ballast to decelerate...");
     };
     dP_up_timer.action = () =>
     {
         dP_threshold = Utils.ClampL(dP_threshold * 0.9, LTRJ.MinDPressure);
         last_dP      = VSL.vessel.dynamicPressurekPa;
     };
     dP_down_timer.action = () =>
     {
         dP_threshold = Utils.ClampH(dP_threshold * 1.1, LTRJ.MaxDPressure);
         last_dP      = VSL.vessel.dynamicPressurekPa;
     };
     NoEnginesTimer.action = () =>
     {
         landing_stage = LandingStage.HardLanding;
     };
     sim                  = new AtmoSim(VSL);
     Executor             = new ManeuverExecutor(TCA);
     scanner              = new PQS_Scanner(VSL);
     scanner.MaxUnevennes = GLB.LND.MaxUnevenness / 3;
     dP_threshold         = LTRJ.MaxDPressure;
     last_Err             = 0;
     last_dP              = 0;
     Working              = false;
 }
 public override void Init()
 {
     base.Init();
     rocket_pid.setPID(C.RocketPID);
     jets_pid.setPID(C.JetsPID);
     Falling.Period = C.FallingTime;
     CFG.VF.AddHandler(this, VFlight.AltitudeControl);
     if (VSL.LandedOrSplashed)
     {
         CFG.DesiredAltitude = -10;
     }
     sim = new AtmoSim(TCA);
 }
        double correct_launch(bool allow_wait = true)
        {
            var TTR = AngleDelta(TargetOrbit, ToOrbit.Target, ToOrbit.ApAUT) / 360 * TargetOrbit.period;

            ToOrbit.LaunchUT += TTR;
            if (allow_wait && ToOrbit.LaunchUT - VSL.Physics.UT <= 0)
            {
                ToOrbit.LaunchUT += TargetOrbit.period;
            }
            ToOrbit.ApAUT = ToOrbit.LaunchUT +
                            AtmoSim.FromSurfaceTTA(VSL, ToOrbit.TargetR - Body.Radius,
                                                   ToOrbit.ArcDistance, GLB.ORB.GTurnCurve,
                                                   Vector3d.Dot(SurfaceVel, Vector3d.Exclude(VesselOrbit.pos, ToOrbit.Target - VesselOrbit.pos).normalized));
            ToOrbit.Target = QuaternionD.AngleAxis((VSL.Physics.UT - ToOrbit.LaunchUT) / Body.rotationPeriod * 360, Body.angularVelocity.xzy) *
                             ToOrbitIniApV.normalized * TargetOrbit.getRelativePositionAtUT(ToOrbit.ApAUT).magnitude;
//			LogF("TTR: {}, LaunchT {}, ApAT {}", TTR, ToOrbit.LaunchUT-VSL.Physics.UT, ToOrbit.ApAUT-ToOrbit.LaunchUT);//debug
            return(TTR);
        }
Example #4
0
 public override void Init()
 {
     base.Init();
     Dtol = LTRJ.Dtol;
     CorrectionTimer.Period = LTRJ.CorrectionTimer;
     StageTimer.action      = () =>
     {
         VSL.ActivateNextStage();
         Message("Have to drop ballast to decelerate...");
     };
     dP_up_timer.action = () =>
     {
         dP_threshold = Utils.ClampL(dP_threshold * 0.9, LTRJ.MinDPressure);
         last_dP      = VSL.vessel.dynamicPressurekPa;
     };
     dP_down_timer.action = () =>
     {
         dP_threshold = Utils.ClampH(dP_threshold * 1.1, LTRJ.MaxDPressure);
         last_dP      = VSL.vessel.dynamicPressurekPa;
     };
     sim      = new AtmoSim(Body, VSL);
     Executor = new ManeuverExecutor(TCA);
 }
Example #5
0
        public static double FromSurfaceTTA(VesselWrapper VSL, double ApA, double alpha, double gturn_curve, double surface_vel)
        {
            var sim = new AtmoSim(VSL);

            return(sim.FromSurfaceTTA(ApA, alpha, gturn_curve, surface_vel));
        }
 public static double FromSurfaceTTA(VesselWrapper VSL, double ApA, double alpha, double gturn_curve, double surface_vel)
 {
     var sim = new AtmoSim(VSL.Body, VSL);
     return sim.FromSurfaceTTA(ApA, alpha, gturn_curve, surface_vel);
 }