-
Notifications
You must be signed in to change notification settings - Fork 70
Lamont endpoints #1729
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
Lamont endpoints #1729
Conversation
serialization/journal.proto
Outdated
@@ -340,6 +346,57 @@ message EndInitialization { | |||
optional In in = 1; | |||
} | |||
|
|||
// These functions form the external API of principia; announce deprecation one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Principia
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
ksp_plugin/interface_external.cpp
Outdated
|
||
// This is called "New" because it will eventually construct and release the | ||
// message string. For now it just wraps the error code. | ||
Status NewStatus(base::Status status) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
ksp_plugin/interface_external.cpp
Outdated
|
||
namespace { | ||
|
||
// This is called "New" because it will eventually construct and release the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would call in MakeStatus for now. Who knows what it will become once we have proper allocation/deallocation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
ksp_plugin/interface_external.cpp
Outdated
u8" planned manœuvres")); | ||
} | ||
// The index of the coast segment following the desired manœuvre. | ||
int const segment_index = manoeuvre_index * 2 + 3; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This cannot be odd I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
ksp_plugin/interface_external.cpp
Outdated
immobile_reference.Append(coast.Begin().time(), | ||
{reference_position, Velocity<Navigation>{}}); | ||
if (coast.Begin() != | ||
coast.last()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strange formatting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, Empty would be more efficient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or Size.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
reference_position).Norm²() < | ||
(coast.last().degrees_of_freedom().position() - | ||
reference_position).Norm²(); | ||
*world_body_centred_nearest_degrees_of_freedom = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
begin_is_nearest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
serialization/journal.proto
Outdated
// These functions form the external API of principia; announce deprecation one | ||
// lunation ahead, then make them return UNIMPLEMENTED. | ||
|
||
message ExternalFlowFreefall { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment the messages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
{-100'000 * Kilo(Metre), 0 * Metre, 0 * Metre})).coordinates() / | ||
Metre), | ||
&result); | ||
EXPECT_THAT(status.error, Eq(static_cast<int>(base::Error::OK))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would do the reverse:
EXPECT_THAT(static_cast<base::Error>(status.error), IsOk());
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
auto const barycentric_result = | ||
to_world.Inverse()(FromQP<RelativeDegreesOfFreedom<World>>(result)); | ||
// The reference position is far above the apoapsis, so the result is roughly | ||
// the apoapsis. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the apoapsis be deduced from the other parameters, to avoid hard-wiring numbers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not quite the apoapsis, so the test would get complicated. This is easy to understand (and with IsNear, it shouldn't break because of changes in the numerical methods).
ksp_plugin_test/test_plugin.cpp
Outdated
Vessel& TestPlugin::AddVesselInEarthOrbit( | ||
GUID const& vessel_id, | ||
std::string const& vessel_name, | ||
PartId part_id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
ksp_plugin_test/test_plugin.cpp
Outdated
SolarSystemFactory::Earth, | ||
/*loaded=*/false, | ||
inserted); | ||
CHECK(inserted); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Print the vessel id and name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
using physics::KeplerianElements; | ||
using physics::SolarSystem; | ||
|
||
class TestPlugin : public Plugin { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a short comment for the constructor and the method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
serialization/journal.proto
Outdated
optional Return return = 3; | ||
} | ||
|
||
// Returns first point of the coast phase following the given manoeuvre which is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returns the first
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
LG, but let's make sure that Jenkins is still happy. |
Introducing an external API. 🚕
Feature request: #1659.
Currently untested, and one of the functions is unimplemented, however @lamont-granquist has at least been able to find it by reflection. Let us get this in master so that it does not get broken by other changes.
We should add a way to marshal a string within a returned struct; currently the status has no error message.