diff --git a/docs.md b/docs.md index 420f386..3022eb8 100644 --- a/docs.md +++ b/docs.md @@ -193,3 +193,93 @@ Every cycle: - Altitude Sensor `getHeight()`, `getAirPressure()`, `getVerticalSpeed()` - Velocity Sensor `getAxis()`, `getVelocity` - Poll input signal strengths for global downwards thrust, and fore and aft thrust + +### Data Structures + +#### Config + +The member variables of the Config table is as follows: + +```lua +Config = { + ConfigPath = "/path/to/config.txt", + thrusterConfigPath = "path/to/thrusters.txt", + Debug = false, -- controls various debug print statements + Monitors = { + InstrumentPanelMonitor = { + name = "peripheralName", + peripheral = {} -- stores the table returned by running peripheral.wrap(name) + }, + AutopilotControlMonitor = { + name = "peripheralName", + peripheral = {} + } + }, + Autopilot = { + AutopilotEngaged = false, -- global shutoff for all autopilot functions + AutoForeAft = false, -- automatic forward/rearward throttle + AutopilotDesiredSpeed = nil, -- keep a certain velocity + AutopilotDesiredHeading = nil -- maintain a certain heading + }, + SensorCorrection = { + Heading = 0 -- this is directly added to the heading value, in case the vessel was built with the heading not being direct north + }, + Throttles = { + fore = { + name = "peripheralName", + side = "redstoneRelaySide" -- it is assumed that a user will use a redstone relay for their throttles + }, + aft = { + name = "peripheralName", + side = "redstoneRelaySide" + }, + down = { + name = "peripheralName", + side = "redstoneRelaySide" + } + } +} +``` + +The member variables of the sensor table is as follows: + +```lua +SensorData = { + Velocity = { + Raw = { + x = nil, + y = nil, + z = nil + } + }, + Altitude = { + Altitude = nil, + AirPressure = nil, + VerticalSpeed = nil + }, + NavTable = { + Heading = nil, + HasTarget = nil, + -- values past this are only populated if HasTarget == true + TargetBearing = nil, + TargetClosureRate = nil, + TargetVerticalOffset = nil, + TargetRelativeAngle = nil + }, + Gimbal = { + Angles = { + xAngle = nil, + zAngle = nil + }, + AngularRates = { + wx = nil, + wy = nil, + wz = nil + }, + LinearAcceleration = { + ax = nil, + ay = nil, + az = nil + } +} +```