Repository navigation
SmartASS: smooth control starts from the vessel's attitude, and stops commanding once at its target or while another autopilot steers - #2819
Merged
Conversation
… commanding once at its target or while another autopilot steers Smooth control only exists for the SURF angle targets, but Engage read the flag before it was cleared for the other targets. Clicking HVEL- or UP with Smooth control ticked started the transition from the frame's forward instead of the vessel's direction, commanded that, and the flag was cleared right after, so the vessel held HVEL+ or north on the horizon. Smooth control is now active only for the surface angle targets and the setting is kept while another target is selected, and a smooth transition to a direction starts from the vessel's pointing. While smooth control was on, SmartASS called AttitudeTo and reset the axis control every tick, even after the transition had ended. With "Disable SmartASS automatically" off, SmartASS stays a user beside another autopilot, so the node executor or the landing autopilot had its target overwritten by SmartASS's every tick, its roll freed and, at each flip of more than 10 degrees, its axes and PIDs reset. SmartASS now commands only while the transition runs, and does nothing while another module steers.
Contributor
✅ Build Artifact 🚀MechJeb2-c3834bd.zip (built from c0cc9e8) |
74 of 87 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Part of #2472 (audit epic, CTRL): HCTRL-a3, HCTRL-a4 (Medium).
Summary
1 commit, 1 file changed. The end of the smooth turn is a flag set where the last step copies the target.
SmartASS: smooth control starts from the vessel's attitude, and stops commanding once at its target or while another autopilot steers
Smooth control only exists for the SURF angle targets, but Engage read the flag before it was cleared for the other targets. Clicking HVEL- or UP with Smooth control ticked started the transition from the frame's forward instead of the vessel's direction, commanded that, and the flag was cleared right after, so the vessel held HVEL+ or north on the horizon. Smooth control is now active only for the surface angle targets and the setting is kept while another target is selected, and a smooth transition to a direction starts from the vessel's pointing.
While smooth control was on, SmartASS called AttitudeTo and reset the axis control every tick, even after the transition had ended. With "Disable SmartASS automatically" off, SmartASS stays a user beside another autopilot, so the node executor or the landing autopilot had its target overwritten by SmartASS's every tick, its roll freed and, at each flip of more than 10 degrees, its axes and PIDs reset. SmartASS now commands only while the transition runs, and does nothing while another module steers.
Not changed: unticking Smooth control during a transition still leaves the commanded attitude where the transition was until the next Execute, as on
dev.Tested
Measured on an earlier, longer version of this change, not re-run on this one (rebased on dev 6959f7c; Debug build with no new warnings, MechJebLibTest passes).
MechJeb2_UI Spike 81 (PC, development player, MechJeb
-c Debug, KSP 1.12.5, 3.2x system, KSPCommunityFixes; Kerbal X MJ Test from MJTesting),devb85bdac againsttest/opus-medium, Poodle stage in orbit: SmartASS SURF with Smooth, then HVEL-.devNot tested in game: HCTRL-a4 (SmartASS against another autopilot with auto-disable off).