Tudat/JsonInterface/UnitTests/unitTestRotationModel.cpp
// Test 2: simple rotation model
Test 2: simple rotation model
Test 2 : simple rotation model
BOOST_AUTO_TEST_CASE( test_json_rotationModel_simple )
{
    using namespace simulation_setup;
    using namespace spice_interface;
    using namespace json_interface;
    loadStandardSpiceKernels( );
    const std::shared_ptr< RotationModelSettings > fromFileSettings =
            parseJSONFile< std::shared_ptr< RotationModelSettings > >( INPUT( "simple" ) );
    const std::string originalFrame = "ECLIPJ2000";
    const std::string targetFrame = "IAU_Earth";
    const double initialTime = 42.0;
    const Eigen::Quaterniond initialOrientation =
            spice_interface::computeRotationQuaternionBetweenFrames( originalFrame, targetFrame, initialTime );
    const double rotationRate = 2.0e-5;
    const std::shared_ptr< RotationModelSettings > manualSettings =
            std::make_shared< SimpleRotationModelSettings >( originalFrame,
                                                               targetFrame,
                                                               initialOrientation,
                                                               initialTime,
                                                               rotationRate );
    BOOST_CHECK_EQUAL_JSON( fromFileSettings, manualSettings );
}
BOOST_AUTO_TEST_CASE ( test_json_rotationModel_simple ) { using namespace simulation_setup ; using namespace spice_interface ; using namespace json_interface ; loadStandardSpiceKernels ( ) ; const std :: shared_ptr < RotationModelSettings > fromFileSettings = parseJSONFile < std :: shared_ptr < RotationModelSettings > > ( INPUT ( " " ) ) ; const std :: string originalFrame = " " ; const std :: string targetFrame = " " ; const double initialTime = 42.0 ; const Eigen :: Quaterniond initialOrientation = spice_interface :: computeRotationQuaternionBetweenFrames ( originalFrame , targetFrame , initialTime ) ; const double rotationRate = 2.0e-5 ; const std :: shared_ptr < RotationModelSettings > manualSettings = std :: make_shared < SimpleRotationModelSettings > ( originalFrame , targetFrame , initialOrientation , initialTime , rotationRate ) ; BOOST_CHECK_EQUAL_JSON ( fromFileSettings , manualSettings ) ; }
Test 2: simple rotation model
Test 2 : simple rotation model
// Load spice kernels (needed for computeRotationQuaternionBetweenFrames) // Create RotationModelSettings from JSON file // Create RotationModelSettings manually // Compare