.. default-domain:: cpp .. highlight:: cpp .. namespace:: krpc::services::MechJeb AscentGuidance ============== .. class:: AscentGuidance The Ascent Guidance window, which flies the vessel to orbit. .. note:: See the `MechJeb wiki `_ for how to set up this autopilot. .. function:: bool enabled() .. function:: void set_enabled(bool value) Whether the module is enabled. :Game Scenes: Flight .. function:: std::string status() The autopilot status, which depends on the selected ascent type. :Game Scenes: Flight .. function:: AscentType ascent_type() .. function:: void set_ascent_type(AscentType value) The ascent type. :Game Scenes: Flight .. note:: Setting it disengages the autopilot of the other type. .. function:: AscentSettings settings() The Ascent Settings window. :Game Scenes: Flight .. function:: PSGSettings psg_settings() The settings of the :enumerator:`AscentType::psg` ascent, from the Ascent Settings window and the PSG Stages window. :Game Scenes: Flight .. function:: ClassicPath classic_path() The Ascent Path Editor window, with the settings of the :enumerator:`AscentType::classic` ascent. :Game Scenes: Flight .. function:: double desired_orbit_altitude() .. function:: void set_desired_orbit_altitude(double value) The altitude of the final circular orbit, in meters. :Game Scenes: Flight .. note:: Applies to the :enumerator:`AscentType::classic` ascent. .. function:: double desired_inclination() .. function:: void set_desired_inclination(double value) The inclination of the final orbit, in degrees. :Game Scenes: Flight .. function:: double periapsis_altitude() .. function:: void set_periapsis_altitude(double value) The altitude of the periapsis of the target orbit, in meters. :Game Scenes: Flight .. note:: Applies to the :enumerator:`AscentType::psg` ascent. .. function:: double apoapsis_altitude() .. function:: void set_apoapsis_altitude(double value) The altitude of the apoapsis of the target orbit, in meters. :Game Scenes: Flight .. note:: Applies to the :enumerator:`AscentType::psg` ascent. A value below :func:`AscentGuidance::periapsis_altitude`, such as 0, gives a circular orbit, and a negative value a hyperbolic one. .. function:: bool burnout_altitude_flag() .. function:: void set_burnout_altitude_flag(bool value) Whether to reach the target orbit at :func:`AscentGuidance::burnout_altitude`. :Game Scenes: Flight .. note:: Applies to the :enumerator:`AscentType::psg` ascent. When every stage has a fixed burn time, the ascent always burns out at :func:`AscentGuidance::burnout_altitude`. .. function:: double burnout_altitude() .. function:: void set_burnout_altitude(double value) The altitude at which the ascent reaches the target orbit, in meters. MechJeb's window calls it the attach altitude. :Game Scenes: Flight .. note:: Applies to the :enumerator:`AscentType::psg` ascent. See :func:`AscentGuidance::burnout_altitude_flag`. .. function:: double flight_path_angle() .. function:: void set_flight_path_angle(double value) The flight path angle at burnout, in degrees. :Game Scenes: Flight .. note:: Applies to the :enumerator:`AscentType::psg` ascent, when every stage has a fixed burn time. .. function:: bool argument_of_periapsis_flag() .. function:: void set_argument_of_periapsis_flag(bool value) Whether to aim for :func:`AscentGuidance::argument_of_periapsis`. :Game Scenes: Flight .. note:: Applies to the :enumerator:`AscentType::psg` ascent. .. function:: double argument_of_periapsis() .. function:: void set_argument_of_periapsis(double value) The argument of periapsis of the target orbit, in degrees. :Game Scenes: Flight .. note:: Applies to the :enumerator:`AscentType::psg` ascent. Requires :func:`AscentGuidance::argument_of_periapsis_flag`. .. function:: double desired_lan() .. function:: void set_desired_lan(double value) The longitude of the ascending node of a launch to a LAN, in degrees. See :func:`AscentGuidance::launch_to_lan`. :Game Scenes: Flight .. function:: double launch_lan_difference() .. function:: void set_launch_lan_difference(double value) The difference from the target's longitude of the ascending node of a launch into the target's plane, in degrees. :Game Scenes: Flight .. function:: bool override_warp_to_plane() .. function:: void set_override_warp_to_plane(bool value) Whether a timed launch launches at once, rather than at the time it computes. :Game Scenes: Flight .. function:: int32_t warp_count_down() .. function:: void set_warp_count_down(int32_t value) The time before a timed launch at which time warp stops, in seconds. :Game Scenes: Flight .. function:: AscentLaunchMode launch_mode() The launch mode, which gives whether a timed launch is counting down. :Game Scenes: Flight .. function:: double time_to_launch() The time until a timed launch, in seconds. :Game Scenes: Flight .. note:: Requires a :func:`AscentGuidance::launch_mode` other than :enumerator:`AscentLaunchMode::normal`. .. function:: void abort_timed_launch() Abort a timed launch. :Game Scenes: Flight .. function:: void launch_to_target_plane() Count down to a launch into the plane of the target, and set :func:`AscentGuidance::desired_inclination` to match. Throws an exception if there is no target orbiting the body the vessel is on. :Game Scenes: Flight .. note:: The countdown runs while the autopilot is enabled. .. function:: void launch_to_target_lan() Count down to a launch into the plane with the target's longitude of the ascending node, less :func:`AscentGuidance::launch_lan_difference`, and inclination :func:`AscentGuidance::desired_inclination`. Throws an exception if there is no target orbiting the body the vessel is on, or the ascent type is not :enumerator:`AscentType::psg`. :Game Scenes: Flight .. note:: The countdown runs while the autopilot is enabled. .. function:: void launch_to_lan() Count down to a launch into the plane with longitude of the ascending node :func:`AscentGuidance::desired_lan` and inclination :func:`AscentGuidance::desired_inclination`. Throws an exception if the ascent type is not :enumerator:`AscentType::psg`. :Game Scenes: Flight .. note:: The countdown runs while the autopilot is enabled. .. namespace:: krpc::services::MechJeb .. enum-struct:: AscentType The ascent type. See :func:`AscentGuidance::ascent_type`. .. enumerator:: classic The classic ascent path. See :func:`AscentGuidance::classic_path`. .. enumerator:: psg Polynomial SQP Guidance, an optimized ascent, for RSS/RO. See :func:`AscentGuidance::psg_settings`. .. namespace:: krpc::services::MechJeb .. enum-struct:: AscentLaunchMode The launch mode of the ascent autopilot. See :func:`AscentGuidance::launch_mode`. .. enumerator:: normal No timed launch is counting down. .. enumerator:: target_plane A timed launch into the plane of the target. See :func:`AscentGuidance::launch_to_target_plane`. .. enumerator:: target_lan A timed launch to the target's longitude of the ascending node. See :func:`AscentGuidance::launch_to_target_lan`. .. enumerator:: lan A timed launch to a longitude of the ascending node. See :func:`AscentGuidance::launch_to_lan`. AscentSettings -------------- .. class:: AscentSettings The Ascent Settings window, which holds the settings shared by the ascent types. .. function:: bool force_roll() .. function:: void set_force_roll(bool value) Whether the autopilot controls the roll. :Game Scenes: Flight .. function:: double vertical_roll() .. function:: void set_vertical_roll(double value) The roll during the vertical climb, in degrees. :Game Scenes: Flight .. note:: Requires :func:`AscentSettings::force_roll`. .. function:: double turn_roll() .. function:: void set_turn_roll(double value) The roll during the turn, in degrees. :Game Scenes: Flight .. note:: Requires :func:`AscentSettings::force_roll`. .. function:: double roll_altitude() .. function:: void set_roll_altitude(double value) The altitude above which the autopilot controls the roll, in meters. :Game Scenes: Flight .. note:: Requires :func:`AscentSettings::force_roll`. .. function:: bool auto_deploy_solar_panels() .. function:: void set_auto_deploy_solar_panels(bool value) Whether the ascent keeps the solar panels retracted in the atmosphere, and extends them above it. :Game Scenes: Flight .. function:: bool auto_deploy_antennas() .. function:: void set_auto_deploy_antennas(bool value) Whether the ascent keeps the antennas retracted in the atmosphere, and extends them above it. :Game Scenes: Flight .. function:: bool autostage() .. function:: void set_autostage(bool value) Whether the autopilot stages when the current stage runs out of fuel. :Game Scenes: Flight .. function:: AscentStaging staging() The staging settings of the ascent, which apply in place of :func:`Utilities::staging` while the autopilot is enabled. :Game Scenes: Flight .. function:: AscentThrustLimits thrust() The throttle limits of the ascent, which apply in place of :func:`Utilities::thrust` while the autopilot is enabled. :Game Scenes: Flight .. function:: bool autowarp() .. function:: void set_autowarp(bool value) Whether to warp time during the launch countdown and the coasts of the ascent. :Game Scenes: Flight .. function:: bool limiting_angle_of_attack() Whether the angle of attack limit is limiting the steering. :Game Scenes: Flight .. function:: double current_max_angle_of_attack() The largest angle of attack the limit allows now, in degrees. :Game Scenes: Flight AscentStaging ------------- .. class:: AscentStaging The staging settings of the ascent, from the Ascent Settings window. .. note:: The ascent starts with a copy of :func:`Utilities::staging`, and keeps its own settings after that. .. function:: double autostage_pre_delay() .. function:: void set_autostage_pre_delay(double value) The delay before each staging, in seconds. :Game Scenes: Flight .. function:: double autostage_post_delay() .. function:: void set_autostage_post_delay(double value) The delay after each staging, in seconds. :Game Scenes: Flight .. function:: int32_t autostage_limit() .. function:: void set_autostage_limit(int32_t value) The last stage the ascent activates. :Game Scenes: Flight .. function:: bool fairing_max_dynamic_pressure_enabled() .. function:: void set_fairing_max_dynamic_pressure_enabled(bool value) Whether to wait for :func:`AscentStaging::fairing_max_dynamic_pressure` to jettison a fairing. :Game Scenes: Flight .. function:: double fairing_max_dynamic_pressure() .. function:: void set_fairing_max_dynamic_pressure(double value) The largest dynamic pressure at which the ascent jettisons a fairing, in pascals. :Game Scenes: Flight .. note:: Requires :func:`AscentStaging::fairing_max_dynamic_pressure_enabled`. .. function:: bool fairing_min_altitude_enabled() .. function:: void set_fairing_min_altitude_enabled(bool value) Whether to wait for :func:`AscentStaging::fairing_min_altitude` to jettison a fairing. :Game Scenes: Flight .. function:: double fairing_min_altitude() .. function:: void set_fairing_min_altitude(double value) The lowest altitude at which the ascent jettisons a fairing, in meters. :Game Scenes: Flight .. note:: Requires :func:`AscentStaging::fairing_min_altitude_enabled`. .. function:: bool fairing_max_aerothermal_flux_enabled() .. function:: void set_fairing_max_aerothermal_flux_enabled(bool value) Whether to wait for :func:`AscentStaging::fairing_max_aerothermal_flux` to jettison a fairing. :Game Scenes: Flight .. function:: double fairing_max_aerothermal_flux() .. function:: void set_fairing_max_aerothermal_flux(double value) The largest aerothermal flux at which the ascent jettisons a fairing, in :math:`\mathrm{W/m^{2}}`. :Game Scenes: Flight .. note:: Requires :func:`AscentStaging::fairing_max_aerothermal_flux_enabled`. .. function:: double clamp_auto_stage_thrust_pct() .. function:: void set_clamp_auto_stage_thrust_pct(double value) The fraction of full thrust at which the ascent releases the launch clamps. :Game Scenes: Flight .. function:: bool hot_staging() .. function:: void set_hot_staging(bool value) Whether the ascent ignites the next stage before the current one burns out. :Game Scenes: Flight .. function:: double hot_staging_lead_time() .. function:: void set_hot_staging_lead_time(double value) The time before burnout at which a hot staging happens, in seconds. :Game Scenes: Flight .. note:: Requires :func:`AscentStaging::hot_staging`. .. function:: bool drop_solids() .. function:: void set_drop_solids(bool value) Whether the ascent drops the solid boosters of the next stage early, once their thrust no longer pays for their mass. :Game Scenes: Flight .. function:: double drop_solids_twr_pct() .. function:: void set_drop_solids_twr_pct(double value) The fraction of the vessel's thrust-to-weight ratio at which the solid boosters drop, between 0 and 1. :Game Scenes: Flight .. note:: Requires :func:`AscentStaging::drop_solids`. AscentThrustLimits ------------------ .. class:: AscentThrustLimits The throttle limits of the ascent, from the Ascent Settings window. .. note:: The ascent starts with a copy of :func:`Utilities::thrust`, and keeps its own limits after that. The :enumerator:`AscentType::psg` ascent ignores :func:`AscentThrustLimits::limit_throttle` and :func:`AscentThrustLimits::electric_throttle`. .. function:: bool limit_to_prevent_overheats() .. function:: void set_limit_to_prevent_overheats(bool value) Whether to limit the throttle to keep parts from overheating. :Game Scenes: Flight .. function:: bool limit_dynamic_pressure() .. function:: void set_limit_dynamic_pressure(bool value) Whether to limit the dynamic pressure. :Game Scenes: Flight .. function:: double max_dynamic_pressure() .. function:: void set_max_dynamic_pressure(double value) The largest dynamic pressure, in pascals. :Game Scenes: Flight .. note:: Requires :func:`AscentThrustLimits::limit_dynamic_pressure`. .. function:: bool limit_acceleration() .. function:: void set_limit_acceleration(bool value) Whether to limit the acceleration. :Game Scenes: Flight .. function:: double max_acceleration() .. function:: void set_max_acceleration(double value) The largest acceleration, in :math:`\mathrm{m/s^{2}}`. :Game Scenes: Flight .. note:: Requires :func:`AscentThrustLimits::limit_acceleration`. .. function:: bool limit_throttle() .. function:: void set_limit_throttle(bool value) Whether to limit the throttle. :Game Scenes: Flight .. function:: double max_throttle() .. function:: void set_max_throttle(double value) The largest throttle, between 0 and 1. :Game Scenes: Flight .. note:: Requires :func:`AscentThrustLimits::limit_throttle`. .. function:: bool limiter_min_throttle() .. function:: void set_limiter_min_throttle(bool value) Whether to keep the throttle above :func:`AscentThrustLimits::min_throttle`. :Game Scenes: Flight .. function:: double min_throttle() .. function:: void set_min_throttle(double value) The smallest throttle, between 0 and 1. :Game Scenes: Flight .. note:: Requires :func:`AscentThrustLimits::limiter_min_throttle`. .. function:: bool electric_throttle() .. function:: void set_electric_throttle(bool value) Whether to limit the throttle of electric engines to the available power. :Game Scenes: Flight .. function:: double electric_throttle_lo() .. function:: void set_electric_throttle_lo(double value) The charge level at which electric engines stop, between 0 and 1. :Game Scenes: Flight .. note:: Requires :func:`AscentThrustLimits::electric_throttle`. .. function:: double electric_throttle_hi() .. function:: void set_electric_throttle_hi(double value) The charge level at which electric engines run at full throttle, between 0 and 1. :Game Scenes: Flight .. note:: Requires :func:`AscentThrustLimits::electric_throttle`. .. function:: bool limit_to_prevent_unstable_ignition() .. function:: void set_limit_to_prevent_unstable_ignition(bool value) Whether to hold the throttle at zero while the engines' fuel is unstable. :Game Scenes: Flight .. note:: MechJeb shows this setting only with Real Fuels, as stock engines have stable fuel. .. function:: bool auto_rcs_ullaging() .. function:: void set_auto_rcs_ullaging(bool value) Whether to fire the RCS forward to settle the fuel before the engines ignite. :Game Scenes: Flight .. note:: MechJeb shows this setting only with Real Fuels, as stock engines have stable fuel. PSGSettings ----------- .. class:: PSGSettings The settings of the Polynomial SQP Guidance ascent, from the Ascent Settings window and the PSG Stages window, and the state of its guidance. .. note:: PSG plans which stages burn and coast from the vessel. The target orbit is set in :class:`AscentGuidance`. .. function:: double pitch_start_height() .. function:: void set_pitch_start_height(double value) The height above the launch site at which the pitch program starts, in meters. :Game Scenes: Flight .. function:: double pitch_rate() .. function:: void set_pitch_rate(double value) The pitch rate of the pitch program, in :math:`\mathrm{deg/s}`. :Game Scenes: Flight .. function:: double drag_coefficient() .. function:: void set_drag_coefficient(double value) The drag coefficient guidance plans with. :Game Scenes: Flight .. note:: Ignored with :func:`PSGSettings::auto_aero`. .. function:: double reference_area() .. function:: void set_reference_area(double value) The reference area guidance plans with, in :math:`\mathrm{m^{2}}`. :Game Scenes: Flight .. note:: Ignored with :func:`PSGSettings::auto_aero`. .. function:: bool auto_aero() .. function:: void set_auto_aero(bool value) Whether guidance works out :func:`PSGSettings::drag_coefficient` and :func:`PSGSettings::reference_area` from the vessel before each solve. :Game Scenes: Flight .. function:: double limit_q_alpha() .. function:: void set_limit_q_alpha(double value) The limit on dynamic pressure times angle of attack, in :math:`\mathrm{Pa \cdot rad}`. :Game Scenes: Flight .. note:: 0 turns the limit off. MechJeb clamps it to at most 10000. .. function:: double min_delta_v() .. function:: void set_min_delta_v(double value) The smallest delta-v of a stage that guidance plans with, in :math:`\mathrm{m/s}`. :Game Scenes: Flight .. function:: double max_coast() .. function:: void set_max_coast(double value) The longest coast guidance plans, in seconds. :Game Scenes: Flight .. function:: double min_coast() .. function:: void set_min_coast(double value) The shortest coast guidance plans, in seconds. :Game Scenes: Flight .. function:: double ullage_lead_time() .. function:: void set_ullage_lead_time(double value) The time before an ignition at which RCS settles the propellant, in seconds. :Game Scenes: Flight .. function:: double spinup_lead_time() .. function:: void set_spinup_lead_time(double value) The time before staging at which the spin-up starts, in seconds. :Game Scenes: Flight .. function:: double spinup_angular_velocity() .. function:: void set_spinup_angular_velocity(double value) The angular velocity of the spin-up, in :math:`\mathrm{rad/s}`. :Game Scenes: Flight .. note:: MechJeb's window shows it in revolutions per minute. .. function:: bool has_solution() Whether guidance has a solution. :Game Scenes: Flight .. function:: std::string guidance_status() The status of guidance. :Game Scenes: Flight .. function:: double time_to_go() The time to the end of the current burn of the solution, in seconds. :Game Scenes: Flight .. note:: Requires :func:`PSGSettings::has_solution`. .. function:: double velocity_to_go() The delta-v left in the solution, in :math:`\mathrm{m/s}`. :Game Scenes: Flight .. note:: Requires :func:`PSGSettings::has_solution`. .. function:: double pitch() The pitch guidance commands, in degrees. :Game Scenes: Flight .. note:: Requires :func:`PSGSettings::has_solution`. .. function:: double heading() The heading guidance commands, in degrees. :Game Scenes: Flight .. note:: Requires :func:`PSGSettings::has_solution`. ClassicPath ----------- .. class:: ClassicPath The settings of the classic ascent path, from the Ascent Path Editor window and the Ascent Settings window. .. function:: double turn_start_altitude() .. function:: void set_turn_start_altitude(double value) The altitude at which the turn starts, in meters. :Game Scenes: Flight .. function:: double turn_start_velocity() .. function:: void set_turn_start_velocity(double value) The speed at which the turn starts, in :math:`\mathrm{m/s}`. :Game Scenes: Flight .. function:: double turn_end_altitude() .. function:: void set_turn_end_altitude(double value) The altitude at which the turn ends, in meters. :Game Scenes: Flight .. function:: double turn_end_angle() .. function:: void set_turn_end_angle(double value) The final flight path angle, in degrees. :Game Scenes: Flight .. function:: double turn_shape_exponent() .. function:: void set_turn_shape_exponent(double value) The steepness of the turn, between 0 and 1. :Game Scenes: Flight .. function:: bool auto_path() .. function:: void set_auto_path(bool value) Whether the autopilot chooses the turn altitudes and speed. :Game Scenes: Flight .. function:: float auto_turn_percent() .. function:: void set_auto_turn_percent(float value) The altitude at which an automatic turn starts, as a fraction of the height of the atmosphere. :Game Scenes: Flight .. note:: Requires :func:`ClassicPath::auto_path`. .. function:: float auto_turn_speed_factor() .. function:: void set_auto_turn_speed_factor(float value) The factor that sets the speed at which an automatic turn starts. :Game Scenes: Flight .. note:: Requires :func:`ClassicPath::auto_path`. .. function:: double auto_turn_start_altitude() The altitude at which an automatic turn starts, in meters. :Game Scenes: Flight .. function:: double auto_turn_start_velocity() The speed at which an automatic turn starts, in :math:`\mathrm{m/s}`. :Game Scenes: Flight .. function:: double auto_turn_end_altitude() The altitude at which an automatic turn ends, in meters. :Game Scenes: Flight .. function:: bool corrective_steering() .. function:: void set_corrective_steering(bool value) Whether the autopilot steers by the velocity vector rather than the position vector. :Game Scenes: Flight .. note:: It is more accurate, though large craft may do better without it. .. function:: double corrective_steering_gain() .. function:: void set_corrective_steering_gain(double value) The gain of the corrective steering. :Game Scenes: Flight .. note:: Requires :func:`ClassicPath::corrective_steering`. .. function:: bool limit_angle_of_attack() .. function:: void set_limit_angle_of_attack(bool value) Whether to limit the angle of attack. :Game Scenes: Flight .. function:: double max_angle_of_attack() .. function:: void set_max_angle_of_attack(double value) The largest angle of attack, in degrees. :Game Scenes: Flight .. note:: Requires :func:`ClassicPath::limit_angle_of_attack`. .. function:: double angle_of_attack_limit_fadeout_pressure() .. function:: void set_angle_of_attack_limit_fadeout_pressure(double value) The dynamic pressure below which the angle of attack limit fades out, in pascals. :Game Scenes: Flight .. note:: Requires :func:`ClassicPath::limit_angle_of_attack`. .. function:: bool skip_circularization() .. function:: void set_skip_circularization(bool value) Whether to skip the circularization burn. :Game Scenes: Flight