Skip to content

Commit

Permalink
Merge pull request #621 from ut-issl/feature/remove-library-directory
Browse files Browse the repository at this point in the history
Remove library directory
  • Loading branch information
200km authored Mar 26, 2024
2 parents 0ac892d + 37cccba commit b86d9ac
Show file tree
Hide file tree
Showing 297 changed files with 428 additions and 398 deletions.
23 changes: 14 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ add_subdirectory(src/environment/local)
add_subdirectory(src/dynamics)
add_subdirectory(src/disturbances)
add_subdirectory(src/components)
add_subdirectory(src/library)
add_subdirectory(src/math_physics)
add_subdirectory(src/setting_file_reader)
add_subdirectory(src/logger)
add_subdirectory(src/utilities)
add_subdirectory(ExtLibraries/inih)

set(SOURCE_FILES
src/s2e.cpp
Expand Down Expand Up @@ -178,13 +182,14 @@ endif()
#target_link_libraries(${PROJECT_NAME} ${NRLMSISE00_LIB})

# Initialize link
target_link_libraries(COMPONENT DYNAMICS GLOBAL_ENVIRONMENT LOCAL_ENVIRONMENT LIBRARY)
target_link_libraries(DYNAMICS GLOBAL_ENVIRONMENT LOCAL_ENVIRONMENT SIMULATION LIBRARY)
target_link_libraries(DISTURBANCE DYNAMICS GLOBAL_ENVIRONMENT LOCAL_ENVIRONMENT LIBRARY)
target_link_libraries(SIMULATION DYNAMICS GLOBAL_ENVIRONMENT LOCAL_ENVIRONMENT DISTURBANCE LIBRARY)
target_link_libraries(GLOBAL_ENVIRONMENT ${CSPICE_LIB} LIBRARY)
target_link_libraries(LOCAL_ENVIRONMENT GLOBAL_ENVIRONMENT ${CSPICE_LIB} LIBRARY)
target_link_libraries(LIBRARY ${NRLMSISE00_LIB})
target_link_libraries(COMPONENT DYNAMICS GLOBAL_ENVIRONMENT LOCAL_ENVIRONMENT MATH_PHYSICS SETTING_FILE_READER LOGGER UTILITIES)
target_link_libraries(DYNAMICS GLOBAL_ENVIRONMENT LOCAL_ENVIRONMENT SIMULATION MATH_PHYSICS)
target_link_libraries(DISTURBANCE DYNAMICS GLOBAL_ENVIRONMENT LOCAL_ENVIRONMENT MATH_PHYSICS)
target_link_libraries(SIMULATION DYNAMICS GLOBAL_ENVIRONMENT LOCAL_ENVIRONMENT DISTURBANCE MATH_PHYSICS)
target_link_libraries(GLOBAL_ENVIRONMENT ${CSPICE_LIB} MATH_PHYSICS)
target_link_libraries(LOCAL_ENVIRONMENT GLOBAL_ENVIRONMENT ${CSPICE_LIB} MATH_PHYSICS)
target_link_libraries(MATH_PHYSICS ${NRLMSISE00_LIB})
target_link_libraries(SETTING_FILE_READER INIH)

target_link_libraries(${PROJECT_NAME} DYNAMICS)
target_link_libraries(${PROJECT_NAME} DISTURBANCE)
Expand Down Expand Up @@ -235,7 +240,7 @@ if(GOOGLE_TEST)

add_executable(${TEST_PROJECT_NAME} ${TEST_FILES})
target_link_libraries(${TEST_PROJECT_NAME} gtest gtest_main gmock)
target_link_libraries(${TEST_PROJECT_NAME} LIBRARY)
target_link_libraries(${TEST_PROJECT_NAME} MATH_PHYSICS)
include_directories(${TEST_PROJECT_NAME})
add_test(NAME s2e-test COMMAND ${TEST_PROJECT_NAME})
enable_testing()
Expand Down
9 changes: 9 additions & 0 deletions ExtLibraries/inih/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
project(INIH)
cmake_minimum_required(VERSION 3.13)

add_library(${PROJECT_NAME} STATIC
ini.c
cpp/INIReader.cpp
)

include(../../common.cmake)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion data/sample/initialize_files/sample_local_environment.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[MAGNETIC_FIELD_ENVIRONMENT]
calculation = ENABLE
logging = ENABLE
coefficient_file = CORE_DIR_FROM_EXE/src/library/external/igrf/igrf13.coef
coefficient_file = CORE_DIR_FROM_EXE/src/math_physics/geomagnetic/igrf13.coef
magnetic_field_random_walk_standard_deviation_nT = 10.0
magnetic_field_random_walk_limit_nT = 400.0
magnetic_field_white_noise_standard_deviation_nT = 50.0
Expand Down
2 changes: 1 addition & 1 deletion src/components/base/component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include <components/ports/power_port.hpp>
#include <environment/global/clock_generator.hpp>
#include <library/utilities/macros.hpp>
#include <utilities/macros.hpp>

#include "interface_tickable.hpp"

Expand Down
2 changes: 1 addition & 1 deletion src/components/base/i2c_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "i2c_controller.hpp"

#include <iostream>
#include <library/utilities/macros.hpp>
#include <utilities/macros.hpp>

I2cController::I2cController(const unsigned int hils_port_id, const unsigned int baud_rate, const unsigned int tx_buffer_size,
const unsigned int rx_buffer_size, HilsPortManager* hils_port_manager)
Expand Down
8 changes: 4 additions & 4 deletions src/components/base/sensor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
#ifndef S2E_COMPONENTS_BASE_SENSOR_HPP_
#define S2E_COMPONENTS_BASE_SENSOR_HPP_

#include <library/math/matrix.hpp>
#include <library/math/vector.hpp>
#include <library/randomization/normal_randomization.hpp>
#include <library/randomization/random_walk.hpp>
#include <math_physics/math/matrix.hpp>
#include <math_physics/math/vector.hpp>
#include <math_physics/randomization/normal_randomization.hpp>
#include <math_physics/randomization/random_walk.hpp>

/**
* @class Sensor
Expand Down
4 changes: 2 additions & 2 deletions src/components/base/sensor_template_functions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#ifndef S2E_COMPONENTS_BASE_SENSOR_TEMPLATE_FUNCTIONS_HPP_
#define S2E_COMPONENTS_BASE_SENSOR_TEMPLATE_FUNCTIONS_HPP_

#include <library/initialize/initialize_file_access.hpp>
#include <library/randomization/global_randomization.hpp>
#include <math_physics/randomization/global_randomization.hpp>
#include <setting_file_reader/initialize_file_access.hpp>

template <size_t N>
Sensor<N>::Sensor(const libra::Matrix<N, N>& scale_factor, const libra::Vector<N>& range_to_const_c, const libra::Vector<N>& range_to_zero_c,
Expand Down
2 changes: 1 addition & 1 deletion src/components/examples/example_change_structure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include "example_change_structure.hpp"

#include <library/math/matrix.hpp>
#include <math_physics/math/matrix.hpp>

ExampleChangeStructure::ExampleChangeStructure(ClockGenerator* clock_generator, Structure* structure)
: Component(1, clock_generator), structure_(structure) {}
Expand Down
2 changes: 1 addition & 1 deletion src/components/examples/example_change_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#ifndef S2E_COMPONENTS_EXAMPLES_EXAMPLE_CHANGE_STRUCTURE_HPP_
#define S2E_COMPONENTS_EXAMPLES_EXAMPLE_CHANGE_STRUCTURE_HPP_

#include <library/logger/loggable.hpp>
#include <logger/loggable.hpp>
#include <simulation/spacecraft/structure/structure.hpp>

#include "../base/component.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/
#include "example_serial_communication_for_hils.hpp"

#include <library/utilities/macros.hpp>
#include <utilities/macros.hpp>

ExampleSerialCommunicationForHils::ExampleSerialCommunicationForHils(ClockGenerator* clock_generator, const int sils_port_id, OnBoardComputer* obc,
const unsigned int hils_port_id, const unsigned int baud_rate,
Expand Down
2 changes: 1 addition & 1 deletion src/components/ideal/angular_velocity_observer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include "angular_velocity_observer.hpp"

#include <library/initialize/initialize_file_access.hpp>
#include <setting_file_reader/initialize_file_access.hpp>

AngularVelocityObserver::AngularVelocityObserver(const int prescaler, ClockGenerator* clock_generator, Sensor& sensor_base, const Attitude& attitude)
: Component(prescaler, clock_generator), Sensor(sensor_base), attitude_(attitude) {}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ideal/angular_velocity_observer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#define S2E_COMPONENTS_IDEAL_ANGULAR_VELOCITY_OBSERVER_HPP_

#include <dynamics/dynamics.hpp>
#include <library/logger/loggable.hpp>
#include <logger/loggable.hpp>

#include "../base/component.hpp"
#include "../base/sensor.hpp"
Expand Down
4 changes: 2 additions & 2 deletions src/components/ideal/attitude_observer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

#include "attitude_observer.hpp"

#include <library/initialize/initialize_file_access.hpp>
#include <library/math/constants.hpp>
#include <math_physics/math/constants.hpp>
#include <setting_file_reader/initialize_file_access.hpp>

AttitudeObserver::AttitudeObserver(const int prescaler, ClockGenerator* clock_generator, const double standard_deviation_rad,
const Attitude& attitude)
Expand Down
6 changes: 3 additions & 3 deletions src/components/ideal/attitude_observer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
#define S2E_COMPONENTS_IDEAL_ATTITUDE_OBSERVER_HPP_

#include <dynamics/attitude/attitude.hpp>
#include <library/logger/loggable.hpp>
#include <library/math/quaternion.hpp>
#include <library/randomization/normal_randomization.hpp>
#include <logger/loggable.hpp>
#include <math_physics/math/quaternion.hpp>
#include <math_physics/randomization/normal_randomization.hpp>

#include "../base/component.hpp"

Expand Down
2 changes: 1 addition & 1 deletion src/components/ideal/force_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "force_generator.hpp"

#include <cfloat>
#include <library/initialize/initialize_file_access.hpp>
#include <setting_file_reader/initialize_file_access.hpp>

// Constructor
ForceGenerator::ForceGenerator(const int prescaler, ClockGenerator* clock_generator, const double magnitude_error_standard_deviation_N,
Expand Down
6 changes: 3 additions & 3 deletions src/components/ideal/force_generator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

#include <components/base/component.hpp>
#include <dynamics/dynamics.hpp>
#include <library/logger/logger.hpp>
#include <library/math/vector.hpp>
#include <library/randomization/normal_randomization.hpp>
#include <logger/logger.hpp>
#include <math_physics/math/vector.hpp>
#include <math_physics/randomization/normal_randomization.hpp>

/*
* @class ForceGenerator
Expand Down
4 changes: 2 additions & 2 deletions src/components/ideal/orbit_observer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

#include "orbit_observer.hpp"

#include <library/initialize/initialize_file_access.hpp>
#include <library/randomization/global_randomization.hpp>
#include <math_physics/randomization/global_randomization.hpp>
#include <setting_file_reader/initialize_file_access.hpp>

OrbitObserver::OrbitObserver(const int prescaler, ClockGenerator* clock_generator, const NoiseFrame noise_frame,
const libra::Vector<6> error_standard_deviation, const Orbit& orbit)
Expand Down
6 changes: 3 additions & 3 deletions src/components/ideal/orbit_observer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
#define S2E_COMPONENTS_IDEAL_ORBIT_OBSERVER_HPP_

#include <dynamics/orbit/orbit.hpp>
#include <library/logger/loggable.hpp>
#include <library/math/vector.hpp>
#include <library/randomization/normal_randomization.hpp>
#include <logger/loggable.hpp>
#include <math_physics/math/vector.hpp>
#include <math_physics/randomization/normal_randomization.hpp>

#include "../base/component.hpp"

Expand Down
2 changes: 1 addition & 1 deletion src/components/ideal/torque_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "torque_generator.hpp"

#include <cfloat>
#include <library/initialize/initialize_file_access.hpp>
#include <setting_file_reader/initialize_file_access.hpp>

// Constructor
TorqueGenerator::TorqueGenerator(const int prescaler, ClockGenerator* clock_generator, const double magnitude_error_standard_deviation_Nm,
Expand Down
6 changes: 3 additions & 3 deletions src/components/ideal/torque_generator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

#include <components/base/component.hpp>
#include <dynamics/dynamics.hpp>
#include <library/logger/logger.hpp>
#include <library/math/vector.hpp>
#include <library/randomization/normal_randomization.hpp>
#include <logger/logger.hpp>
#include <math_physics/math/vector.hpp>
#include <math_physics/randomization/normal_randomization.hpp>

/*
* @class TorqueGenerator
Expand Down
2 changes: 1 addition & 1 deletion src/components/ports/i2c_port.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include "i2c_port.hpp"

#include <library/utilities/macros.hpp>
#include <utilities/macros.hpp>

I2cPort::I2cPort(void) {}

Expand Down
4 changes: 2 additions & 2 deletions src/components/ports/power_port.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#include "power_port.hpp"

#include <cfloat>
#include <library/initialize/initialize_file_access.hpp>
#include <library/utilities/macros.hpp>
#include <setting_file_reader/initialize_file_access.hpp>
#include <utilities/macros.hpp>

PowerPort::PowerPort() : kPortId(-1), current_limit_A_(10.0), minimum_voltage_V_(3.3), assumed_power_consumption_W_(0.0) {
is_on_ = true; // power on to work the component
Expand Down
2 changes: 1 addition & 1 deletion src/components/ports/uart_port.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#ifndef S2E_COMPONENTS_PORTS_UART_PORT_HPP_
#define S2E_COMPONENTS_PORTS_UART_PORT_HPP_

#include <library/utilities/ring_buffer.hpp>
#include <utilities/ring_buffer.hpp>

/**
* @class UartPort
Expand Down
6 changes: 3 additions & 3 deletions src/components/real/aocs/gnss_receiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
#include "gnss_receiver.hpp"

#include <environment/global/physical_constants.hpp>
#include <library/gnss/gnss_satellite_number.hpp>
#include <library/initialize/initialize_file_access.hpp>
#include <library/randomization/global_randomization.hpp>
#include <math_physics/gnss/gnss_satellite_number.hpp>
#include <math_physics/randomization/global_randomization.hpp>
#include <setting_file_reader/initialize_file_access.hpp>
#include <string>

GnssReceiver::GnssReceiver(const int prescaler, ClockGenerator* clock_generator, const size_t component_id, const AntennaModel antenna_model,
Expand Down
8 changes: 4 additions & 4 deletions src/components/real/aocs/gnss_receiver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
#include <dynamics/dynamics.hpp>
#include <environment/global/gnss_satellites.hpp>
#include <environment/global/simulation_time.hpp>
#include <library/geodesy/geodetic_position.hpp>
#include <library/logger/loggable.hpp>
#include <library/math/quaternion.hpp>
#include <library/randomization/normal_randomization.hpp>
#include <logger/loggable.hpp>
#include <math_physics/geodesy/geodetic_position.hpp>
#include <math_physics/math/quaternion.hpp>
#include <math_physics/randomization/normal_randomization.hpp>

#include "../../base/component.hpp"

Expand Down
2 changes: 1 addition & 1 deletion src/components/real/aocs/gyro_sensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include "gyro_sensor.hpp"

#include <library/initialize/initialize_file_access.hpp>
#include <setting_file_reader/initialize_file_access.hpp>

GyroSensor::GyroSensor(const int prescaler, ClockGenerator* clock_generator, Sensor& sensor_base, const unsigned int sensor_id,
const libra::Quaternion& quaternion_b2c, const Dynamics* dynamics)
Expand Down
4 changes: 2 additions & 2 deletions src/components/real/aocs/gyro_sensor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
#define S2E_COMPONENTS_REAL_AOCS_GYRO_SENSOR_HPP_

#include <dynamics/dynamics.hpp>
#include <library/logger/loggable.hpp>
#include <library/math/quaternion.hpp>
#include <logger/loggable.hpp>
#include <math_physics/math/quaternion.hpp>

#include "../../base/component.hpp"
#include "../../base/sensor.hpp"
Expand Down
4 changes: 2 additions & 2 deletions src/components/real/aocs/magnetometer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
*/
#include "magnetometer.hpp"

#include <library/initialize/initialize_file_access.hpp>
#include <library/math/quaternion.hpp>
#include <math_physics/math/quaternion.hpp>
#include <setting_file_reader/initialize_file_access.hpp>

Magnetometer::Magnetometer(int prescaler, ClockGenerator* clock_generator, Sensor& sensor_base, const unsigned int sensor_id,
const libra::Quaternion& quaternion_b2c, const GeomagneticField* geomagnetic_field)
Expand Down
4 changes: 2 additions & 2 deletions src/components/real/aocs/magnetometer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
#define S2E_COMPONENTS_REAL_AOCS_MAGNETOMETER_HPP_

#include <environment/local/local_environment.hpp>
#include <library/logger/loggable.hpp>
#include <library/math/quaternion.hpp>
#include <logger/loggable.hpp>
#include <math_physics/math/quaternion.hpp>

#include "../../base/component.hpp"
#include "../../base/sensor.hpp"
Expand Down
10 changes: 5 additions & 5 deletions src/components/real/aocs/magnetorquer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

#include "magnetorquer.hpp"

#include <library/initialize/initialize_file_access.hpp>
#include <library/logger/logger.hpp>
#include <library/math/matrix_vector.hpp>
#include <library/math/quaternion.hpp>
#include <library/randomization/global_randomization.hpp>
#include <logger/logger.hpp>
#include <math_physics/math/matrix_vector.hpp>
#include <math_physics/math/quaternion.hpp>
#include <math_physics/randomization/global_randomization.hpp>
#include <setting_file_reader/initialize_file_access.hpp>

Magnetorquer::Magnetorquer(const int prescaler, ClockGenerator* clock_generator, const int component_id, const libra::Quaternion& quaternion_b2c,
const libra::Matrix<kMtqDimension, kMtqDimension>& scale_factor,
Expand Down
12 changes: 6 additions & 6 deletions src/components/real/aocs/magnetorquer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
#define S2E_COMPONENTS_REAL_AOCS_MAGNETORQUER_HPP_

#include <environment/local/local_environment.hpp>
#include <library/logger/loggable.hpp>
#include <library/math/matrix.hpp>
#include <library/math/quaternion.hpp>
#include <library/math/vector.hpp>
#include <library/randomization/normal_randomization.hpp>
#include <library/randomization/random_walk.hpp>
#include <logger/loggable.hpp>
#include <math_physics/math/matrix.hpp>
#include <math_physics/math/quaternion.hpp>
#include <math_physics/math/vector.hpp>
#include <math_physics/randomization/normal_randomization.hpp>
#include <math_physics/randomization/random_walk.hpp>

#include "../../base/component.hpp"

Expand Down
2 changes: 1 addition & 1 deletion src/components/real/aocs/mtq_magnetometer_interference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include "mtq_magnetometer_interference.hpp"

#include "library/initialize/initialize_file_access.hpp"
#include "setting_file_reader/initialize_file_access.hpp"

MtqMagnetometerInterference::MtqMagnetometerInterference(const std::string file_name, Magnetometer& magnetometer, const Magnetorquer& magnetorquer,
const size_t initialize_id)
Expand Down
Loading

0 comments on commit b86d9ac

Please sign in to comment.