コード例 #1
0
        //public interface:
        public void LandAtPositionTarget(object controller)
        {
            landAtTarget = true;
            users.Add(controller);

            predictor.users.Add(this);
            vessel.RemoveAllManeuverNodes(); // For the benefit of the landing predictions module

            deployedGears = false;

            // Create a new parachute plan
            parachutePlan = new ParachutePlan(this);
            parachutePlan.StartPlanning();

            if (orbit.PeA < 0)
            {
                setStep(new Landing.CourseCorrection(core));
            }
            else if (UseLowDeorbitStrategy())
            {
                setStep(new Landing.PlaneChange(core));
            }
            else
            {
                setStep(new Landing.DeorbitBurn(core));
            }
        }
コード例 #2
0
        public void ControlParachutes()
        {
            // Firstly - do we have a parachute plan? If not then we had better get one quick!
            if (null == parachutePlan)
            {
                parachutePlan = new ParachutePlan(this);
            }

            // Are there any deployable parachute? If not then there is no point in us being here. Let's switch to cruising to the deceleration burn instead.
            if (!ParachutesDeployable())
            {
                predictor.runErrorSimulations = false;
                parachutePlan.ClearData();
                return;
            }
            else
            {
                predictor.runErrorSimulations = true;
            }

            // Is there an error prediction available? If so add that into the mix
            if (ErrorPredictionReady && !double.IsNaN(errorPrediction.parachuteMultiplier))
            {
                parachutePlan.AddResult(errorPrediction);
            }

            // Has the Landing prediction been updated? If so then we can use the result to refine our parachute plan.
            if (PredictionReady && !double.IsNaN(prediction.parachuteMultiplier))
            {
                parachutePlan.AddResult(prediction);
            }
        }
コード例 #3
0
        public void PatchPredictorPolicy()
        {
            if (parachutePlan == null)
            {
                this.parachutePlan = new ParachutePlan(this);
                this.parachutePlan.StartPlanning();
            }

            predictor.descentSpeedPolicy            = PickDescentSpeedPolicy(); //create a separate IDescentSpeedPolicy object for the simulation
            predictor.decelEndAltitudeASL           = DecelerationEndAltitude();
            predictor.parachuteSemiDeployMultiplier = this.parachutePlan.Multiplier;
        }
コード例 #4
0
        public void LandUntargeted(object controller)
        {
            landAtTarget = false;
            users.Add(controller);

            deployedGears = false;

            // Create a new parachute plan
            this.parachutePlan = new ParachutePlan(this);
            this.parachutePlan.StartPlanning();

            setStep(new Landing.UntargetedDeorbit(core));
        }
コード例 #5
0
        //public interface:
        public void LandAtPositionTarget(object controller)
        {
            landAtTarget = true;
            users.Add(controller);

            predictor.users.Add(this);
            vessel.RemoveAllManeuverNodes(); // For the benefit of the landing predictions module

            deployedGears = false;

            // Create a new parachute plan
            parachutePlan = new ParachutePlan(this);
            parachutePlan.StartPlanning();

            bool useTrajectoriesAtmo = TrajectoriesConnector.isLoadedTrajectories && mainBody.atmosphere;

            if (useTrajectoriesAtmo && orbit.PeA < mainBody.atmosphereDepth)
            {
                setStep(new Landing.AtmosphericCorrection(core));
            }
            else if (orbit.PeA < 0)
            {
                setStep(new Landing.CourseCorrection(core));
            }
            else if (UseLowDeorbitStrategy())
            {
                setStep(new Landing.PlaneChange(core));
            }
            else if (useTrajectoriesAtmo)
            {
                setStep(new Landing.AtmosphericDeorbit(core));
            }
            else
            {
                setStep(new Landing.DeorbitBurn(core));
            }
        }
コード例 #6
0
        public void ControlParachutes()
        {
            // Firstly - do we have a parachute plan? If not then we had better get one quick!
            if (null == parachutePlan)
            {
                parachutePlan = new ParachutePlan(this);
            }

            // Are there any deployable parachute? If not then there is no point in us being here. Let's switch to cruising to the deceleration burn instead.
            if (!ParachutesDeployable())
            {
                predictor.runErrorSimulations = false;
                parachutePlan.ClearData();
                return;
            }
            else
            {
                predictor.runErrorSimulations = true;
            }

            // Is there an error prediction available? If so add that into the mix
            if (ErrorPredictionReady && !double.IsNaN(errorPrediction.parachuteMultiplier))
            {
                parachutePlan.AddResult(errorPrediction);
            }

            // Has the Landing prediction been updated? If so then we can use the result to refine our parachute plan.
            if (PredictionReady && !double.IsNaN(prediction.parachuteMultiplier))
            {
                parachutePlan.AddResult(prediction);
            }
        }
コード例 #7
0
        public void PatchPredictorPolicy()
        {
            if (parachutePlan == null)
            {
                this.parachutePlan = new ParachutePlan(this);
                this.parachutePlan.StartPlanning();
            }

            predictor.descentSpeedPolicy = PickDescentSpeedPolicy(); //create a separate IDescentSpeedPolicy object for the simulation
            predictor.decelEndAltitudeASL = DecelerationEndAltitude();
            predictor.parachuteSemiDeployMultiplier = this.parachutePlan.Multiplier;
        }
コード例 #8
0
        public void LandUntargeted(object controller)
        {
            landAtTarget = false;
            users.Add(controller);

            deployedGears = false;

            // Create a new parachute plan
            this.parachutePlan = new ParachutePlan(this);
            this.parachutePlan.StartPlanning();

            setStep(new Landing.UntargetedDeorbit(core));
        }
コード例 #9
0
        //public interface:
        public void LandAtPositionTarget(object controller)
        {
            landAtTarget = true;
            users.Add(controller);

            predictor.users.Add(this);
            vessel.RemoveAllManeuverNodes(); // For the benefit of the landing predictions module

            deployedGears = false;

            // Create a new parachute plan
            parachutePlan = new ParachutePlan(this);
            parachutePlan.StartPlanning();

            if (orbit.PeA < 0)
                setStep(new Landing.CourseCorrection(core));
            else if (UseLowDeorbitStrategy())
                setStep(new Landing.PlaneChange(core));
            else
                setStep(new Landing.DeorbitBurn(core));
        }
コード例 #10
0
        public void LandUntargeted(object controller)
        {
            users.Add(controller);

            deployedGears = false;

            // Create a new parachute plan
            this.parachutePlan = new ParachutePlan(this);
            this.parachutePlan.StartPlanning();

            landStep = LandStep.UNTARGETED_DEORBIT;
        }
コード例 #11
0
        //public interface:
        public void LandAtPositionTarget(object controller)
        {
            users.Add(controller);

            predictor.users.Add(this);
            vessel.RemoveAllManeuverNodes(); //for the benefit of the landing predictions module

            deployedGears = false;
            deorbitBurnTriggered = false;
            lowDeorbitEndConditionSet = false;
            planeChangeTriggered = false;

            // Create a new parachute plan
            this.parachutePlan = new ParachutePlan(this);
            this.parachutePlan.StartPlanning();

            if (orbit.PeA < 0) landStep = LandStep.COURSE_CORRECTIONS;
            else if (UseLowDeorbitStrategy()) landStep = LandStep.PLANE_CHANGE;
            else landStep = LandStep.DEORBIT_BURN;
        }