Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 85996503611d
Choose a base ref
...
head repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 69d5ee26af54
Choose a head ref

Commits on May 15, 2019

  1. Use shared_ptr for the frame.

    pleroy committed May 15, 2019
    Copy the full SHA
    1b8767b View commit details
  2. API changes.

    pleroy committed May 15, 2019
    Copy the full SHA
    3313827 View commit details
  3. Copy the full SHA
    39f9531 View commit details

Commits on May 16, 2019

  1. Fix some compilation errors.

    pleroy committed May 16, 2019
    Copy the full SHA
    6e076c4 View commit details
  2. More selectors.

    pleroy committed May 16, 2019
    Copy the full SHA
    3e65ba3 View commit details
  3. "Unfix" the test.

    pleroy committed May 16, 2019
    Copy the full SHA
    2db06fd View commit details
  4. More "unfixing".

    pleroy committed May 16, 2019
    Copy the full SHA
    fb078ea View commit details
  5. Mystery error.

    pleroy committed May 16, 2019
    Copy the full SHA
    df95fe7 View commit details
  6. Copy the full SHA
    464f1fa View commit details
  7. Remove burn.cpp.

    pleroy committed May 16, 2019
    Copy the full SHA
    1f8c59c View commit details
  8. Revert "Circumventing the mystery error."

    This reverts commit 464f1fa.
    pleroy committed May 16, 2019
    Copy the full SHA
    93eb610 View commit details
  9. Cleanup.

    pleroy committed May 16, 2019
    Copy the full SHA
    54a05c2 View commit details

Commits on May 17, 2019

  1. Newer API and removal of Burn.

    pleroy committed May 17, 2019
    Copy the full SHA
    f534331 View commit details
  2. Implement the newer API.

    pleroy committed May 17, 2019
    Copy the full SHA
    b45d9c5 View commit details
  3. Copy the full SHA
    72c9f52 View commit details

Commits on May 18, 2019

  1. Copy the full SHA
    e625203 View commit details
  2. Eliminate the mystery error.

    pleroy committed May 18, 2019
    Copy the full SHA
    bcee0fb View commit details
  3. Fix tests.

    pleroy committed May 18, 2019
    Copy the full SHA
    883b4da View commit details
  4. Cleanup.

    pleroy committed May 18, 2019
    Copy the full SHA
    31ba13c View commit details
  5. Lint.

    pleroy committed May 18, 2019
    Copy the full SHA
    7990d3f View commit details
  6. After egg's review.

    pleroy committed May 18, 2019
    Copy the full SHA
    7366f2f View commit details
  7. Merge pull request #2171 from pleroy/SharedPtr

    Change the API of Manœuvre to unify it with Burn
    pleroy authored May 18, 2019
    Copy the full SHA
    69d5ee2 View commit details
22 changes: 0 additions & 22 deletions ksp_plugin/burn.cpp

This file was deleted.

42 changes: 0 additions & 42 deletions ksp_plugin/burn.hpp

This file was deleted.

19 changes: 9 additions & 10 deletions ksp_plugin/flight_plan.cpp
Original file line number Diff line number Diff line change
@@ -77,18 +77,17 @@ NavigationManœuvre const& FlightPlan::GetManœuvre(int const index) const {
return manœuvres_[index];
}

bool FlightPlan::Append(Burn burn) {
auto manœuvre =
MakeNavigationManœuvre(
std::move(burn),
manœuvres_.empty() ? initial_mass_ : manœuvres_.back().final_mass());
bool FlightPlan::Append(NavigationManœuvre::Burn const& burn) {
NavigationManœuvre const manœuvre(
manœuvres_.empty() ? initial_mass_ : manœuvres_.back().final_mass(),
burn);
if (manœuvre.FitsBetween(start_of_last_coast(), desired_final_time_) &&
!manœuvre.IsSingular()) {
DiscreteTrajectory<Barycentric>* recomputed_last_coast =
CoastIfReachesManœuvreInitialTime(last_coast(), manœuvre);
if (recomputed_last_coast != nullptr) {
ReplaceLastSegment(recomputed_last_coast);
Append(std::move(manœuvre));
Append(manœuvre);
return true;
}
}
@@ -148,10 +147,10 @@ void FlightPlan::RemoveLast() {
CoastLastSegment(desired_final_time_);
}

bool FlightPlan::ReplaceLast(Burn burn) {
bool FlightPlan::ReplaceLast(NavigationManœuvre::Burn const& burn) {
CHECK(!manœuvres_.empty());
auto manœuvre = MakeNavigationManœuvre(std::move(burn),
manœuvres_.back().initial_mass());
NavigationManœuvre const manœuvre(manœuvres_.back().initial_mass(),
std::move(burn));
if (manœuvre.FitsBetween(start_of_penultimate_coast(), desired_final_time_) &&
!manœuvre.IsSingular()) {
DiscreteTrajectory<Barycentric>* recomputed_penultimate_coast =
@@ -161,7 +160,7 @@ bool FlightPlan::ReplaceLast(Burn burn) {
PopLastSegment(); // Last coast.
PopLastSegment(); // Last burn.
ReplaceLastSegment(recomputed_penultimate_coast);
Append(std::move(manœuvre));
Append(manœuvre);
return true;
}
}
5 changes: 2 additions & 3 deletions ksp_plugin/flight_plan.hpp
Original file line number Diff line number Diff line change
@@ -6,7 +6,6 @@
#include "base/not_null.hpp"
#include "geometry/named_quantities.hpp"
#include "integrators/ordinary_differential_equations.hpp"
#include "ksp_plugin/burn.hpp"
#include "ksp_plugin/frames.hpp"
#include "ksp_plugin/manœuvre.hpp"
#include "physics/degrees_of_freedom.hpp"
@@ -61,7 +60,7 @@ class FlightPlan {
// |burn| would start before |initial_time_| or before the end of the previous
// burn, or end after |desired_final_time_|, or if the integration of the
// coasting phase times out or is singular before the burn.
virtual bool Append(Burn burn);
virtual bool Append(NavigationManœuvre::Burn const& burn);

// Forgets the flight plan at least before |time|. The actual cutoff time
// will be in a coast trajectory and may be after |time|. |on_empty| is run
@@ -74,7 +73,7 @@ class FlightPlan {
// |size()| must be greater than 0.
virtual void RemoveLast();
// |size()| must be greater than 0.
virtual bool ReplaceLast(Burn burn);
virtual bool ReplaceLast(NavigationManœuvre::Burn const& burn);

// Returns false and has no effect if |desired_final_time| is before the end
// of the last manœuvre or before |initial_time_|.
21 changes: 10 additions & 11 deletions ksp_plugin/interface_flight_plan.cpp
Original file line number Diff line number Diff line change
@@ -6,7 +6,6 @@
#include "glog/logging.h"
#include "journal/method.hpp"
#include "journal/profiles.hpp"
#include "ksp_plugin/burn.hpp"
#include "ksp_plugin/flight_plan.hpp"
#include "ksp_plugin/iterators.hpp"
#include "ksp_plugin/vessel.hpp"
@@ -55,13 +54,17 @@ using quantities::si::Tonne;

namespace {

ksp_plugin::Burn FromInterfaceBurn(Plugin const& plugin,
Burn const& burn) {
return {burn.thrust_in_kilonewtons * Kilo(Newton),
NavigationManœuvre::Burn FromInterfaceBurn(Plugin const& plugin,
Burn const& burn) {
NavigationManœuvre::Intensity intensity;
intensity.Δv = FromXYZ<Velocity<Frenet<NavigationFrame>>>(burn.delta_v);
NavigationManœuvre::Timing timing;
timing.initial_time = FromGameTime(plugin, burn.initial_time);
return {intensity,
timing,
burn.thrust_in_kilonewtons * Kilo(Newton),
burn.specific_impulse_in_seconds_g0 * Second * StandardGravity,
NewNavigationFrame(plugin, burn.frame),
FromGameTime(plugin, burn.initial_time),
FromXYZ<Velocity<Frenet<NavigationFrame>>>(burn.delta_v),
burn.is_inertially_fixed};
}

@@ -74,10 +77,6 @@ FlightPlan& GetFlightPlan(Plugin const& plugin,

Burn GetBurn(Plugin const& plugin,
NavigationManœuvre const& manœuvre) {
Velocity<Frenet<NavigationFrame>> const Δv =
manœuvre.Δv() == Speed() ? Velocity<Frenet<NavigationFrame>>()
: manœuvre.Δv() * manœuvre.direction();

// When building the parameters, make sure that the "optional" fields get a
// deterministic default.
NavigationFrameParameters parameters;
@@ -149,7 +148,7 @@ Burn GetBurn(Plugin const& plugin,
manœuvre.specific_impulse() / (Second * StandardGravity),
parameters,
ToGameTime(plugin, manœuvre.initial_time()),
ToXYZ(Δv),
ToXYZ(manœuvre.Δv()),
manœuvre.is_inertially_fixed()};
}

2 changes: 0 additions & 2 deletions ksp_plugin/ksp_plugin.vcxproj
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@
</PropertyGroup>
<Import Project="$(SolutionDir)principia.props" />
<ItemGroup>
<ClInclude Include="burn.hpp" />
<ClInclude Include="celestial.hpp" />
<ClInclude Include="identification.hpp" />
<ClInclude Include="integrators.hpp" />
@@ -41,7 +40,6 @@
<ClCompile Include="..\journal\profiles.cpp" />
<ClCompile Include="..\journal\recorder.cpp" />
<ClCompile Include="..\numerics\cbrt.cpp" />
<ClCompile Include="burn.cpp" />
<ClCompile Include="celestial.cpp" />
<ClCompile Include="flight_plan.cpp" />
<ClCompile Include="identification.cpp" />
6 changes: 0 additions & 6 deletions ksp_plugin/ksp_plugin.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -41,9 +41,6 @@
<ClInclude Include="flight_plan.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="burn.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="interface.generated.h">
<Filter>Header Files</Filter>
</ClInclude>
@@ -88,9 +85,6 @@
<ClCompile Include="flight_plan.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="burn.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="interface_flight_plan.cpp">
<Filter>Source Files</Filter>
</ClCompile>
Loading