Skip to content
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

Autopilot tweaks #5481

Merged
merged 2 commits into from
Feb 9, 2023
Merged

Autopilot tweaks #5481

merged 2 commits into from
Feb 9, 2023

Conversation

azieba
Copy link
Contributor

@azieba azieba commented Jan 20, 2023

I have been trying to fix autopilot crashing into planets/stars and some cases of overshoots. This is the result of my work so far.
Those saves are two examples of situations when autopilot crashes the ship that are now avoidable:
testPlanet.gz
testStar.gz
The main change is moving the CheckSuicide function call that detects the potential crash to AICmdFlyTo instead of AICmdFlyAround. I have changed the calculations in this function as well as the recovery action taken by the autopilot.
Previously in any dangerous situation the recovery was putting rear of the ship in direction of center of the planet and try to accelerate on main thruster killing other speed component at the same time. This was really sub optimal and resulted in many
ship crashes on autopilot.
The proposed recovery procedure is trying to bend the flght path of the ship to the horizon of the planet while breaking at the same time with the exception of a situation when the ship is below safety radius and the body gravity is greater then ship's available upward thrust. In such case the ship must accelerate to survive.
I have removed speed checks from the CheckCollision function as they are already covered by CheckSuicide.
Quite a few other minor changes to fix autopilot overshoots.

I have also included a generalization of @WKFO code for obstructed target indicators. Now it also works for ships as a nav or combat targets.

Fixes #5497

@fluffyfreak
Copy link
Contributor

For testing if something is over the horizon we also have a HorizonCulling method.

Code looks good to me 👍

Copy link
Member

@Web-eWorks Web-eWorks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the mentioned assertion failure, I'm quite happy with this PR! I haven't been able to properly stress-test it, but I haven't seen any obvious failures yet.

From an administrative standpoint, @azieba do you have a presence on IRC for communication purposes? It's not required, but we have been discussing some planned improvements to the autopilot's capabilities to support manual docking and planned maneuver execution if you are interested in chiming in and/or contributing further.

If not, we can discuss here via a tracking issue or on the forums if you are interested in helping to implement this functionality.

src/ShipAICmd.cpp Outdated Show resolved Hide resolved
@azieba
Copy link
Contributor Author

azieba commented Feb 8, 2023

From an administrative standpoint, @azieba do you have a presence on IRC for communication purposes?

Which is the main dev communication channel the IRC or the forum?

@Web-eWorks
Copy link
Member

Which is the main dev communication channel the IRC or the forum?

IRC is the "primary" developer communication channel (the core developers are all on it and it stays fairly active, and it's where we generally bounce ideas back and forth). The forums are used for more specific long-form discussion to discuss a specific project or concern, for user feature requests, or when we need to write something down for future reference much later.

When planning we generally communicate on IRC and only cross-post the "plan" to the forum if it's significantly large and multiple people have volunteered to help out (e.g. the UI rewrite from many years ago).

The Pioneer IRC channel is accessible at #pioneer on Libera.chat via an IRC client, or via a Matrix bridge at #pioneer:libera.chat. There are no expectations of your involvement level if you join the IRC, but we'd be happy to have you as part of the discussion!

@Web-eWorks Web-eWorks merged commit b8e7e20 into pioneerspacesim:master Feb 9, 2023
@azieba azieba deleted the autopilot branch February 17, 2023 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Auto-pilot becomes very slow, need to manually go forward for it to behave normally
3 participants