.. default-domain:: cpp .. highlight:: cpp .. namespace:: krpc::services::MechJeb HoverslamAutopilot ================== .. class:: HoverslamAutopilot The hoverslam autopilot, which lands with a single burn that ends just above the ground, then descends vertically. The Hoverslam Info window shows it and its prediction. .. note:: The prediction runs whenever the vessel is in flight, so it is available with the autopilot disabled. .. function:: bool enabled() .. function:: void set_enabled(bool value) Whether the autopilot is enabled. :Game Scenes: Flight .. note:: The autopilot can be enabled before there is a prediction, and starts flying once there is one. Setting it throws an exception if the autopilot is :enumerator:`HoverslamState::locked`. .. function:: HoverslamState state() The phase of the autopilot. :Game Scenes: Flight .. function:: double ignition_lead() .. function:: void set_ignition_lead(double value) The time before the computed ignition at which the burn starts, in seconds. :Game Scenes: Flight .. note:: It makes up for staging or engine spool-up delays. For a margin against the terrain, raise :func:`HoverslamAutopilot::vertical_altitude` instead. .. function:: double touchdown_speed() .. function:: void set_touchdown_speed(double value) The downward speed at touchdown, in :math:`\mathrm{m/s}`. :Game Scenes: Flight .. function:: bool autowarp() .. function:: void set_autowarp(bool value) Whether to warp time to the ignition. :Game Scenes: Flight .. function:: bool hold_upright() .. function:: void set_hold_upright(bool value) Whether Smart A.S.S. holds the vessel upright after touchdown. :Game Scenes: Flight .. function:: bool autostage() .. function:: void set_autostage(bool value) Whether enabling the autopilot enables autostaging, and disabling it disables autostaging. :Game Scenes: Flight .. function:: double pwm_pulse_width() .. function:: void set_pwm_pulse_width(double value) The shortest pulse of the throttle, in seconds. :Game Scenes: Flight .. note:: The autopilot pulses the throttle of engines that cannot throttle low enough to hover, such as with Real Fuels. .. function:: bool map_landing_prediction() .. function:: void set_map_landing_prediction(bool value) Whether to mark the predicted landing site on the map. :Game Scenes: Flight .. function:: double recalculation_interval() .. function:: void set_recalculation_interval(double value) The time between updates of the prediction, in seconds. :Game Scenes: Flight .. function:: double vertical_authority() .. function:: void set_vertical_authority(double value) The fraction of the thrust above hover that the burn plans to use, between 0 and 1. :Game Scenes: Flight .. note:: 0.5 leaves an equal margin for overshoot and undershoot. A higher value uses less delta-v, with less margin. .. function:: double vertical_altitude() .. function:: void set_vertical_altitude(double value) The altitude above the terrain at which the burn ends and the vertical descent starts, in meters. :Game Scenes: Flight .. function:: bool has_prediction() Whether there is a prediction of the landing. :Game Scenes: Flight .. function:: double ignition_time() The universal time of the ignition, in seconds. :Game Scenes: Flight .. note:: Requires :func:`HoverslamAutopilot::has_prediction`. .. function:: double landing_time() The universal time of the touchdown, in seconds. :Game Scenes: Flight .. note:: Requires :func:`HoverslamAutopilot::has_prediction`. .. function:: double time_to_ignition() The time until the ignition, in seconds. :Game Scenes: Flight .. note:: Requires :func:`HoverslamAutopilot::has_prediction`. .. function:: double time_to_landing() The time until the touchdown, in seconds. :Game Scenes: Flight .. note:: Requires :func:`HoverslamAutopilot::has_prediction`. .. function:: double landing_latitude() The latitude of the predicted landing site, in degrees. :Game Scenes: Flight .. note:: Requires :func:`HoverslamAutopilot::has_prediction`. .. function:: double landing_longitude() The longitude of the predicted landing site, in degrees. :Game Scenes: Flight .. note:: Requires :func:`HoverslamAutopilot::has_prediction`. .. function:: std::string landing_biome() The biome of the predicted landing site, or ``N/A`` with no prediction. :Game Scenes: Flight .. function:: double terrain_altitude() The altitude above sea level of the terrain at the predicted landing site, in meters. :Game Scenes: Flight .. note:: Requires :func:`HoverslamAutopilot::has_prediction`. .. function:: double slope() The slope of the terrain at the predicted landing site, in degrees. :Game Scenes: Flight .. note:: Requires :func:`HoverslamAutopilot::has_prediction`. .. function:: double final_descent_speed() The speed of the vertical descent, in :math:`\mathrm{m/s}`. :Game Scenes: Flight .. note:: Requires :func:`HoverslamAutopilot::has_prediction`. .. function:: double final_thrust_acceleration() The acceleration from thrust during the vertical descent, in :math:`\mathrm{m/s^{2}}`. :Game Scenes: Flight .. note:: Requires :func:`HoverslamAutopilot::has_prediction`. .. function:: double delta_v() The delta-v of the landing burn, in :math:`\mathrm{m/s}`. :Game Scenes: Flight .. note:: Requires :func:`HoverslamAutopilot::has_prediction`. .. namespace:: krpc::services::MechJeb .. enum-struct:: HoverslamState The phase of the hoverslam autopilot. See :func:`HoverslamAutopilot::state`. .. enumerator:: locked The autopilot needs a research or a tracking station upgrade. .. enumerator:: disabled The autopilot is disabled. .. enumerator:: init The autopilot is waiting for a prediction. .. enumerator:: align The autopilot is turning the vessel to the burn. .. enumerator:: coast The autopilot is coasting to the ignition. .. enumerator:: burn The autopilot is burning to slow down. .. enumerator:: vertical The autopilot is descending vertically to touchdown. .. enumerator:: finished The vessel has landed.