space_ex v0.3.0 SpaceEx.SpaceCenter.AutoPilot

Provides basic auto-piloting utilities for a vessel.

Created by calling SpaceEx.SpaceCenter.Vessel.auto_pilot/2.

If a client engages the auto-pilot and then closes its connection to the server, the auto-pilot will be disengaged and its target reference frame, direction and roll reset to default.

Link to this section Summary

Functions

The angle at which the autopilot considers the vessel to be pointing close to the target

Whether the rotation rate controllers PID parameters should be automatically tuned using the vessels moment of inertia and available torque

The time the vessel should take to come to a stop pointing in the target direction

Disengage the auto-pilot

Engage the auto-pilot

The error, in degrees, between the direction the ship has been asked to point in and the direction it is pointing in

The error, in degrees, between the vessels current and target heading

The target overshoot percentage used to autotune the PID controllers

The error, in degrees, between the vessels current and target pitch

Gains for the pitch PID controller

The reference frame for the target direction (SpaceEx.SpaceCenter.AutoPilot.target_direction/2)

The error, in degrees, between the vessels current and target roll

Gains for the roll PID controller

The threshold at which the autopilot will try to match the target roll angle, if any

The state of SAS

The angle at which the autopilot considers the vessel to be pointing close to the target

Whether the rotation rate controllers PID parameters should be automatically tuned using the vessels moment of inertia and available torque

The time the vessel should take to come to a stop pointing in the target direction

The target overshoot percentage used to autotune the PID controllers

Gains for the pitch PID controller

Gains for the roll PID controller

The threshold at which the autopilot will try to match the target roll angle, if any

The state of SAS

The maximum amount of time that the vessel should need to come to a complete stop

Direction vector corresponding to the target pitch and heading

The target heading, in degrees, between 0° and 360°

The target pitch, in degrees, between -90° and +90°

The target roll, in degrees

The target time to peak used to autotune the PID controllers

Gains for the yaw PID controller

The maximum amount of time that the vessel should need to come to a complete stop

Direction vector corresponding to the target pitch and heading

The target heading, in degrees, between 0° and 360°

The target pitch, in degrees, between -90° and +90°

Set target pitch and heading angles

The target roll, in degrees

The target time to peak used to autotune the PID controllers

Blocks until the vessel is pointing in the target direction and has the target roll (if set)

Gains for the yaw PID controller

Link to this section Functions

Link to this function attenuation_angle(conn, this)

The angle at which the autopilot considers the vessel to be pointing close to the target.

This determines the midpoint of the target velocity attenuation function. A vector of three angles, in degrees, one for each of the pitch, roll and yaw axes. Defaults to 1° for each axis.

Link to this function auto_tune(conn, this)

Whether the rotation rate controllers PID parameters should be automatically tuned using the vessels moment of inertia and available torque.

Defaults to true. See SpaceEx.SpaceCenter.AutoPilot.time_to_peak/2 and SpaceEx.SpaceCenter.AutoPilot.overshoot/2.

Link to this function deceleration_time(conn, this)

The time the vessel should take to come to a stop pointing in the target direction.

This determines the angular acceleration used to decelerate the vessel. A vector of three times, in seconds, one for each of the pitch, roll and yaw axes. Defaults to 5 seconds for each axis.

Link to this function disengage(conn, this)

Disengage the auto-pilot.

Link to this function engage(conn, this)

Engage the auto-pilot.

Link to this function error(conn, this)

The error, in degrees, between the direction the ship has been asked to point in and the direction it is pointing in.

Throws an exception if the auto-pilot has not been engaged and SAS is not enabled or is in stability assist mode.

Link to this function heading_error(conn, this)

The error, in degrees, between the vessels current and target heading.

Throws an exception if the auto-pilot has not been engaged.

Link to this function overshoot(conn, this)

The target overshoot percentage used to autotune the PID controllers.

A vector of three values, between 0 and 1, for each of the pitch, roll and yaw axes. Defaults to 0.01 for each axis.

Link to this function pitch_error(conn, this)

The error, in degrees, between the vessels current and target pitch.

Throws an exception if the auto-pilot has not been engaged.

Link to this function pitch_pid_gains(conn, this)

Gains for the pitch PID controller.

When SpaceEx.SpaceCenter.AutoPilot.auto_tune/2 is true, these values are updated automatically, which will overwrite any manual changes.

Link to this function reference_frame(conn, this)

The reference frame for the target direction (SpaceEx.SpaceCenter.AutoPilot.target_direction/2).

An error will be thrown if this property is set to a reference frame that rotates with the vessel being controlled, as it is impossible to rotate the vessel in such a reference frame.

Link to this function roll_error(conn, this)

The error, in degrees, between the vessels current and target roll.

Throws an exception if the auto-pilot has not been engaged or no target roll is set.

Link to this function roll_pid_gains(conn, this)

Gains for the roll PID controller.

When SpaceEx.SpaceCenter.AutoPilot.auto_tune/2 is true, these values are updated automatically, which will overwrite any manual changes.

Link to this function roll_threshold(conn, this)

The threshold at which the autopilot will try to match the target roll angle, if any.

Defaults to 5 degrees.

Link to this function sas(conn, this)

The state of SAS.

Equivalent to SpaceEx.SpaceCenter.Control.sas/2

Link to this function sas_mode(conn, this)

The current SpaceEx.SpaceCenter.SASMode.

These modes are equivalent to the mode buttons to the left of the navball that appear when SAS is enabled.

Equivalent to SpaceEx.SpaceCenter.Control.sas_mode/2

Link to this function set_attenuation_angle(conn, this, value)

The angle at which the autopilot considers the vessel to be pointing close to the target.

This determines the midpoint of the target velocity attenuation function. A vector of three angles, in degrees, one for each of the pitch, roll and yaw axes. Defaults to 1° for each axis.

Link to this function set_auto_tune(conn, this, value)

Whether the rotation rate controllers PID parameters should be automatically tuned using the vessels moment of inertia and available torque.

Defaults to true. See SpaceEx.SpaceCenter.AutoPilot.time_to_peak/2 and SpaceEx.SpaceCenter.AutoPilot.overshoot/2.

Link to this function set_deceleration_time(conn, this, value)

The time the vessel should take to come to a stop pointing in the target direction.

This determines the angular acceleration used to decelerate the vessel. A vector of three times, in seconds, one for each of the pitch, roll and yaw axes. Defaults to 5 seconds for each axis.

Link to this function set_overshoot(conn, this, value)

The target overshoot percentage used to autotune the PID controllers.

A vector of three values, between 0 and 1, for each of the pitch, roll and yaw axes. Defaults to 0.01 for each axis.

Link to this function set_pitch_pid_gains(conn, this, value)

Gains for the pitch PID controller.

When SpaceEx.SpaceCenter.AutoPilot.auto_tune/2 is true, these values are updated automatically, which will overwrite any manual changes.

Link to this function set_reference_frame(conn, this, value)

The reference frame for the target direction (SpaceEx.SpaceCenter.AutoPilot.target_direction/2).

An error will be thrown if this property is set to a reference frame that rotates with the vessel being controlled, as it is impossible to rotate the vessel in such a reference frame.

Link to this function set_roll_pid_gains(conn, this, value)

Gains for the roll PID controller.

When SpaceEx.SpaceCenter.AutoPilot.auto_tune/2 is true, these values are updated automatically, which will overwrite any manual changes.

Link to this function set_roll_threshold(conn, this, value)

The threshold at which the autopilot will try to match the target roll angle, if any.

Defaults to 5 degrees.

Link to this function set_sas(conn, this, value)

The state of SAS.

Equivalent to SpaceEx.SpaceCenter.Control.sas/2

Link to this function set_sas_mode(conn, this, value)

The current SpaceEx.SpaceCenter.SASMode.

These modes are equivalent to the mode buttons to the left of the navball that appear when SAS is enabled.

Equivalent to SpaceEx.SpaceCenter.Control.sas_mode/2

Link to this function set_stopping_time(conn, this, value)

The maximum amount of time that the vessel should need to come to a complete stop.

This determines the maximum angular velocity of the vessel. A vector of three stopping times, in seconds, one for each of the pitch, roll and yaw axes. Defaults to 0.5 seconds for each axis.

Link to this function set_target_direction(conn, this, value)

Direction vector corresponding to the target pitch and heading.

This is in the reference frame specified by SpaceEx.SpaceCenter.ReferenceFrame.

Link to this function set_target_heading(conn, this, value)

The target heading, in degrees, between 0° and 360°.

Link to this function set_target_pitch(conn, this, value)

The target pitch, in degrees, between -90° and +90°.

Link to this function set_target_roll(conn, this, value)

The target roll, in degrees.

NaN if no target roll is set.

Link to this function set_time_to_peak(conn, this, value)

The target time to peak used to autotune the PID controllers.

A vector of three times, in seconds, for each of the pitch, roll and yaw axes. Defaults to 3 seconds for each axis.

Link to this function set_yaw_pid_gains(conn, this, value)

Gains for the yaw PID controller.

When SpaceEx.SpaceCenter.AutoPilot.auto_tune/2 is true, these values are updated automatically, which will overwrite any manual changes.

Link to this function stopping_time(conn, this)

The maximum amount of time that the vessel should need to come to a complete stop.

This determines the maximum angular velocity of the vessel. A vector of three stopping times, in seconds, one for each of the pitch, roll and yaw axes. Defaults to 0.5 seconds for each axis.

Link to this function target_direction(conn, this)

Direction vector corresponding to the target pitch and heading.

This is in the reference frame specified by SpaceEx.SpaceCenter.ReferenceFrame.

Link to this function target_heading(conn, this)

The target heading, in degrees, between 0° and 360°.

Link to this function target_pitch(conn, this)

The target pitch, in degrees, between -90° and +90°.

Link to this function target_pitch_and_heading(conn, this, pitch, heading)

Set target pitch and heading angles.

  • pitch — Target pitch angle, in degrees between -90° and +90°.

  • heading — Target heading angle, in degrees between 0° and 360°.

Link to this function target_roll(conn, this)

The target roll, in degrees.

NaN if no target roll is set.

Link to this function time_to_peak(conn, this)

The target time to peak used to autotune the PID controllers.

A vector of three times, in seconds, for each of the pitch, roll and yaw axes. Defaults to 3 seconds for each axis.

Link to this function wait(conn, this)

Blocks until the vessel is pointing in the target direction and has the target roll (if set).

Throws an exception if the auto-pilot has not been engaged.

Link to this function yaw_pid_gains(conn, this)

Gains for the yaw PID controller.

When SpaceEx.SpaceCenter.AutoPilot.auto_tune/2 is true, these values are updated automatically, which will overwrite any manual changes.