landingController

LandingController is a vector oriented controller, it contains methods that will guide your rocket during the powered landing maneuver. During the final descent landingController will perform course corrections to mitigate error. Because it’s vector oriented, the results might not be the most accurate.

Table of contents:

Contructing

parameters type default Description
ldata landingDataModel - landingDataModel constructed with desired landing position
hslam hoverSlamModel - hoverSlamModel object used to control the throttle
aoa* float 5 maxmimum aoa relative to velocity vector
errorScaling* float 1 how aggressive course corrections should be

* optional parameters

Public methods

public methods return type Description
getSteering() Direction returns steering direction
getThrottle() Float returns throttle precentage
completed() Boolean is the ship landed or splashed?
passControl(bool) None passes control

getSteering()

No parameters

Returns steering direction.


getThrottle()

No parameters

Returns throttle percentage. Uses hoverSlamModel to calculate throttle.


completed()

No parameters

By default returns true if the ship is splashed or landed.


passControl(bool)

Parameters:

  • isUnlocking::Boolean -> should throttle and steering be unlocked?

Takes control over both steering and throttle until completed() returns true.


Code examples


local hoverslam is hoverSlamModel(15). // 15 is height of the rocket
local landing is landingController(hoverslam, 10).

// Passing control
landing["passControl"]().
local hoverslam is hoverSlamModel(15). // 15 is height of the rocket
local landing is landingController(hoverslam, 10).

// Passing control
lock steering to landing["getSteering"]().
lock throttle to landing["getThrottle"]().

wait until landing["completed"]().