diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml deleted file mode 100644 index 12d5935fd..000000000 --- a/.github/workflows/coverage.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: Coverage Analysis - -on: - push: - branches: [ master ] - pull_request: - - workflow_dispatch: - -jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-20.04] - fail-fast: false - env: - BUILD_TYPE: Coverage - - - steps: - - uses: actions/checkout@v2 - - - name: ccache - uses: hendrikmuhs/ccache-action@v1 - - - name: Install dependencies (Linux) - run: | - ./scripts/install_linux_deps.sh - ./scripts/install_linux_fmt_deps.sh - - - name: Install Coverage - run: | - DEBIAN_FRONTEND=noninteractive sudo apt-get install -y \ - lcov - - - name: Run tests for coverage - run: | - mkdir build - cd build - cmake -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. - make - make CTEST_OUTPUT_ON_FAILURE=1 test - - - name: Run lcov - run: | - set -x - cd build - lcov --directory . --capture --output-file coverage.info - lcov --remove coverage.info 'test/*' '/usr/*' --output-file coverage.info - lcov --list coverage.info - ls - pwd - - - name: Coveralls - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - path-to-lcov: /home/runner/work/Sophus/Sophus/build/coverage.info diff --git a/.github/workflows/gh_pages.yml b/.github/workflows/gh_pages.yml deleted file mode 100644 index 429067c1c..000000000 --- a/.github/workflows/gh_pages.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Build Docs - -on: - push: - branches: [ master ] - - workflow_dispatch: - -jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-20.04] - fail-fast: false - - - steps: - - uses: actions/checkout@v2 - - - name: build docs - run: | - scripts/install_docs_deps.sh - ./make_docs.sh - cd html-dir - touch .nojekyll - cd ../.. - - - name: Deploy - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: html-dir - publish_branch: gh_pages diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2e4988f1b..0bb33dc49 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,7 +12,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-20.04] + os: [ubuntu-22.04, Ubuntu 24.04, macos-10.15] build_type: [Debug, Release] row_major: [ON, OFF] basic_logging: [ON, OFF] @@ -26,7 +26,6 @@ jobs: basic_logging: ON fail-fast: false env: - BUILD_TYPE: ${{ matrix.build_type }} ROW_MAJOR_DEFAULT: ${{ matrix.row_major }} USE_BASIC_LOGGING: ${{ matrix.basic_logging }} @@ -34,25 +33,12 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Format - uses: DoozyX/clang-format-lint-action@v0.12 - with: - source: '.' - extensions: 'hpp,cpp' - exclude: './sympy ./doxyrest_b' - clangFormatVersion: 9 - if: matrix.os == 'ubuntu-20.04' - - name: ccache uses: hendrikmuhs/ccache-action@v1 - name: Install dependencies (Linux) run: ./scripts/install_linux_deps.sh - if: matrix.os == 'ubuntu-20.04' - - - name: Install fmt dependency (Linux) - run: ./scripts/install_linux_fmt_deps.sh - if: matrix.os == 'ubuntu-20.04' && matrix.basic_logging == 'OFF' + if: matrix.os == 'ubuntu-22.04' || matrix.os == 'Ubuntu 24.04' - name: Install dependencies (Mac OS) run: ./scripts/install_osx_deps.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index eed097231..2335735e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,7 +89,6 @@ set(SOPHUS_HEADER_FILES sophus/so3.hpp sophus/spline.hpp sophus/types.hpp - sophus/velocities.hpp ) set(SOPHUS_OTHER_FILES diff --git a/README.rst b/README.rst index e7aab639b..2a478bd6e 100644 --- a/README.rst +++ b/README.rst @@ -31,14 +31,21 @@ modern configurations as long they support c++14, CMake, Eigen 3.3.X and .. _GitHubCI: https://github.com/strasdat/Sophus/actions -.. |AppVeyor| image:: https://ci.appveyor.com/api/projects/status/um4285lwhs8ci7pt/branch/master?svg=true -.. _AppVeyor: https://ci.appveyor.com/project/strasdat/sophus/branch/master - -.. |ci_cov| image:: https://coveralls.io/repos/github/strasdat/Sophus/badge.svg?branch=master -.. _ci_cov: https://coveralls.io/github/strasdat/Sophus?branch=master - .. |GithubCICpp| image:: https://github.com/strasdat/Sophus/actions/workflows/main.yml/badge.svg?branch=master .. _GithubCICpp: https://github.com/strasdat/Sophus/actions/workflows/main.yml?query=branch%3Amaster .. |GithubCISympy| image:: https://github.com/strasdat/Sophus/actions/workflows/sympy.yml/badge.svg?branch=master .. _GithubCISympy: https://github.com/strasdat/Sophus/actions/workflows/sympy.yml?query=branch%3Amaster + + +Install Ubuntu 22.04 +-------------------- + +sudo apt install libeigen3-dev +sudo apt install libfmt-dev +sudo apt install libceres-dev + +mkdir build +cd build +cmake .. +make -j4 \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 6fe6813fb..000000000 --- a/appveyor.yml +++ /dev/null @@ -1,35 +0,0 @@ -branches: - only: - - master - -os: Visual Studio 2015 - -clone_folder: c:\projects\sophus - -platform: x64 -configuration: Debug - -build: - project: c:\projects\sophus\build\Sophus.sln - -install: - - ps: wget https://gitlab.com/libeigen/eigen/-/archive/3.3.4/eigen-3.3.4.zip -outfile eigen3.zip - - cmd: 7z x eigen3.zip -o"C:\projects" -y > nul - - git clone https://github.com/fmtlib/fmt.git - - cd fmt - - git checkout 5.3.0 - - mkdir build - - cd build - - cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_BUILD_TYPE=Debug .. - - cmake --build . - - cmake --build . --target install - - cd ../.. - -before_build: - - cd c:\projects\sophus - - mkdir build - - cd build - - cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_BUILD_TYPE=Debug -D EIGEN3_INCLUDE_DIR=C:\projects\eigen-3.3.4 .. - -after_build: - - ctest --output-on-failure diff --git a/doxyfile b/doxyfile deleted file mode 100644 index 995ed8991..000000000 --- a/doxyfile +++ /dev/null @@ -1,24 +0,0 @@ -DOXYFILE_ENCODING = UTF-8 -PROJECT_NAME = "Sophus" -INPUT = sophus -EXTRACT_ALL = YES -ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = YES -WARN_AS_ERROR = YES -EXPAND_ONLY_PREDEF = NO -SKIP_FUNCTION_MACROS = NO -AUTOLINK_SUPPORT = YES -MULTILINE_CPP_IS_BRIEF = YES -MARKDOWN_SUPPORT = YES -INLINE_INHERITED_MEMB = NO -EXCLUDE_SYMBOLS = Eigen::internal Sophus::details Sophus::interp_details Sophus::experimental -GENERATE_LATEX = NO -STRIP_CODE_COMMENTS = NO - -GENERATE_XML = YES -GENERATE_HTML = NO -XML_OUTPUT = xml-dir -XML_PROGRAMLISTING = NO -CASE_SENSE_NAMES = NO -HIDE_UNDOC_RELATIONS = YES -EXTRACT_ALL = YES \ No newline at end of file diff --git a/doxyrest-config.lua b/doxyrest-config.lua deleted file mode 100644 index c4e8bc864..000000000 --- a/doxyrest-config.lua +++ /dev/null @@ -1,20 +0,0 @@ -FRAME_DIR_LIST = { "doxyrest_b/doxyrest/frame/cfamily", "doxyrest_b/doxyrest/frame/common" } -FRAME_FILE = "index.rst.in" -INPUT_FILE = "xml-dir/index.xml" -OUTPUT_FILE = "rst-dir/index.rst" -INTRO_FILE = "page_index.rst" -SORT_GROUPS_BY = "title" -GLOBAL_AUX_COMPOUND_ID = "group_global" -LANGUAGE = cpp -VERBATIM_TO_CODE_BLOCK = "cpp" -ESCAPE_ASTERISKS = true -ESCAPE_PIPES = true -ESCAPE_TRAILING_UNDERSCORES = true -PROTECTION_FILTER = "protected" -EXCLUDE_EMPTY_DEFINES = true -EXCLUDE_DEFAULT_CONSTRUCTORS = false -EXCLUDE_DESTRUCTORS = false -EXCLUDE_PRIMITIVE_TYPEDEFS = true -SHOW_DIRECT_DESCENDANTS = true -TYPEDEF_TO_USING = true -ML_PARAM_LIST_LENGTH_THRESHOLD = 80 \ No newline at end of file diff --git a/make_docs.sh b/make_docs.sh deleted file mode 100755 index 6393cef3d..000000000 --- a/make_docs.sh +++ /dev/null @@ -1,3 +0,0 @@ -doxygen doxyfile -doxyrest_b/build/doxyrest/bin/Release/doxyrest -c doxyrest-config.lua -sphinx-build -b html rst-dir html-dir \ No newline at end of file diff --git a/rst-dir/conf.py b/rst-dir/conf.py deleted file mode 100644 index 76ed90a84..000000000 --- a/rst-dir/conf.py +++ /dev/null @@ -1,54 +0,0 @@ -# Configuration file for the Sphinx documentation builder. -# -# This file only contains a selection of the most common options. For a full -# list see the documentation: -# http://www.sphinx-doc.org/en/master/config - -# -- Path setup -------------------------------------------------------------- - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -# -import os -import sys -sys.path.insert(0, os.path.abspath('../sympy')) - - -sys.path.insert(1, os.path.abspath('../doxyrest_b/doxyrest/sphinx')) -extensions = ['doxyrest', 'cpplexer', 'sphinx.ext.autodoc'] - -# -- Project information ----------------------------------------------------- - -project = 'Sophus' -copyright = '2019, Hauke Strasdat' -author = 'Hauke Strasdat' - - -# Tell sphinx what the primary language being documented is. -primary_domain = 'cpp' - -# Tell sphinx what the pygments highlight language should be. -highlight_language = 'cpp' - - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -# This pattern also affects html_static_path and html_extra_path. -exclude_patterns = [] - - -# -- Options for HTML output ------------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -# -html_theme = "sphinx_rtd_theme" - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] diff --git a/rst-dir/page_index.rst b/rst-dir/page_index.rst deleted file mode 100644 index 9955aca10..000000000 --- a/rst-dir/page_index.rst +++ /dev/null @@ -1,9 +0,0 @@ -Sophus - Lie groups for 2d/3d Geometry -======================================= - -.. toctree:: - :maxdepth: 2 - :caption: Contents: - - GitHub Page - pysophus \ No newline at end of file diff --git a/rst-dir/pysophus.rst b/rst-dir/pysophus.rst deleted file mode 100644 index 3e532a0ac..000000000 --- a/rst-dir/pysophus.rst +++ /dev/null @@ -1,23 +0,0 @@ -Python API -========== - -.. automodule:: sophus.matrix - :members: - -.. automodule:: sophus.complex - :members: - -.. automodule:: sophus.quaternion - :members: - -.. automodule:: sophus.so2 - :members: - -.. automodule:: sophus.so3 - :members: - -.. automodule:: sophus.se2 - :members: - -.. automodule:: sophus.se3 - :members: \ No newline at end of file diff --git a/run_format.sh b/run_format.sh deleted file mode 100755 index ef6b7403d..000000000 --- a/run_format.sh +++ /dev/null @@ -1 +0,0 @@ -find . -type d \( -path ./sympy -o -path ./doxyrest_b -o -path "./*/CMakeFiles/*" \) -prune -o \( -iname "*.hpp" -o -iname "*.cpp" \) -print | xargs clang-format -i diff --git a/scripts/install_docs_deps.sh b/scripts/install_docs_deps.sh deleted file mode 100755 index c947a41e8..000000000 --- a/scripts/install_docs_deps.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -set -x # echo on -set -e # exit on error - -sudo apt-get -qq update -sudo apt-get install doxygen liblua5.3-dev ragel -pip3 install 'sphinx==2.0.1' -pip3 install sphinx_rtd_theme -pip3 install sympy - -git clone https://github.com/vovkos/doxyrest_b -cd doxyrest_b -git reset --hard ad45c064d1199e71b8cae5aa66d4251c4228b958 -git submodule update --init -mkdir build -cd build -cmake .. -cmake --build . - -cd ../.. diff --git a/scripts/install_linux_deps.sh b/scripts/install_linux_deps.sh index 39c188de4..89f946b9d 100755 --- a/scripts/install_linux_deps.sh +++ b/scripts/install_linux_deps.sh @@ -6,14 +6,7 @@ set -e # exit on error cmake --version sudo apt-get -qq update -sudo apt-get install gfortran libc++-dev libgoogle-glog-dev libatlas-base-dev libsuitesparse-dev libceres-dev ccache -wget https://gitlab.com/libeigen/eigen/-/archive/3.3.4/eigen-3.3.4.tar.bz2 -tar xvf eigen-3.3.4.tar.bz2 -mkdir build-eigen -cd build-eigen -cmake ../eigen-3.3.4 -DEIGEN_DEFAULT_TO_ROW_MAJOR=$ROW_MAJOR_DEFAULT -sudo make install -cd .. +sudo apt-get install fortran libc++-dev libgoogle-glog-dev libatlas-base-dev libsuitesparse-dev libeigen3-dev libfmt-dev git clone https://ceres-solver.googlesource.com/ceres-solver ceres-solver cd ceres-solver @@ -24,4 +17,4 @@ ccache -s cmake -DCMAKE_CXX_COMPILER_LAUNCHER=ccache .. make -j8 sudo make install -cd ../.. +cd ../.. \ No newline at end of file diff --git a/scripts/install_linux_fmt_deps.sh b/scripts/install_linux_fmt_deps.sh deleted file mode 100755 index acbfda2ca..000000000 --- a/scripts/install_linux_fmt_deps.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -set -x # echo on -set -e # exit on error - -git clone https://github.com/fmtlib/fmt.git -cd fmt -git checkout 5.3.0 -mkdir build -cd build -cmake -DCMAKE_CXX_COMPILER_LAUNCHER=ccache .. -make -j8 -sudo make install -cd ../.. diff --git a/sophus/velocities.hpp b/sophus/velocities.hpp deleted file mode 100644 index 4c0d373de..000000000 --- a/sophus/velocities.hpp +++ /dev/null @@ -1,71 +0,0 @@ -#pragma once - -#include - -#include "num_diff.hpp" -#include "se3.hpp" - -namespace Sophus { -namespace experimental { -// Experimental since the API will certainly change drastically in the future. - -// Transforms velocity vector by rotation ``foo_R_bar``. -// -// Note: vel_bar can be either a linear or a rotational velocity vector. -// -template -Vector3 transformVelocity(SO3 const& foo_R_bar, - Vector3 const& vel_bar) { - // For rotational velocities note that: - // - // vel_bar = vee(foo_R_bar * hat(vel_bar) * foo_R_bar^T) - // = vee(hat(Adj(foo_R_bar) * vel_bar)) - // = Adj(foo_R_bar) * vel_bar - // = foo_R_bar * vel_bar. - // - return foo_R_bar * vel_bar; -} - -// Transforms velocity vector by pose ``foo_T_bar``. -// -// Note: vel_bar can be either a linear or a rotational velocity vector. -// -template -Vector3 transformVelocity(SE3 const& foo_T_bar, - Vector3 const& vel_bar) { - return transformVelocity(foo_T_bar.so3(), vel_bar); -} - -// finite difference approximation of instantaneous velocity in frame foo -// -template -Vector3 finiteDifferenceRotationalVelocity( - std::function(Scalar)> const& foo_R_bar, Scalar t, - Scalar h = Constants::epsilon()) { - // https://en.wikipedia.org/w/index.php?title=Angular_velocity&oldid=791867792#Angular_velocity_tensor - // - // W = dR(t)/dt * R^{-1}(t) - Matrix3 dR_dt_in_frame_foo = curveNumDiff( - [&foo_R_bar](Scalar t0) -> Matrix3 { - return foo_R_bar(t0).matrix(); - }, - t, h); - // velocity tensor - Matrix3 W_in_frame_foo = - dR_dt_in_frame_foo * (foo_R_bar(t)).inverse().matrix(); - return SO3::vee(W_in_frame_foo); -} - -// finite difference approximation of instantaneous velocity in frame foo -// -template -Vector3 finiteDifferenceRotationalVelocity( - std::function(Scalar)> const& foo_T_bar, Scalar t, - Scalar h = Constants::epsilon()) { - return finiteDifferenceRotationalVelocity( - [&foo_T_bar](Scalar t) -> SO3 { return foo_T_bar(t).so3(); }, t, - h); -} - -} // namespace experimental -} // namespace Sophus diff --git a/test/core/CMakeLists.txt b/test/core/CMakeLists.txt index f7381498b..b982736ec 100644 --- a/test/core/CMakeLists.txt +++ b/test/core/CMakeLists.txt @@ -10,9 +10,8 @@ SET( TEST_SOURCES test_common test_se3 test_rxso3 test_sim3 - test_velocities test_geometry) -find_package( Ceres 2.1.0 QUIET ) +find_package( Ceres 2 ) FOREACH(test_src ${TEST_SOURCES}) ADD_EXECUTABLE( ${test_src} ${test_src}.cpp tests.hpp ../../sophus/test_macros.hpp) diff --git a/test/core/test_velocities.cpp b/test/core/test_velocities.cpp deleted file mode 100644 index a46aabda3..000000000 --- a/test/core/test_velocities.cpp +++ /dev/null @@ -1,130 +0,0 @@ -#include - -#include "tests.hpp" - -#include - -namespace Sophus { -namespace experimental { - -template -bool tests_linear_velocities() { - bool passed = true; - std::vector, Eigen::aligned_allocator>> bar_Ts_baz; - - for (size_t i = 0; i < 10; ++i) { - bar_Ts_baz.push_back(SE3::rotX(i * 0.001) * - SE3::rotY(i * 0.001) * - SE3::transX(0.01 * i)); - } - - SE3 foo_T_bar = - SE3::rotX(0.5) * SE3::rotZ(0.2) * SE3::transY(2); - - std::vector, Eigen::aligned_allocator>> foo_Ts_baz; - for (auto const& bar_T_baz : bar_Ts_baz) { - foo_Ts_baz.push_back(foo_T_bar * bar_T_baz); - } - - auto gen_linear_vels = - [](std::vector, Eigen::aligned_allocator>> const& - a_Ts_b) { - std::vector, Eigen::aligned_allocator>> - linearVels_a; - for (size_t i = 0; i < a_Ts_b.size() - 1; ++i) { - linearVels_a.push_back(a_Ts_b[i + 1].translation() - - a_Ts_b[i].translation()); - } - return linearVels_a; - }; - - // linear velocities in frame bar - std::vector, Eigen::aligned_allocator>> - linearVels_bar = gen_linear_vels(bar_Ts_baz); - // linear velocities in frame foo - std::vector, Eigen::aligned_allocator>> - linearVels_foo = gen_linear_vels(foo_Ts_baz); - - for (size_t i = 0; i < linearVels_bar.size(); ++i) { - SOPHUS_TEST_APPROX(passed, linearVels_foo[i], - transformVelocity(foo_T_bar, linearVels_bar[i]), - sqrt(Constants::epsilon()), ""); - } - return passed; -} - -template -bool tests_rotational_velocities() { - bool passed = true; - - SE3 foo_T_bar = - SE3::rotX(0.5) * SE3::rotZ(0.2) * SE3::transY(2); - - // One parameter subgroup of SE3, motion through space given time t. - auto bar_T_baz = [](Scalar t) -> SE3 { - return SE3::rotX(t * Scalar(0.01)) * - SE3::rotY(t * Scalar(0.0001)) * - SE3::transX(t * Scalar(0.0001)); - }; - - std::vector ts = {Scalar(0), Scalar(0.3), Scalar(1)}; - - Scalar h = Constants::epsilon(); - for (Scalar t : ts) { - // finite difference approximiation of instantanious velocity in frame bar - Vector3 rotVel_in_frame_bar = - finiteDifferenceRotationalVelocity(bar_T_baz, t, h); - - // finite difference approximiation of instantanious velocity in frame foo - Vector3 rotVel_in_frame_foo = - finiteDifferenceRotationalVelocity( - [&foo_T_bar, bar_T_baz](Scalar t) -> SE3 { - return foo_T_bar * bar_T_baz(t); - }, - t, h); - - Vector3 rotVel_in_frame_bar2 = - transformVelocity(foo_T_bar.inverse(), rotVel_in_frame_foo); - SOPHUS_TEST_APPROX( - passed, rotVel_in_frame_bar, rotVel_in_frame_bar2, - // not too tight threshold, because of finit difference approximation - std::sqrt(Constants::epsilon()), ""); - - // The rotational velocities rotVel_in_frame_foo and rotVel_in_frame_bar - // should not be equal since they are in different frames (foo != bar). - SOPHUS_TEST_NOT_APPROX(passed, rotVel_in_frame_foo, rotVel_in_frame_bar, - Scalar(1e-3), ""); - - // Expect same result when using adjoint instead since: - // vee(bar_R_foo * hat(vel_foo) * bar_R_foo^T = bar_R_foo 8 vel_foo. - SOPHUS_TEST_APPROX( - passed, transformVelocity(foo_T_bar.inverse(), rotVel_in_frame_foo), - SO3::vee(foo_T_bar.so3().inverse().matrix() * - SO3::hat(rotVel_in_frame_foo) * - foo_T_bar.so3().matrix()), - Constants::epsilon(), ""); - } - return passed; -} - -int test_velocities() { - using std::cerr; - using std::endl; - - cerr << "Test Velocities" << endl << endl; - cerr << "Double tests: " << endl; - bool passed = tests_linear_velocities(); - passed &= tests_rotational_velocities(); - processTestResult(passed); - - cerr << "Float tests: " << endl; - passed = tests_linear_velocities(); - passed &= tests_rotational_velocities(); - processTestResult(passed); - - return 0; -} -} // namespace experimental -} // namespace Sophus - -int main() { return Sophus::experimental::test_velocities(); }