(Edit: changed output from redstone comparators to rotational force, hat tip to @olive ore for the brilliant idea)
The Gyroscope outputs rotational force proportional to the pitch, roll, and yaw of the ship relative to the world. This rotational force could be used to build basic autopilot / steadying / station-keeping controls.
(note: I'm going to use pitch, roll, and yaw below, assume we're talking about a ship whose aft is to the north and starboard is to the east, in ship-space)
It works like so:
- One face takes an input rotational force. In the block's default orientation, this is the bottom, but the block may be oriented in any direction, similar to a piston block.
- All other faces are outputs.
- Top and bottom outputs are based on yaw: rotation of the ship within the world's XZ plane.
- North and south outputs are based on roll: rotation of the ship within the world's XY plane.
- East and west outputs are based on pitch: rotation of the ship within the world's YZ plane.
- Each output RPM is calculated as a linear mapping between the ship's rotation (-180º, +180º], and the input RPM [-<input RPM>, +<input RPM>]. E.g., given an input of 32 RPM, a 45º rotation would produce an output of 8 RPM. Given an input of 120 RPM, a -30º rotation would produce an output of -20 RPM.
- The Gyroscope consumes stress proportional to input RPM. Higher input RPM provides greater precision, but consumes more stress.
Bonus idea: it would be useful to be able to tell tilt relative to a particular attitude (e.g., the attitude of the ship when the block starts receiving rotational force), not just to the game world. This would This could be a separate block, or one block with two modes, similar to the redstone comparator.