From 71601085aadea56725fb23bcb2e470ad3beb87ed Mon Sep 17 00:00:00 2001 From: Vishwa Shah Date: Sat, 3 Aug 2024 20:18:22 -0700 Subject: [PATCH] feat: c++ compatibility (#425) * feat: c++ 20 compatibility * chore: warnings --- .gitignore | 1 + CMakeLists.txt | 24 +-- bindings/python/requirements.txt | 9 +- .../Trajectory/LocalOrbitalFrameFactory.cpp | 2 +- .../LocalOrbitalFrameTransformProvider.cpp | 4 +- .../Trajectory/Orbit.cpp | 4 +- docker/development/Dockerfile | 165 ++++++++---------- .../LocalOrbitalFrameTransformProvider.hpp | 9 +- .../Astrodynamics/Trajectory/Orbit.hpp | 14 +- .../Astrodynamics/Trajectory/Segment.hpp | 4 +- .../Solvers/FiniteDifferenceSolver.cpp | 2 +- .../Astrodynamics/Trajectory/Orbit.cpp | 5 +- .../Astrodynamics/Trajectory/Segment.cpp | 7 +- .../Dynamics/PositionDerivative.test.cpp | 2 +- .../GuidanceLaw/ConstantThrust.test.cpp | 2 +- .../Trajectory/Sequence.test.cpp | 2 +- 16 files changed, 123 insertions(+), 133 deletions(-) diff --git a/.gitignore b/.gitignore index 7bdc11c7c..bc9f30ff9 100755 --- a/.gitignore +++ b/.gitignore @@ -54,3 +54,4 @@ __pycache__ .ipynb_checkpoints .open-space-toolkit share/OpenSpaceToolkit/* +scripts diff --git a/CMakeLists.txt b/CMakeLists.txt index b17dc6920..351328737 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -119,9 +119,9 @@ ENDIF () IF (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - IF (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) + IF (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13) - MESSAGE (FATAL_ERROR "GCC version must be at least 4.8") + MESSAGE (FATAL_ERROR "GCC version must be at least 13") ENDIF () @@ -129,9 +129,9 @@ IF (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") ENDIF () -### C++ 17 support +### C++ 20 support -SET (CMAKE_CXX_STANDARD 17) +SET (CMAKE_CXX_STANDARD 20) SET (CMAKE_CXX_STANDARD_REQUIRED ON) SET (CMAKE_CXX_EXTENSIONS OFF) @@ -274,9 +274,9 @@ ELSE () MESSAGE (SEND_ERROR "[NLopt] not found.") ENDIF () -### Open Space Toolkit ▸ Core [3.x.y] +### Open Space Toolkit ▸ Core [4.x.y] -FIND_PACKAGE ("OpenSpaceToolkitCore" "3" REQUIRED) +FIND_PACKAGE ("OpenSpaceToolkitCore" "4" REQUIRED) IF (NOT OpenSpaceToolkitCore_FOUND) @@ -284,9 +284,9 @@ IF (NOT OpenSpaceToolkitCore_FOUND) ENDIF () -### Open Space Toolkit ▸ I/O [3.x.y] +### Open Space Toolkit ▸ I/O [4.x.y] -FIND_PACKAGE ("OpenSpaceToolkitIO" "3" REQUIRED) +FIND_PACKAGE ("OpenSpaceToolkitIO" "4" REQUIRED) IF (NOT OpenSpaceToolkitIO_FOUND) @@ -294,9 +294,9 @@ IF (NOT OpenSpaceToolkitIO_FOUND) ENDIF () -### Open Space Toolkit ▸ Mathematics [3.x.y] +### Open Space Toolkit ▸ Mathematics [4.x.y] -FIND_PACKAGE ("OpenSpaceToolkitMathematics" "3" REQUIRED) +FIND_PACKAGE ("OpenSpaceToolkitMathematics" "4" REQUIRED) IF (NOT OpenSpaceToolkitMathematics_FOUND) @@ -304,9 +304,9 @@ IF (NOT OpenSpaceToolkitMathematics_FOUND) ENDIF () -### Open Space Toolkit ▸ Physics [7.x.y] +### Open Space Toolkit ▸ Physics [8.x.y] -FIND_PACKAGE ("OpenSpaceToolkitPhysics" "7" REQUIRED) +FIND_PACKAGE ("OpenSpaceToolkitPhysics" "8" REQUIRED) IF (NOT OpenSpaceToolkitPhysics_FOUND) diff --git a/bindings/python/requirements.txt b/bindings/python/requirements.txt index 4704968c2..c648330db 100644 --- a/bindings/python/requirements.txt +++ b/bindings/python/requirements.txt @@ -1,7 +1,6 @@ # Apache License 2.0 -open-space-toolkit-core~=3.1 -open-space-toolkit-io~=3.0 -open-space-toolkit-mathematics~=3.1 -open-space-toolkit-physics~=7.1 -numpy~=2.0 +open-space-toolkit-core~=4.0 +open-space-toolkit-io~=4.0 +open-space-toolkit-mathematics~=4.0 +open-space-toolkit-physics~=8.0 \ No newline at end of file diff --git a/bindings/python/src/OpenSpaceToolkitAstrodynamicsPy/Trajectory/LocalOrbitalFrameFactory.cpp b/bindings/python/src/OpenSpaceToolkitAstrodynamicsPy/Trajectory/LocalOrbitalFrameFactory.cpp index 7750e7617..36699ef7c 100644 --- a/bindings/python/src/OpenSpaceToolkitAstrodynamicsPy/Trajectory/LocalOrbitalFrameFactory.cpp +++ b/bindings/python/src/OpenSpaceToolkitAstrodynamicsPy/Trajectory/LocalOrbitalFrameFactory.cpp @@ -136,7 +136,7 @@ inline void OpenSpaceToolkitAstrodynamicsPy_Trajectory_LocalOrbitalFrameFactory( &LocalOrbitalFrameFactory::TNW, arg("parent_frame"), R"doc( - Get a Topocentric North-West-Up (TNW) local orbital frame factory. + Get a Tangent-Normal-Wideband (TNW) local orbital frame factory. Args: parent_frame (Frame): The parent frame. diff --git a/bindings/python/src/OpenSpaceToolkitAstrodynamicsPy/Trajectory/LocalOrbitalFrameTransformProvider.cpp b/bindings/python/src/OpenSpaceToolkitAstrodynamicsPy/Trajectory/LocalOrbitalFrameTransformProvider.cpp index 2abefbbdc..6d476dd20 100644 --- a/bindings/python/src/OpenSpaceToolkitAstrodynamicsPy/Trajectory/LocalOrbitalFrameTransformProvider.cpp +++ b/bindings/python/src/OpenSpaceToolkitAstrodynamicsPy/Trajectory/LocalOrbitalFrameTransformProvider.cpp @@ -38,8 +38,8 @@ inline void OpenSpaceToolkitAstrodynamicsPy_Trajectory_LocalOrbitalFrameTransfor .value("LVLHGD", LocalOrbitalFrameTransformProvider::Type::LVLHGD, "Local Vertical-Local Horizontal Geodetic") .value("VVLH", LocalOrbitalFrameTransformProvider::Type::VVLH, "Vertical-Local Horizontal") .value("QSW", LocalOrbitalFrameTransformProvider::Type::QSW, "Quasi-Satellite West") - .value("TNW", LocalOrbitalFrameTransformProvider::Type::TNW, "Topocentric North-West") - .value("VNC", LocalOrbitalFrameTransformProvider::Type::VNC, "Velocity-Normal-Co-normal") + .value("TNW", LocalOrbitalFrameTransformProvider::Type::TNW, "Tangent-Normal-Wideband") + .value("VNC", LocalOrbitalFrameTransformProvider::Type::VNC, "Velocity-Normal-Conormal") ; diff --git a/bindings/python/src/OpenSpaceToolkitAstrodynamicsPy/Trajectory/Orbit.cpp b/bindings/python/src/OpenSpaceToolkitAstrodynamicsPy/Trajectory/Orbit.cpp index 810c05fcf..8db8dc3fd 100644 --- a/bindings/python/src/OpenSpaceToolkitAstrodynamicsPy/Trajectory/Orbit.cpp +++ b/bindings/python/src/OpenSpaceToolkitAstrodynamicsPy/Trajectory/Orbit.cpp @@ -54,8 +54,8 @@ inline void OpenSpaceToolkitAstrodynamicsPy_Trajectory_Orbit(pybind11::module& a .value("LVLHGDGT", Orbit::FrameType::LVLHGDGT, "Local Vertical-Local Horizontal GeoDetic Ground Track") .value("VVLH", Orbit::FrameType::VVLH, "Vertical-Local Horizontal") .value("QSW", Orbit::FrameType::QSW, "Quasi-Satellite West") - .value("TNW", Orbit::FrameType::TNW, "Topocentric North-West") - .value("VNC", Orbit::FrameType::VNC, "Velocity-Normal-Co-normal") + .value("TNW", Orbit::FrameType::TNW, "Tangent-Normal-Wideband") + .value("VNC", Orbit::FrameType::VNC, "Velocity-Normal-Conormal") ; diff --git a/docker/development/Dockerfile b/docker/development/Dockerfile index 838d8cd8e..e96bb792f 100644 --- a/docker/development/Dockerfile +++ b/docker/development/Dockerfile @@ -13,153 +13,140 @@ LABEL maintainer="lucas@loftorbital.com" ## Additional deps RUN apt-get update \ - && apt-get install -y unzip jq git-lfs locales \ - && rm -rf /var/lib/apt/lists/* - -## {fmt} - -ARG FMT_VERSION="5.2.0" - -RUN git clone --branch ${FMT_VERSION} --depth 1 https://github.com/fmtlib/fmt.git /tmp/fmt \ - && cd /tmp/fmt \ - && mkdir build \ - && cd build \ - && cmake -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE .. \ - && make --silent -j $(nproc) \ - && make install \ - && rm -rf /tmp/fmt + && apt-get install -y unzip jq git-lfs locales \ + && rm -rf /var/lib/apt/lists/* ## ordered-map ARG ORDERED_MAP_VERSION="0.6.0" RUN git clone --branch v${ORDERED_MAP_VERSION} --depth 1 https://github.com/Tessil/ordered-map.git /tmp/ordered-map \ - && cd /tmp/ordered-map \ - && cp -r ./include/tsl /usr/local/include \ - && rm -rf /tmp/ordered-map + && cd /tmp/ordered-map \ + && cp -r ./include/tsl /usr/local/include \ + && rm -rf /tmp/ordered-map ## Eigen ARG EIGEN_VERSION="3.4.0" RUN mkdir /tmp/eigen \ - && cd /tmp/eigen \ - && wget --quiet https://gitlab.com/libeigen/eigen/-/archive/${EIGEN_VERSION}/eigen-${EIGEN_VERSION}.tar.gz \ - && tar -xvf eigen-${EIGEN_VERSION}.tar.gz \ - && cd eigen-${EIGEN_VERSION} \ - && mkdir build \ - && cd build \ - && cmake .. \ - && make install \ - && rm -rf /tmp/eigen + && cd /tmp/eigen \ + && wget --quiet https://gitlab.com/libeigen/eigen/-/archive/${EIGEN_VERSION}/eigen-${EIGEN_VERSION}.tar.gz \ + && tar -xvf eigen-${EIGEN_VERSION}.tar.gz \ + && cd eigen-${EIGEN_VERSION} \ + && mkdir build \ + && cd build \ + && cmake .. \ + && make install \ + && rm -rf /tmp/eigen ## SGP4 ARG SGP4_VERSION="6a448b4" RUN git clone https://github.com/dnwrnr/sgp4.git /tmp/sgp4 \ - && cd /tmp/sgp4 \ - && git checkout ${SGP4_VERSION} \ - && mkdir build \ - && cd build \ - && cmake -DCMAKE_CXX_FLAGS="-fPIC" .. \ - && make -j $(nproc) \ - && mkdir /usr/local/include/sgp4 \ - && cp ../libsgp4/*.h /usr/local/include/sgp4/ \ - && cp libsgp4/*.a /usr/local/lib \ - && rm -rf /tmp/sgp4 + && cd /tmp/sgp4 \ + && git checkout ${SGP4_VERSION} \ + && mkdir build \ + && cd build \ + && cmake -DCMAKE_CXX_FLAGS="-fPIC" .. \ + && make -j $(nproc) \ + && mkdir /usr/local/include/sgp4 \ + && cp ../libsgp4/*.h /usr/local/include/sgp4/ \ + && cp libsgp4/*.a /usr/local/lib \ + && rm -rf /tmp/sgp4 ## NLopt ARG NLOPT_VERSION="2.5.0" RUN git clone --branch v${NLOPT_VERSION} --depth 1 https://github.com/stevengj/nlopt.git /tmp/nlopt \ - && cd /tmp/nlopt \ - && mkdir build \ - && cd build \ - && cmake -DBUILD_SHARED_LIBS=OFF .. \ - && make \ - && make install \ - && rm -rf /tmp/nlopt + && cd /tmp/nlopt \ + && mkdir build \ + && cd build \ + && cmake -DBUILD_SHARED_LIBS=OFF .. \ + && make \ + && make install \ + && rm -rf /tmp/nlopt ## benchmark ARG BENCHMARK_VERSION="1.8.2" RUN git clone --branch v${BENCHMARK_VERSION} https://github.com/google/benchmark.git /tmp/benchmark \ - && cd /tmp/benchmark \ - && cmake -E make_directory "build" \ - && cmake -E chdir "build" cmake -DBENCHMARK_DOWNLOAD_DEPENDENCIES=on -DCMAKE_BUILD_TYPE=Release ../ \ - && cmake --build "build" --config Release --target install \ - && rm -rf /tmp/benchmark + && cd /tmp/benchmark \ + && cmake -E make_directory "build" \ + && cmake -E chdir "build" cmake -DBENCHMARK_DOWNLOAD_DEPENDENCIES=on -DCMAKE_BUILD_TYPE=Release ../ \ + && cmake --build "build" --config Release --target install \ + && rm -rf /tmp/benchmark ## Open Space Toolkit ▸ Core ARG TARGETPLATFORM -ARG OSTK_CORE_MAJOR="3" +ARG OSTK_CORE_MAJOR="4" ## Force an image rebuild when new minor or Core patch versions are detected ADD https://api.github.com/repos/open-space-collective/open-space-toolkit-core/git/matching-refs/tags/${OSTK_CORE_MAJOR} /tmp/open-space-toolkit-core/versions.json RUN mkdir -p /tmp/open-space-toolkit-core \ - && cd /tmp/open-space-toolkit-core \ - && export LATEST_PATCH_OF_MINOR=$(jq -r .[-1].ref versions.json | cut -d "/" -f3) \ - && export PACKAGE_PLATFORM=$(if [ ${TARGETPLATFORM} = "linux/amd64" ]; then echo "x86_64"; elif [ ${TARGETPLATFORM} = "linux/arm64" ]; then echo "aarch64"; else echo "Unknown platform" && exit 1; fi;) \ - && wget --quiet https://github.com/open-space-collective/open-space-toolkit-core/releases/download/${LATEST_PATCH_OF_MINOR}/open-space-toolkit-core-${LATEST_PATCH_OF_MINOR}-1.${PACKAGE_PLATFORM}-runtime.deb \ - && wget --quiet https://github.com/open-space-collective/open-space-toolkit-core/releases/download/${LATEST_PATCH_OF_MINOR}/open-space-toolkit-core-${LATEST_PATCH_OF_MINOR}-1.${PACKAGE_PLATFORM}-devel.deb \ - && apt-get install -y ./*.deb \ - && rm -rf /tmp/open-space-toolkit-core + && cd /tmp/open-space-toolkit-core \ + && export LATEST_PATCH_OF_MINOR=$(jq -r .[-1].ref versions.json | cut -d "/" -f3) \ + && export PACKAGE_PLATFORM=$(if [ ${TARGETPLATFORM} = "linux/amd64" ]; then echo "x86_64"; elif [ ${TARGETPLATFORM} = "linux/arm64" ]; then echo "aarch64"; else echo "Unknown platform" && exit 1; fi;) \ + && wget --quiet https://github.com/open-space-collective/open-space-toolkit-core/releases/download/${LATEST_PATCH_OF_MINOR}/open-space-toolkit-core-${LATEST_PATCH_OF_MINOR}-1.${PACKAGE_PLATFORM}-runtime.deb \ + && wget --quiet https://github.com/open-space-collective/open-space-toolkit-core/releases/download/${LATEST_PATCH_OF_MINOR}/open-space-toolkit-core-${LATEST_PATCH_OF_MINOR}-1.${PACKAGE_PLATFORM}-devel.deb \ + && apt-get install -y ./*.deb \ + && rm -rf /tmp/open-space-toolkit-core ## Open Space Toolkit ▸ I/O ARG TARGETPLATFORM -ARG OSTK_IO_MAJOR="3" +ARG OSTK_IO_MAJOR="4" ## Force an image rebuild when new IO minor or patch versions are detected ADD https://api.github.com/repos/open-space-collective/open-space-toolkit-io/git/matching-refs/tags/${OSTK_IO_MAJOR} /tmp/open-space-toolkit-io/versions.json RUN mkdir -p /tmp/open-space-toolkit-io \ - && cd /tmp/open-space-toolkit-io \ - && export LATEST_PATCH_OF_MINOR=$(jq -r .[-1].ref versions.json | cut -d "/" -f3) \ - && export PACKAGE_PLATFORM=$(if [ ${TARGETPLATFORM} = "linux/amd64" ]; then echo "x86_64"; elif [ ${TARGETPLATFORM} = "linux/arm64" ]; then echo "aarch64"; else echo "Unknown platform" && exit 1; fi;) \ - && wget --quiet https://github.com/open-space-collective/open-space-toolkit-io/releases/download/${LATEST_PATCH_OF_MINOR}/open-space-toolkit-io-${LATEST_PATCH_OF_MINOR}-1.${PACKAGE_PLATFORM}-runtime.deb \ - && wget --quiet https://github.com/open-space-collective/open-space-toolkit-io/releases/download/${LATEST_PATCH_OF_MINOR}/open-space-toolkit-io-${LATEST_PATCH_OF_MINOR}-1.${PACKAGE_PLATFORM}-devel.deb \ - && apt-get install -y ./*.deb \ - && rm -rf /tmp/open-space-toolkit-io + && cd /tmp/open-space-toolkit-io \ + && export LATEST_PATCH_OF_MINOR=$(jq -r .[-1].ref versions.json | cut -d "/" -f3) \ + && export PACKAGE_PLATFORM=$(if [ ${TARGETPLATFORM} = "linux/amd64" ]; then echo "x86_64"; elif [ ${TARGETPLATFORM} = "linux/arm64" ]; then echo "aarch64"; else echo "Unknown platform" && exit 1; fi;) \ + && wget --quiet https://github.com/open-space-collective/open-space-toolkit-io/releases/download/${LATEST_PATCH_OF_MINOR}/open-space-toolkit-io-${LATEST_PATCH_OF_MINOR}-1.${PACKAGE_PLATFORM}-runtime.deb \ + && wget --quiet https://github.com/open-space-collective/open-space-toolkit-io/releases/download/${LATEST_PATCH_OF_MINOR}/open-space-toolkit-io-${LATEST_PATCH_OF_MINOR}-1.${PACKAGE_PLATFORM}-devel.deb \ + && apt-get install -y ./*.deb \ + && rm -rf /tmp/open-space-toolkit-io ## Open Space Toolkit ▸ Mathematics ARG TARGETPLATFORM -ARG OSTK_MATHEMATICS_MAJOR="3" +ARG OSTK_MATHEMATICS_MAJOR="4" ## Force an image rebuild when new Math minor or patch versions are detected ADD https://api.github.com/repos/open-space-collective/open-space-toolkit-mathematics/git/matching-refs/tags/${OSTK_MATHEMATICS_MAJOR} /tmp/open-space-toolkit-mathematics/versions.json RUN mkdir -p /tmp/open-space-toolkit-mathematics \ - && cd /tmp/open-space-toolkit-mathematics \ - && export LATEST_PATCH_OF_MINOR=$(jq -r .[-1].ref versions.json | cut -d "/" -f3) \ - && export PACKAGE_PLATFORM=$(if [ ${TARGETPLATFORM} = "linux/amd64" ]; then echo "x86_64"; elif [ ${TARGETPLATFORM} = "linux/arm64" ]; then echo "aarch64"; else echo "Unknown platform" && exit 1; fi;) \ - && wget --quiet https://github.com/open-space-collective/open-space-toolkit-mathematics/releases/download/${LATEST_PATCH_OF_MINOR}/open-space-toolkit-mathematics-${LATEST_PATCH_OF_MINOR}-1.${PACKAGE_PLATFORM}-runtime.deb \ - && wget --quiet https://github.com/open-space-collective/open-space-toolkit-mathematics/releases/download/${LATEST_PATCH_OF_MINOR}/open-space-toolkit-mathematics-${LATEST_PATCH_OF_MINOR}-1.${PACKAGE_PLATFORM}-devel.deb \ - && apt-get install -y ./*.deb \ - && rm -rf /tmp/open-space-toolkit-mathematics + && cd /tmp/open-space-toolkit-mathematics \ + && export LATEST_PATCH_OF_MINOR=$(jq -r .[-1].ref versions.json | cut -d "/" -f3) \ + && export PACKAGE_PLATFORM=$(if [ ${TARGETPLATFORM} = "linux/amd64" ]; then echo "x86_64"; elif [ ${TARGETPLATFORM} = "linux/arm64" ]; then echo "aarch64"; else echo "Unknown platform" && exit 1; fi;) \ + && wget --quiet https://github.com/open-space-collective/open-space-toolkit-mathematics/releases/download/${LATEST_PATCH_OF_MINOR}/open-space-toolkit-mathematics-${LATEST_PATCH_OF_MINOR}-1.${PACKAGE_PLATFORM}-runtime.deb \ + && wget --quiet https://github.com/open-space-collective/open-space-toolkit-mathematics/releases/download/${LATEST_PATCH_OF_MINOR}/open-space-toolkit-mathematics-${LATEST_PATCH_OF_MINOR}-1.${PACKAGE_PLATFORM}-devel.deb \ + && apt-get install -y ./*.deb \ + && rm -rf /tmp/open-space-toolkit-mathematics ## Open Space Toolkit ▸ Physics ARG TARGETPLATFORM -ARG OSTK_PHYSICS_MAJOR="7" +ARG OSTK_PHYSICS_MAJOR="8" ## Force an image rebuild when new Physics minor or patch versions are detected ADD https://api.github.com/repos/open-space-collective/open-space-toolkit-physics/git/matching-refs/tags/${OSTK_PHYSICS_MAJOR} /tmp/open-space-toolkit-physics/versions.json RUN mkdir -p /tmp/open-space-toolkit-physics \ - && cd /tmp/open-space-toolkit-physics \ - && export LATEST_PATCH_OF_MINOR=$(jq -r .[-1].ref versions.json | cut -d "/" -f3) \ - && export PACKAGE_PLATFORM=$(if [ ${TARGETPLATFORM} = "linux/amd64" ]; then echo "x86_64"; elif [ ${TARGETPLATFORM} = "linux/arm64" ]; then echo "aarch64"; else echo "Unknown platform" && exit 1; fi;) \ - && wget --quiet https://github.com/open-space-collective/open-space-toolkit-physics/releases/download/${LATEST_PATCH_OF_MINOR}/open-space-toolkit-physics-${LATEST_PATCH_OF_MINOR}-1.${PACKAGE_PLATFORM}-runtime.deb \ - && wget --quiet https://github.com/open-space-collective/open-space-toolkit-physics/releases/download/${LATEST_PATCH_OF_MINOR}/open-space-toolkit-physics-${LATEST_PATCH_OF_MINOR}-1.${PACKAGE_PLATFORM}-devel.deb \ - && apt-get install -y ./*.deb \ - && rm -rf /tmp/open-space-toolkit-physics + && cd /tmp/open-space-toolkit-physics \ + && export LATEST_PATCH_OF_MINOR=$(jq -r .[-1].ref versions.json | cut -d "/" -f3) \ + && export PACKAGE_PLATFORM=$(if [ ${TARGETPLATFORM} = "linux/amd64" ]; then echo "x86_64"; elif [ ${TARGETPLATFORM} = "linux/arm64" ]; then echo "aarch64"; else echo "Unknown platform" && exit 1; fi;) \ + && wget --quiet https://github.com/open-space-collective/open-space-toolkit-physics/releases/download/${LATEST_PATCH_OF_MINOR}/open-space-toolkit-physics-${LATEST_PATCH_OF_MINOR}-1.${PACKAGE_PLATFORM}-runtime.deb \ + && wget --quiet https://github.com/open-space-collective/open-space-toolkit-physics/releases/download/${LATEST_PATCH_OF_MINOR}/open-space-toolkit-physics-${LATEST_PATCH_OF_MINOR}-1.${PACKAGE_PLATFORM}-devel.deb \ + && apt-get install -y ./*.deb \ + && rm -rf /tmp/open-space-toolkit-physics # Install OSTk data @@ -187,8 +174,8 @@ FROM root-user as non-root-user # Install dev utilities RUN apt-get update \ - && apt-get install -y zsh sudo \ - && rm -rf /var/lib/apt/lists/* + && apt-get install -y zsh sudo \ + && rm -rf /var/lib/apt/lists/* # Create non-root user and group @@ -196,8 +183,8 @@ ARG USERNAME="developer" ARG USER_UID="1000" ARG USER_GID=${USER_UID} RUN groupadd --gid ${USER_GID} ${USERNAME} || true \ - && adduser --uid ${USER_UID} --gid ${USER_GID} ${USERNAME} \ - && echo "${USERNAME} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/${USERNAME} + && adduser --uid ${USER_UID} --gid ${USER_GID} ${USERNAME} \ + && echo "${USERNAME} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/${USERNAME} # Change ownership of OSTK_DATA_LOCAL_CACHE @@ -210,10 +197,10 @@ USER ${USERNAME} # Install shell utilities RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" \ - && git clone https://github.com/bhilburn/powerlevel9k.git /home/${USERNAME}/.oh-my-zsh/custom/themes/powerlevel9k \ - && git clone https://github.com/zsh-users/zsh-autosuggestions /home/${USERNAME}/.oh-my-zsh/custom/plugins/zsh-autosuggestions \ - && git clone https://github.com/zsh-users/zsh-syntax-highlighting.git /home/${USERNAME}/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting \ - && mkdir -p /home/${USERNAME}/.vscode-server/extensions /home/${USERNAME}/.vscode-server-insiders/extensions + && git clone https://github.com/bhilburn/powerlevel9k.git /home/${USERNAME}/.oh-my-zsh/custom/themes/powerlevel9k \ + && git clone https://github.com/zsh-users/zsh-autosuggestions /home/${USERNAME}/.oh-my-zsh/custom/plugins/zsh-autosuggestions \ + && git clone https://github.com/zsh-users/zsh-syntax-highlighting.git /home/${USERNAME}/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting \ + && mkdir -p /home/${USERNAME}/.vscode-server/extensions /home/${USERNAME}/.vscode-server-insiders/extensions ## Configure environment diff --git a/include/OpenSpaceToolkit/Astrodynamics/Trajectory/LocalOrbitalFrameTransformProvider.hpp b/include/OpenSpaceToolkit/Astrodynamics/Trajectory/LocalOrbitalFrameTransformProvider.hpp index 01f889468..7d2bebe6b 100644 --- a/include/OpenSpaceToolkit/Astrodynamics/Trajectory/LocalOrbitalFrameTransformProvider.hpp +++ b/include/OpenSpaceToolkit/Astrodynamics/Trajectory/LocalOrbitalFrameTransformProvider.hpp @@ -32,7 +32,7 @@ using ostk::physics::time::Instant; /// @brief Local orbital frame transform provider, frame provider /// -/// @note Generates a specific transform based on instant, position, velocity and a LOF type. +/// @note Generates a specific transform based on instant, position, velocity and a LOF type. class LocalOrbitalFrameTransformProvider : public Provider { public: @@ -46,9 +46,10 @@ class LocalOrbitalFrameTransformProvider : public Provider ///< aligned with opposite of orbital momentum) LVLHGD, ///< Local Vertical, Local Horizontal GeoDetic (LVLHGD) frame QSW, ///< QSW frame (X axis aligned with position, Z axis aligned with orbital momentum) - TNW, ///< TNW frame (X axis aligned with velocity, Z axis aligned with orbital momentum) - VNC ///< Velocity - Normal - Co-normal (VNC) frame (X axis aligned with velocity, Y axis aligned with orbital - ///< momentum) + TNW, ///< Tangent-Normal-Wideband (TNW) frame (X axis aligned with velocity, Z axis aligned with orbital + ///< momentum) + VNC ///< Velocity-Normal-Co-normal (VNC) frame (X axis aligned with velocity, Y axis aligned with orbital + ///< momentum) }; /// @brief Destructor diff --git a/include/OpenSpaceToolkit/Astrodynamics/Trajectory/Orbit.hpp b/include/OpenSpaceToolkit/Astrodynamics/Trajectory/Orbit.hpp index b87b91a30..0f616d937 100644 --- a/include/OpenSpaceToolkit/Astrodynamics/Trajectory/Orbit.hpp +++ b/include/OpenSpaceToolkit/Astrodynamics/Trajectory/Orbit.hpp @@ -66,16 +66,16 @@ class Orbit : public Trajectory Undefined, // Undefined frame NED, // North-East-Down (NED) frame - LVLH, // Local Vertical, Local Horizontal (LVLH) frame (X axis aligned with position, Z axis aligned with + LVLH, // Local Vertical-Local Horizontal (LVLH) frame (X axis aligned with position, Z axis aligned with // orbital momentum) - VVLH, // Vehicle Velocity, Local Horizontal (VVLH) frame (Z axis aligned with opposite of position, Y axis + VVLH, // Vehicle Velocity-Local Horizontal (VVLH) frame (Z axis aligned with opposite of position, Y axis // aligned with opposite of orbital momentum) - LVLHGD, // Local Vertical, Local Horizontal GeoDetic (LVLHGD) frame - LVLHGDGT, // Local Vertical, Local Horizontal GeoDetic GroundTrack (LVLHGDGT) frame + LVLHGD, // Local Vertical-Local Horizontal-GeoDetic (LVLHGD) frame + LVLHGDGT, // Local Vertical-Local Horizontal-GeoDetic-GroundTrack (LVLHGDGT) frame QSW, // QSW frame (X axis aligned with position, Z axis aligned with orbital momentum) - TNW, // TNW frame (X axis aligned with velocity, Z axis aligned with orbital momentum) - VNC // Velocity - Normal - Co-normal (VNC) frame (X axis aligned with velocity, Y axis aligned with orbital - // momentum) + TNW, // Tangent-Normal-Wideband frame (X axis aligned with velocity, Z axis aligned with orbital momentum) + VNC // Velocity-Normal-Conormal (VNC) frame (X axis aligned with velocity, Y axis aligned with orbital + // momentum) }; typedef Array::ConstIterator ConstPassIterator; diff --git a/include/OpenSpaceToolkit/Astrodynamics/Trajectory/Segment.hpp b/include/OpenSpaceToolkit/Astrodynamics/Trajectory/Segment.hpp index ef5ff0031..0aac87b34 100644 --- a/include/OpenSpaceToolkit/Astrodynamics/Trajectory/Segment.hpp +++ b/include/OpenSpaceToolkit/Astrodynamics/Trajectory/Segment.hpp @@ -44,7 +44,7 @@ using ostk::physics::unit::Mass; using ostk::astrodynamics::Dynamics; using ostk::astrodynamics::dynamics::Thruster; using ostk::astrodynamics::EventCondition; -using ostk::astrodynamics::flight::Maneuver; +using flightManeuver = ostk::astrodynamics::flight::Maneuver; using ostk::astrodynamics::trajectory::State; using ostk::astrodynamics::trajectory::state::NumericalSolver; @@ -112,7 +112,7 @@ class Segment /// /// @param aFrameSPtr Frame /// @return Array of maneuvers - Array extractManeuvers(const Shared& aFrameSPtr) const; + Array extractManeuvers(const Shared& aFrameSPtr) const; /// @brief Calculate intermediate states at specified Instants using the provided Numerical Solver /// diff --git a/src/OpenSpaceToolkit/Astrodynamics/Solvers/FiniteDifferenceSolver.cpp b/src/OpenSpaceToolkit/Astrodynamics/Solvers/FiniteDifferenceSolver.cpp index 4a85c152c..66ab3ec7d 100644 --- a/src/OpenSpaceToolkit/Astrodynamics/Solvers/FiniteDifferenceSolver.cpp +++ b/src/OpenSpaceToolkit/Astrodynamics/Solvers/FiniteDifferenceSolver.cpp @@ -162,7 +162,7 @@ MatrixXd FiniteDifferenceSolver::computeJacobian( { const VectorXd coordinates = generateStateCoordinates(anInputState, anInstantArray[0]); - const MatrixXd coordinatesMatrix = {coordinates}; + const MatrixXd coordinatesMatrix = MatrixXd(coordinates); return coordinatesMatrix; }; diff --git a/src/OpenSpaceToolkit/Astrodynamics/Trajectory/Orbit.cpp b/src/OpenSpaceToolkit/Astrodynamics/Trajectory/Orbit.cpp index 5d1c8c3fe..9168265bb 100644 --- a/src/OpenSpaceToolkit/Astrodynamics/Trajectory/Orbit.cpp +++ b/src/OpenSpaceToolkit/Astrodynamics/Trajectory/Orbit.cpp @@ -1119,7 +1119,10 @@ String Orbit::StringFromFrameType(const Orbit::FrameType& aFrameType) String Orbit::generateFrameName(const Orbit::FrameType& aFrameType) const { - return String::Format("{} @ Orbit [{}]", Orbit::StringFromFrameType(aFrameType), fmt::ptr(this)); + std::stringstream stringStream; + stringStream << this; + + return String::Format("{} @ Orbit [{}]", Orbit::StringFromFrameType(aFrameType), stringStream.str()); } Array> Orbit::ComputePasses(const Array& aStateArray, const Integer& anInitialRevolutionNumber) diff --git a/src/OpenSpaceToolkit/Astrodynamics/Trajectory/Segment.cpp b/src/OpenSpaceToolkit/Astrodynamics/Trajectory/Segment.cpp index 7a1678867..1d935bbc3 100644 --- a/src/OpenSpaceToolkit/Astrodynamics/Trajectory/Segment.cpp +++ b/src/OpenSpaceToolkit/Astrodynamics/Trajectory/Segment.cpp @@ -110,7 +110,7 @@ Mass Segment::Solution::computeDeltaMass() const return Mass::Kilograms(getInitialMass().inKilograms() - getFinalMass().inKilograms()); } -Array Segment::Solution::extractManeuvers(const Shared& aFrameSPtr) const +Array Segment::Solution::extractManeuvers(const Shared& aFrameSPtr) const { if (this->states.isEmpty()) { @@ -191,8 +191,7 @@ Array Segment::Solution::extractManeuvers(const Shared& a return {}; } - Array extractedManeuvers = - Array::Empty(); + Array extractedManeuvers = Array::Empty(); for (const Pair& startStopPair : maneuverBlockStartStopIndices) { const Size blockLength = startStopPair.second - startStopPair.first; @@ -201,7 +200,7 @@ Array Segment::Solution::extractManeuvers(const Shared& a const MatrixXd maneuverContributionBlock = fullSegmentContributions.block(startStopPair.first, 0, blockLength, fullSegmentContributions.cols()); - extractedManeuvers.add(ostk::astrodynamics::flight::Maneuver::TabulatedDynamics(TabulatedDynamics( + extractedManeuvers.add(flightManeuver::TabulatedDynamics(TabulatedDynamics( maneuverInstantsBlock, maneuverContributionBlock, {CartesianVelocity::Default(), CoordinateSubset::Mass()}, diff --git a/test/OpenSpaceToolkit/Astrodynamics/Dynamics/PositionDerivative.test.cpp b/test/OpenSpaceToolkit/Astrodynamics/Dynamics/PositionDerivative.test.cpp index d6327fbe5..a604e62ac 100644 --- a/test/OpenSpaceToolkit/Astrodynamics/Dynamics/PositionDerivative.test.cpp +++ b/test/OpenSpaceToolkit/Astrodynamics/Dynamics/PositionDerivative.test.cpp @@ -47,7 +47,7 @@ class OpenSpaceToolkit_Astrodynamics_Dynamics_PositionDerivative : public ::test TEST_F(OpenSpaceToolkit_Astrodynamics_Dynamics_PositionDerivative, Constructor) { { - EXPECT_NO_THROW(PositionDerivative positionDerivative()); + EXPECT_NO_THROW(PositionDerivative positionDerivative); } } diff --git a/test/OpenSpaceToolkit/Astrodynamics/GuidanceLaw/ConstantThrust.test.cpp b/test/OpenSpaceToolkit/Astrodynamics/GuidanceLaw/ConstantThrust.test.cpp index c78fa8900..d8f2b0861 100644 --- a/test/OpenSpaceToolkit/Astrodynamics/GuidanceLaw/ConstantThrust.test.cpp +++ b/test/OpenSpaceToolkit/Astrodynamics/GuidanceLaw/ConstantThrust.test.cpp @@ -178,7 +178,7 @@ TEST_F(OpenSpaceToolkit_Astrodynamics_GuidanceLaw_ConstantThrust, calculateThrus }; // Loop through test cases - for (const auto testCase : testCases) + for (const auto& testCase : testCases) { // Extract test case input data const Shared localOrbitalFrameFactory = std::get<0>(testCase); diff --git a/test/OpenSpaceToolkit/Astrodynamics/Trajectory/Sequence.test.cpp b/test/OpenSpaceToolkit/Astrodynamics/Trajectory/Sequence.test.cpp index 9be25d973..d963e7620 100644 --- a/test/OpenSpaceToolkit/Astrodynamics/Trajectory/Sequence.test.cpp +++ b/test/OpenSpaceToolkit/Astrodynamics/Trajectory/Sequence.test.cpp @@ -301,7 +301,7 @@ TEST_F(OpenSpaceToolkit_Astrodynamics_Trajectory_Sequence, SequenceSolution_Stre TEST_F(OpenSpaceToolkit_Astrodynamics_Trajectory_Sequence, Constructor) { { - EXPECT_NO_THROW(Sequence sequence()); + EXPECT_NO_THROW(Sequence sequence); } {