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

Crash when targetting a vessel #3653

Closed
msabathier opened this issue May 20, 2023 · 6 comments · Fixed by #3655
Closed

Crash when targetting a vessel #3653

msabathier opened this issue May 20, 2023 · 6 comments · Fixed by #3655
Labels

Comments

@msabathier
Copy link

Hi,
I just updated Principia to the latest version and then tried to finish my Mun mission by doing a rendez-vous between the lander and the orbiter but as soon as i click on the vessel to target it, i get a freeze (about 3-4 seconds) and then KSP just closes without any messages.
I tried both targetting the lander with the orbiter as the active vessel and targetting the orbiter with the lander as the active vessel but i get the freeze and crash each time.

I turned journaling on and reproduced the issue here are the logs :
INFO.20230520-102545.9324.log
WARNING.20230520-102545.9324.log
ERROR.20230520-102545.9324.log
FATAL.20230520-103014.9324.log

and the journal : JOURNAL.20230520-102851

I have a good amount of mods on this install, let me know if you need the list.

Also, since i am a bit of an idiot, i did not make a backup of the penultimate principia release binaries... Is there a place where i can find the binaries for Ὑπατία ? Or do i need to build it from the source ?

Thanks in advance for your time and response

@jd284
Copy link

jd284 commented May 20, 2023

I have the same crash (I think), when switching to the TgtEO frame on a ship that already has the target set. It's probably not the targeting itself, but the automatic switch to TgtEO.

@pleroy
Copy link
Member

pleroy commented May 20, 2023

Look at the history of the README.md file, you'll find the links to the previous versions.

@eggrobin
Copy link
Member

Decoded stack trace:

int* const vertex_count) {
journal::Method<journal::PlanetariumPlotPrediction> m(
{planetarium, plugin, vessel_guid, vertices, vertices_size},
{vertex_count});
CHECK_NOTNULL(plugin);
CHECK_NOTNULL(planetarium);
*vertex_count = 0;
auto const prediction = plugin->GetVessel(vessel_guid)->prediction();
planetarium->PlotMethod3(
int max_points) const {
if (begin == end) {
return;
}
auto last = std::prev(end);
auto const begin_time = std::max(begin->time, plotting_frame_->t_min());
auto const last_time = std::min(last->time, plotting_frame_->t_max());
PlotMethod3(
Length* const minimal_distance) const {
double const tan²_angular_resolution =
Pow<2>(parameters_.tan_angular_resolution_);
auto const final_time = reverse ? first_time : last_time;
auto previous_time = reverse ? last_time : first_time;
if (minimal_distance != nullptr) {
*minimal_distance = Infinity<Length>;
}
Sign const direction = reverse ? Sign::Negative() : Sign::Positive();
if (direction * (final_time - previous_time) <= Time{}) {
return;
}
SimilarMotion<Barycentric, Navigation> to_plotting_frame_at_t =
plotting_frame_->ToThisFrameAtTimeSimilarly(previous_time);
DegreesOfFreedom<Navigation> const initial_degrees_of_freedom =
to_plotting_frame_at_t(
trajectory.EvaluateDegreesOfFreedom(previous_time));
Position<Navigation> previous_position =
initial_degrees_of_freedom.position();
Velocity<Navigation> previous_velocity =
initial_degrees_of_freedom.velocity();
Time Δt = final_time - previous_time;
add_point(plotting_to_scaled_space_(previous_position));
int points_added = 1;
Instant t;
double estimated_tan²_error;
std::optional<DegreesOfFreedom<Barycentric>>
degrees_of_freedom_in_barycentric;
Position<Navigation> position;
Square<Length> minimal_squared_distance = Infinity<Square<Length>>;
goto estimate_tan²_error;
while (points_added < max_points &&
direction * (previous_time - final_time) < Time{}) {
do {
// One square root because we have squared errors, another one because the
// errors are quadratic in time (in other words, two square roots because
// the squared errors are quartic in time).
// A safety factor prevents catastrophic retries.
Δt *= 0.9 * Sqrt(Sqrt(tan²_angular_resolution / estimated_tan²_error));
estimate_tan²_error:
t = previous_time + Δt;
if (direction * (t - final_time) > Time{}) {
t = final_time;
Δt = t - previous_time;
}
Position<Navigation> const extrapolated_position =
previous_position + previous_velocity * Δt;
to_plotting_frame_at_t = plotting_frame_->ToThisFrameAtTimeSimilarly(t);
Instant const& t) const {
return ToThisFrameAtTime(t).template Forget<SimilarMotion>();
ToThisFrameAtTime(Instant const& t) const {
DegreesOfFreedom<InertialFrame> const primary_degrees_of_freedom =
Instant const& t) const {
auto const it = timeline_.lower_bound(t);
if (it->time == t) {
return it->degrees_of_freedom;
}
CHECK_LT(t_min(), t);
CHECK_GT(t_max(), t);

@pleroy
Copy link
Member

pleroy commented May 20, 2023

We'll publish an updated ابن الهيثم release in a few hours.

@pleroy
Copy link
Member

pleroy commented May 20, 2023

@msabathier Thanks for the report, and for providing logs and a journal, it was very helpful.

@msabathier
Copy link
Author

Well thank you @pleroy and @eggrobin for the speedy support !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants