|
1 | 1 |
|
2 | 2 | #include "ksp_plugin/manœuvre.hpp"
|
3 | 3 |
|
| 4 | +#include "base/not_null.hpp" |
4 | 5 | #include "geometry/frame.hpp"
|
| 6 | +#include "geometry/grassmann.hpp" |
5 | 7 | #include "geometry/named_quantities.hpp"
|
| 8 | +#include "geometry/orthogonal_map.hpp" |
| 9 | +#include "geometry/rotation.hpp" |
6 | 10 | #include "gmock/gmock.h"
|
7 | 11 | #include "gtest/gtest.h"
|
8 | 12 | #include "ksp_plugin/frames.hpp"
|
9 | 13 | #include "physics/continuous_trajectory.hpp"
|
10 |
| -#include "physics/discrete_trajectory.hpp" |
| 14 | +#include "physics/discrete_traject0ry.hpp" |
| 15 | +#include "physics/dynamic_frame.hpp" |
11 | 16 | #include "physics/massive_body.hpp"
|
12 | 17 | #include "physics/mock_dynamic_frame.hpp"
|
13 | 18 | #include "physics/mock_ephemeris.hpp"
|
| 19 | +#include "physics/rigid_motion.hpp" |
| 20 | +#include "quantities/elementary_functions.hpp" |
| 21 | +#include "quantities/named_quantities.hpp" |
14 | 22 | #include "quantities/numbers.hpp"
|
| 23 | +#include "quantities/quantities.hpp" |
15 | 24 | #include "quantities/uk.hpp"
|
16 | 25 | #include "testing_utilities/almost_equals.hpp"
|
17 | 26 | #include "testing_utilities/approximate_quantity.hpp"
|
|
22 | 31 |
|
23 | 32 | namespace principia {
|
24 | 33 | namespace ksp_plugin {
|
25 |
| -namespace internal_manœuvre { |
26 | 34 |
|
| 35 | +using base::not_null; |
27 | 36 | using base::make_not_null_unique;
|
28 | 37 | using geometry::AngularVelocity;
|
29 | 38 | using geometry::Arbitrary;
|
30 | 39 | using geometry::Displacement;
|
31 | 40 | using geometry::Frame;
|
32 | 41 | using geometry::Handedness;
|
| 42 | +using geometry::Instant; |
| 43 | +using geometry::OrthogonalMap; |
33 | 44 | using geometry::RigidTransformation;
|
| 45 | +using geometry::Rotation; |
| 46 | +using geometry::Vector; |
34 | 47 | using geometry::Velocity;
|
35 | 48 | using physics::ContinuousTrajectory;
|
36 | 49 | using physics::DegreesOfFreedom;
|
37 |
| -using physics::DiscreteTrajectory; |
| 50 | +using physics::DiscreteTraject0ry; |
| 51 | +using physics::Frenet; |
38 | 52 | using physics::MassiveBody;
|
39 | 53 | using physics::MockDynamicFrame;
|
40 | 54 | using physics::MockEphemeris;
|
| 55 | +using physics::RigidMotion; |
| 56 | +using quantities::Force; |
41 | 57 | using quantities::GravitationalParameter;
|
| 58 | +using quantities::Mass; |
42 | 59 | using quantities::Pow;
|
| 60 | +using quantities::Speed; |
| 61 | +using quantities::Sqrt; |
| 62 | +using quantities::Variation; |
43 | 63 | using quantities::si::Kilo;
|
44 | 64 | using quantities::si::Kilogram;
|
45 | 65 | using quantities::si::Metre;
|
@@ -80,7 +100,7 @@ class ManœuvreTest : public ::testing::Test {
|
80 | 100 |
|
81 | 101 | Instant const t0_;
|
82 | 102 | StrictMock<MockDynamicFrame<World, Rendering>> const* mock_dynamic_frame_;
|
83 |
| - DiscreteTrajectory<World> discrete_trajectory_; |
| 103 | + DiscreteTraject0ry<World> discrete_trajectory_; |
84 | 104 | DegreesOfFreedom<World> const dof_ = {
|
85 | 105 | World::origin + Displacement<World>({1 * Metre, 9 * Metre, 5 * Metre}),
|
86 | 106 | Velocity<World>(
|
@@ -144,7 +164,7 @@ TEST_F(ManœuvreTest, TimedBurn) {
|
144 | 164 | FrenetFrame(manœuvre.initial_time(), rendering_dof_))
|
145 | 165 | .WillOnce(
|
146 | 166 | Return(Rotation<Frenet<Rendering>, Rendering>::Identity()));
|
147 |
| - manœuvre.set_coasting_trajectory(&discrete_trajectory_); |
| 167 | + manœuvre.set_coasting_trajectory(discrete_trajectory_.segments().begin()); |
148 | 168 | auto const acceleration = manœuvre.InertialIntrinsicAcceleration();
|
149 | 169 | EXPECT_EQ(
|
150 | 170 | 0 * Metre / Pow<2>(Second),
|
@@ -207,7 +227,7 @@ TEST_F(ManœuvreTest, TargetΔv) {
|
207 | 227 | FrenetFrame(manœuvre.initial_time(), rendering_dof_))
|
208 | 228 | .WillOnce(
|
209 | 229 | Return(Rotation<Frenet<Rendering>, Rendering>::Identity()));
|
210 |
| - manœuvre.set_coasting_trajectory(&discrete_trajectory_); |
| 230 | + manœuvre.set_coasting_trajectory(discrete_trajectory_.segments().begin()); |
211 | 231 | auto const acceleration = manœuvre.InertialIntrinsicAcceleration();
|
212 | 232 | EXPECT_EQ(
|
213 | 233 | 0 * Metre / Pow<2>(Second),
|
@@ -292,7 +312,8 @@ TEST_F(ManœuvreTest, Apollo8SIVB) {
|
292 | 312 | FrenetFrame(first_manœuvre.initial_time(), rendering_dof_))
|
293 | 313 | .WillOnce(
|
294 | 314 | Return(Rotation<Frenet<Rendering>, Rendering>::Identity()));
|
295 |
| - first_manœuvre.set_coasting_trajectory(&discrete_trajectory_); |
| 315 | + first_manœuvre.set_coasting_trajectory( |
| 316 | + discrete_trajectory_.segments().begin()); |
296 | 317 | auto const first_acceleration =
|
297 | 318 | first_manœuvre.InertialIntrinsicAcceleration();
|
298 | 319 | EXPECT_THAT(
|
@@ -338,7 +359,8 @@ TEST_F(ManœuvreTest, Apollo8SIVB) {
|
338 | 359 | FrenetFrame(second_manœuvre.initial_time(), rendering_dof_))
|
339 | 360 | .WillOnce(
|
340 | 361 | Return(Rotation<Frenet<Rendering>, Rendering>::Identity()));
|
341 |
| - second_manœuvre.set_coasting_trajectory(&discrete_trajectory_); |
| 362 | + second_manœuvre.set_coasting_trajectory( |
| 363 | + discrete_trajectory_.segments().begin()); |
342 | 364 | auto const second_acceleration =
|
343 | 365 | second_manœuvre.InertialIntrinsicAcceleration();
|
344 | 366 | EXPECT_THAT(second_acceleration(second_manœuvre.initial_time()).Norm(),
|
@@ -430,6 +452,5 @@ TEST_F(ManœuvreTest, Serialization) {
|
430 | 452 | EXPECT_EQ(t0_, manœuvre_read.time_of_half_Δv());
|
431 | 453 | }
|
432 | 454 |
|
433 |
| -} // namespace internal_manœuvre |
434 | 455 | } // namespace ksp_plugin
|
435 | 456 | } // namespace principia
|
0 commit comments