Hopper rocket 3.0
Tutorial
Author: smoketeer
In Hopper rocket tutorials we’re paying tribute to historical rockets capable of powered landing in atmospheric environment, namely DC-X, Grasshopper and BlueShepherd. Instead of combining every bit of fall module into one script, we’re going to gradually build complexity.
This tutorial is a continuation of Tutorial: Hopper rocket 2.0.
Mission
Last time we’ve implemented Hopper rocket 2.0, which is capable of correcting
its course during unpowered flight stage. This time we’re going to include
powered landing guidance in the form of landingController
.
Implementation
We’re going to reuse some code from previous tutorial.
Importing FALL
Things we need:
hoverSlamModel
- for final burnlandingDataModel
- to construct glideController and landingController objectslandingController
- for landing guidance, constructed with landingDataModelglideController
- for gliding guidance, constructed with landingDataModel object- Extra:
importFall
utility to make the syntax less tedious
Launch
Launch sequence comes from previous tutorials:
Gliding
Now we set up our glideController
and give control to it when our ship starts falling:
Landing
This time instead of setting up our hoverslam and locking steering to retrograde, we’re going to create landingController object:
Give it control over throttle:
And give it control over steering as soon as it outputs throttle larger than 0 and ship is lower than 5000 meters ATL:
It’s very important to make sure that steering is given to landingController
as soon as the engines are fired. Otherwise glideController
steering scheme will bring opposite results to what is desired.
For the final touch, as usual, we add some logic so our ship can recognise when its landed:
Summary
We’re done! Our Hopper 3.0 is now capable of making an autonomous ascent, gliding towards target and finally performing a powered landing maneuver. Code as a whole looks like this: