-
Notifications
You must be signed in to change notification settings - Fork 241
Add AttitudeController interface #2881
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
thexa4
wants to merge
18
commits into
KSP-KOS:develop
Choose a base branch
from
thexa4:feature/reaction-wheels
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
131e46a
allow CKAN to install on KSP 1.9.1
Dunbaratu 5e572ed
Merge branch 'develop'
Dunbaratu 2f807ca
Merge branch 'develop'
Dunbaratu 66e017c
Merge branch 'develop'
Dunbaratu 68add60
Add ReactionWheel partmodule handling
thexa4 a7919ca
WIP for review
thexa4 70cb4d6
Add generalized attitude control interface
thexa4 7835831
Fix missing reference
thexa4 8f72f10
Add AttitudeCorrectionResult docs
thexa4 f10592e
Expose and document authority limiter attributes
thexa4 e8fde62
Use natural names instead of x,y,z
thexa4 2471585
Merge remote-tracking branch 'thexa4/feature/reaction-wheels' into me…
Dunbaratu 78c9805
Fix typo in suffix name ("authrority"->"authority")
Dunbaratu cbc5c87
Renamed some variables as follows to fit with the rest of kOS:
Dunbaratu 31a302a
Merge pull request #3 from Dunbaratu/review_2881_attitude_controller
thexa4 0df3872
Make clearer that not all controllers can do everything
thexa4 5a2b09b
Merge remote-tracking branch 'upstream/master' into feature/reaction-…
thexa4 a07e49e
Merge remote-tracking branch 'upstream/develop' into feature/reaction…
thexa4 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,245 @@ | ||
| .. _attitudecontroller: | ||
|
|
||
| Attitude Controller | ||
| ====== | ||
|
|
||
| A ship usually has various attitude controllers like control surfaces, engines, RCS thrusters, rotors and drain valves. These controllers can be configured as follows: | ||
|
|
||
| local controllers to ship:AttitudeControllers. | ||
| print(controllers[0]:ControllerType + " allows pitch: " + controllers[0]:allowPitch). | ||
|
|
||
| .. structure:: AttitudeController | ||
|
|
||
| .. list-table:: Members | ||
| :header-rows: 1 | ||
| :widths: 1 1 2 | ||
|
|
||
| * - Suffix | ||
| - Type (units) | ||
| - Description | ||
|
|
||
| * - :attr:`PART` | ||
| - :struct:`Part <Part>` | ||
| - The part this controller belongs to. | ||
| * - :attr:`MODULE` | ||
| - :struct:`PartModule <PartModule>` | ||
| - The module this controller belongs to. Will return false if there is no matching module. | ||
| * - :attr:`ALLOWPITCH` | ||
| - :ref:`Boolean <boolean>` | ||
| - Gets or sets wheter this controller should respond to pitch input. | ||
| * - :attr:`ALLOWYAW` | ||
| - :ref:`Boolean <boolean>` | ||
| - Gets or sets wheter this controller should respond to yaw input. | ||
| * - :attr:`ALLOWROLL` | ||
| - :ref:`Boolean <boolean>` | ||
| - Gets or sets wheter this controller should respond to roll input. | ||
| * - :attr:`ALLOWX` | ||
| - :ref:`Boolean <boolean>` | ||
| - Gets or sets wheter this controller should respond to x translation input. | ||
| * - :attr:`ALLOWY` | ||
| - :ref:`Boolean <boolean>` | ||
| - Gets or sets wheter this controller should respond to y translation input. | ||
| * - :attr:`ALLOWZ` | ||
| - :ref:`Boolean <boolean>` | ||
| - Gets or sets wheter this controller should respond to z translation input. | ||
| * - :attr:`HASCUSTOMTHROTTLE` | ||
| - :ref:`Boolean <boolean>` | ||
| - Wheter this controller has a custom throttle input. | ||
| * - :attr:`CUSTOMTHROTTLE` | ||
| - :ref:`scalar <scalar>` (%) | ||
| - The value the custom throttle. | ||
| * - :attr:`ROTATIONAUTHRORITYLIMITER` | ||
| - :ref:`scalar <scalar>` (%) | ||
| - The authority limit for rotation. | ||
| * - :attr:`TRANSLATIONAUTHRORITYLIMITER` | ||
thexa4 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - :ref:`scalar <scalar>` (%) | ||
| - The authority limit for translation. | ||
| * - :attr:`CONTROLLERTYPE` | ||
| - :ref:`string <string>` | ||
| - The type of the controller. | ||
| * - :attr:`STATUS` | ||
| - :ref:`string <string>` | ||
| - A string indicating more detailed status about the controller if available. | ||
| * - :attr:`RESPONSETIME` | ||
| - :ref:`scalar <scalar>` | ||
| - The reported responsetime of the controller. | ||
| * - :attr:`POSITIVEROTATION` | ||
| - :struct:`AttitudeCorrectionResult <AttitudeCorrectionResult>` | ||
| - What is expected to happen when you provide a positive value to pitch, yaw, roll. | ||
| * - :attr:`NEGATIVEROTATION` | ||
| - :struct:`AttitudeCorrectionResult <AttitudeCorrectionResult>` | ||
| - What is expected to happen when you provide a negative value to pitch, yaw, roll. | ||
| * - :meth:`RESPONSEFOR` | ||
| - :struct:`AttitudeCorrectionResult <AttitudeCorrectionResult>` | ||
| - What is expected to happen for arbitrary combinations of pitch, yaw, roll, translate x, translate y, translate z, custom throttle. | ||
|
|
||
|
|
||
| .. note:: | ||
|
|
||
| The rotation responses are simplified models of reality and are likely to be off to various degrees. | ||
|
|
||
|
|
||
|
|
||
| .. _attitudecontroller_PART: | ||
|
|
||
| .. attribute:: AttitudeController:PART | ||
|
|
||
| :access: Get | ||
| :type: :struct:`Part <Part>` | ||
|
|
||
| The part this controller belongs to. | ||
|
|
||
| .. _attitudecontroller_MODULE: | ||
|
|
||
| .. attribute:: AttitudeController:MODULE | ||
|
|
||
| :access: Get only | ||
| :type: :struct:`PartModule <PartModule>` | ||
|
|
||
| The module this controller belongs to. Will return false if there is no matching module. | ||
|
|
||
| .. _attitudecontroller_ALLOWPITCH: | ||
|
|
||
| .. attribute:: AttitudeController:ALLOWPITCH | ||
|
|
||
| :access: Get/Set | ||
| :type: :ref:`boolean <boolean>` | ||
|
|
||
| Determines whether this controller is allowed to respond to pitch input. | ||
|
|
||
| .. _attitudecontroller_ALLOWYAW: | ||
|
|
||
| .. attribute:: AttitudeController:ALLOWYAW | ||
|
|
||
| :access: Get/Set | ||
| :type: :ref:`boolean <boolean>` | ||
|
|
||
| Determines whether this controller is allowed to respond to yaw input. | ||
|
|
||
| .. _attitudecontroller_ALLOWROLL: | ||
|
|
||
| .. attribute:: AttitudeController:ALLOWROLL | ||
|
|
||
| :access: Get/Set | ||
| :type: :ref:`boolean <boolean>` | ||
|
|
||
| Determines whether this controller is allowed to respond to roll input. | ||
|
|
||
| .. _attitudecontroller_ALLOWX: | ||
|
|
||
| .. attribute:: AttitudeController:ALLOWX | ||
|
|
||
| :access: Get/Set | ||
| :type: :ref:`boolean <boolean>` | ||
|
|
||
| Determines whether this controller is allowed to respond to translation fore input. | ||
|
|
||
| .. _attitudecontroller_ALLOWY: | ||
|
|
||
| .. attribute:: AttitudeController:ALLOWY | ||
|
|
||
| :access: Get/Set | ||
| :type: :ref:`boolean <boolean>` | ||
|
|
||
| Determines whether this controller is allowed to respond to translation top input. | ||
|
|
||
| .. _attitudecontroller_ALLOWZ: | ||
|
|
||
| .. attribute:: AttitudeController:ALLOWZ | ||
|
|
||
| :access: Get/Set | ||
| :type: :ref:`boolean <boolean>` | ||
|
|
||
| Determines whether this controller is allowed to respond to translation star input. | ||
|
|
||
| .. _attitudecontroller_HASCUSTOMTHROTTLE: | ||
|
|
||
| .. attribute:: AttitudeController:HASCUSTOMTHROTTLE` | ||
|
|
||
| :access: Get only | ||
| :type: :ref:`boolean <boolean>` | ||
|
|
||
| Returns true if this controller has a custom throttle you can modify. | ||
|
|
||
| .. _attitudecontroller_CUSTOMTHROTTLE: | ||
|
|
||
| .. attribute:: AttitudeController:CUSTOMTHROTTLE | ||
|
|
||
| :access: Get/Set | ||
| :type: :ref:`scalar <scalar>` (%) | ||
|
|
||
| Sets the custom throttle for this controller. | ||
|
|
||
| .. _attitudecontroller_ROTATIONAUTHORITYLIMITER: | ||
|
|
||
| .. attribute:: AttitudeController:ROTATIONAUTHORITYLIMITER | ||
|
|
||
| :access: Get/Set | ||
| :type: :ref:`scalar <scalar>` (%) | ||
|
|
||
| Sets the authority limiter used during rotation. | ||
|
|
||
| .. _attitudecontroller_TRANSLATIONAUTHORITYLIMITER: | ||
|
|
||
| .. attribute:: AttitudeController:TRANSLATIONAUTHORITYLIMITER | ||
|
|
||
| :access: Get/Set | ||
| :type: :ref:`scalar <scalar>` (%) | ||
|
|
||
| Sets the authority limiter used during translation. | ||
|
|
||
| .. _attitudecontroller_CONTROLLERTYPE: | ||
|
|
||
| .. attribute:: AttitudeController:CONTROLLERTYPE | ||
|
|
||
| :access: Get only | ||
| :type: :ref:`string <string>` | ||
|
|
||
| The type of the attitude controller (ENGINE, DRAINVALVE, ROTOR, RCS, REACTIONWHEEL) or UNKNOWN if the exact type is unknown. | ||
|
|
||
| .. _attitudecontroller_STATUS: | ||
|
|
||
| .. attribute:: AttitudeController:STATUS | ||
|
|
||
| :access: Get only | ||
| :type: :ref:`string <string>` | ||
|
|
||
| The status of the controller if known. UNKNOWN otherwise. | ||
|
|
||
| .. _attitudecontroller_RESPONSETIME: | ||
|
|
||
| .. attribute:: AttitudeController:RESPONSETIME | ||
|
|
||
| :access: Get only | ||
| :type: :ref:`scalar <scalar>` | ||
|
|
||
| The reported response time of this controller. | ||
|
|
||
| .. _attitudecontroller_POSITIVEROTATION: | ||
|
|
||
| .. attribute:: AttitudeController:POSITIVEROTATION | ||
|
|
||
| :access: Get only | ||
| :type: :struct:`AttitudeCorrectionResult <AttitudeCorrectionResult>` | ||
|
|
||
| What is expected to happen when you provide a positive value to pitch, yaw, roll. | ||
|
|
||
| .. _attitudecontroller_NEGATIVEROTATION: | ||
|
|
||
| .. attribute:: AttitudeController:NEGATIVEROTATION | ||
|
|
||
| :access: Get only | ||
| :type: :struct:`AttitudeCorrectionResult <AttitudeCorrectionResult>` | ||
|
|
||
| What is expected to happen when you provide a negative value to pitch, yaw, roll. | ||
|
|
||
| .. _attitudecontroller_RESPONSEFOR: | ||
|
|
||
| .. method:: AttitudeController:RESPONSEFOR(pitchYawRollInput, translateXYZInput, throttle) | ||
|
|
||
| :parameter pitchYawRollInput: A vector describing user pitch, yaw, roll input between -1 and 1. | ||
| :parameter translateXYZInput: A vector describing user fore, top, star translation input between -1 and 1. | ||
| :parameter throttle: A scalar representing the custom throttle value in percent. | ||
| :type: :struct:`AttitudeCorrectionResult <AttitudeCorrectionResult>` | ||
|
|
||
| Simulates the effect of the given input on the ship. This allows computing things like RCS thruster inbalances. | ||
23 changes: 23 additions & 0 deletions
23
doc/source/structures/vessels/attitudecorrectionresult.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| .. _attitudecorrectionresult: | ||
|
|
||
| Attitude Correction Result | ||
| ====== | ||
|
|
||
| When you perform a control action on a ship (yaw, pitch, roll, fore, top, star, throttle) this always has two effects on the ship. Part of the impulse will be be imparted as rotation and part of it will be translation. | ||
|
|
||
| .. structure:: AttitudeCorrectionResult | ||
|
|
||
| .. list-table:: Members | ||
| :header-rows: 1 | ||
| :widths: 1 1 2 | ||
|
|
||
| * - Suffix | ||
| - Type (units) | ||
| - Description | ||
|
|
||
| * - :attr:`TORQUE` | ||
| - :struct:`Vector <Vector>` | ||
| - The torque vector (pitch, roll, yaw). | ||
| * - :attr:`TRANSLATION` | ||
| - :struct:`Vector <Vector>` | ||
| - The translation force (fore, top, star) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.