void DriveVerticalAscent(FlightCtrlState s)
        {
            if (timedLaunch)
            {
                status = "Awaiting liftoff";
                core.attitude.AxisControl(false, false, false);
                return;
            }

            if (!ascentPath.IsVerticalAscent(vesselState.altitudeASL, vesselState.speedSurface))
            {
                mode = AscentMode.GRAVITY_TURN;
            }
            if (autoThrottle && orbit.ApA > desiredOrbitAltitude)
            {
                mode = AscentMode.COAST_TO_APOAPSIS;
            }

            //during the vertical ascent we just thrust straight up at max throttle
            if (forceRoll)
            { // pre-align roll unless correctiveSteering is active as it would just interfere with that
                double desiredHeading = OrbitalManeuverCalculator.HeadingForLaunchInclination(vessel.mainBody, desiredInclination, launchLatitude, OrbitalManeuverCalculator.CircularOrbitSpeed(vessel.mainBody, desiredOrbitAltitude + mainBody.Radius));
                core.attitude.attitudeTo(desiredHeading, 90, verticalRoll, this);
            }
            else
            {
                core.attitude.attitudeTo(Vector3d.up, AttitudeReference.SURFACE_NORTH, this);
            }

            core.attitude.AxisControl(!vessel.Landed, !vessel.Landed, !vessel.Landed && vesselState.altitudeBottom > 50);

            if (autoThrottle)
            {
                core.thrust.targetThrottle = 1.0F;
            }

            if (!vessel.LiftedOff() || vessel.Landed)
            {
                status = "Awaiting liftoff";
            }
            else
            {
                status = "Vertical ascent";
            }
        }
Пример #2
0
        void DriveVerticalAscent(FlightCtrlState s)
        {
            if (timedLaunch)
            {
                status = "Awaiting liftoff";
                return;
            }

            if (!ascentPath.IsVerticalAscent(vesselState.altitudeASL, vesselState.speedSurface))
            {
                mode = AscentMode.GRAVITY_TURN;
            }
            if (autoThrottle && orbit.ApA > desiredOrbitAltitude)
            {
                mode = AscentMode.COAST_TO_APOAPSIS;
            }

            //during the vertical ascent we just thrust straight up at max throttle
            if (forceRoll && vesselState.altitudeTrue > 50)
            { // pre-align roll unless correctiveSteering is active as it would just interfere with that
                core.attitude.attitudeTo(90 - desiredInclination, 90, verticalRoll, this);
            }
            else
            {
                core.attitude.attitudeTo(Vector3d.up, AttitudeReference.SURFACE_NORTH, this);
            }
            if (autoThrottle)
            {
                core.thrust.targetThrottle = 1.0F;
            }

            if (!vessel.LiftedOff())
            {
                status = "Awaiting liftoff";
            }
            else
            {
                status = "Vertical ascent";
            }
        }