diff --git a/.github/workflows/build-and-test-sophus-pybind.yml b/.github/workflows/build-and-test-sophus-pybind.yml index 2cf39d06e..b56bec7eb 100644 --- a/.github/workflows/build-and-test-sophus-pybind.yml +++ b/.github/workflows/build-and-test-sophus-pybind.yml @@ -8,11 +8,11 @@ on: jobs: build: - name: Build sophus_pybind on ${{ matrix.os }} / ${{ matrix.cmakeOptions }} + name: Build sophus_pybind on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-20.04, macos-10.15] + os: [ubuntu-20.04] steps: - name : Checkout uses: actions/checkout@v2 @@ -22,44 +22,26 @@ jobs: - name: Install dependencies shell: bash run: | - if [ "$RUNNER_OS" == "Linux" ]; then - # Update & upgrade package lists - sudo apt-get update -y - sudo apt-get upgrade - # Deal with Github CI limitation - # https://github.com/actions/runner-images/issues/6399#issuecomment-1285011525 - sudo apt install -y libunwind-dev + # Update & upgrade package lists + sudo apt-get update -y + sudo apt-get upgrade + # Deal with Github CI limitation + # https://github.com/actions/runner-images/issues/6399#issuecomment-1285011525 + sudo apt install -y libunwind-dev - # Generic dependencies - sudo apt-get install cmake + # Generic dependencies + sudo apt-get install cmake - # Clean APT cache - sudo apt-get clean - - elif [ "$RUNNER_OS" == "macOS" ]; then - # Install system deps with Homebrew - brew install cmake - # VRS dependencies - brew install fmt lz4 zstd xxhash - else - echo "$RUNNER_OS not supported" - exit 1 - fi + # Clean APT cache + sudo apt-get clean - name: Install sophus_pybind shell: bash run: | - # Installing Python and dependencies - if [ "$RUNNER_OS" == "Linux" ]; then - sudo apt-get install libpython3-dev python3-pip - sudo pip3 install numpy pytest - elif [ "$RUNNER_OS" == "macOS" ]; then - pip3 install numpy pytest - else - echo "$RUNNER_OS not supported" - exit 1 - fi - + + sudo apt-get install libpython3-dev python3-pip + sudo pip3 install numpy pytest + # Build and install Python bindings pip3 install . 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..b522e5091 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,51 +12,39 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-20.04] - build_type: [Debug, Release] - row_major: [ON, OFF] - basic_logging: [ON, OFF] - exclude: - - build_type: Release + include: + - os: ubuntu-22.04 + build_type: Release row_major: ON - - build_type: Release - basic_logging: ON - - build_type: Debug - row_major: ON - basic_logging: ON + - os: ubuntu-22.04 + build_type: RelWithDebInfo + row_major: OFF + - os: ubuntu-24.04 + build_type: RelWithDebInfo + row_major: OFF + - os: macos-13 + build_type: RelWithDebInfo + row_major: OFF + - os: macos-14 + build_type: RelWithDebInfo + row_major: OFF fail-fast: false env: - BUILD_TYPE: ${{ matrix.build_type }} ROW_MAJOR_DEFAULT: ${{ matrix.row_major }} - USE_BASIC_LOGGING: ${{ matrix.basic_logging }} - 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' + - name: Install dependencies (Linux incl. Ceres) + run: ./scripts/install_ubuntu_deps_incl_ceres.sh + if: matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-24.04' - - name: Install dependencies (Mac OS) - run: ./scripts/install_osx_deps.sh - if: matrix.os == 'macos-10.15' + - name: Install dependencies (Mac OS incl. Ceres) + run: ./scripts/install_osx_deps_incl_ceres.sh + if: matrix.os == 'macos-14' || matrix.os == 'macos-13' - name: Run tests run: ./scripts/run_cpp_tests.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index eed097231..20035bb3d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.4) -project(Sophus VERSION 1.22.10) +cmake_minimum_required(VERSION 3.16) +project(Sophus VERSION 1.24.06) include(CMakePackageConfigHelpers) include(GNUInstallDirs) @@ -15,16 +15,15 @@ if (NOT DEFINED SOPHUS_MASTER_PROJECT) endif () option(SOPHUS_INSTALL "Generate the install target." ${SOPHUS_MASTER_PROJECT}) -option(SOPHUS_USE_BASIC_LOGGING "Use basic logging (in ensure and test macros)" OFF) if(SOPHUS_MASTER_PROJECT) # Release by default # Turn on Debug with "-DCMAKE_BUILD_TYPE=Debug" if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE Release) + set(CMAKE_BUILD_TYPE RelWithDebInfo) endif() - set(CMAKE_CXX_STANDARD 14) + set(CMAKE_CXX_STANDARD 17) # Set compiler specific settings (FixMe: Should not cmake do this for us automatically?) IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") @@ -34,22 +33,13 @@ if(SOPHUS_MASTER_PROJECT) ELSEIF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") SET(CMAKE_CXX_FLAGS_RELEASE "-O3") - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -Wextra -std=c++14 -Wno-deprecated-declarations -ftemplate-backtrace-limit=0") - SET(CMAKE_CXX_FLAGS_COVERAGE "${CMAKE_CXX_FLAGS_DEBUG} --coverage -fno-inline -fno-inline-small-functions -fno-default-inline") - SET(CMAKE_EXE_LINKER_FLAGS_COVERAGE "${CMAKE_EXE_LINKER_FLAGS_DEBUG} --coverage") - SET(CMAKE_SHARED_LINKER_FLAGS_COVERAGE "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} --coverage") - ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "^MSVC$") - ADD_DEFINITIONS("-D _USE_MATH_DEFINES /bigobj /wd4305 /wd4244 /MP") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -Wextra -std=c++14 -Wno-deprecated-declarations -ftemplate-backtrace-limit=0 -Wno-array-bounds") ENDIF() # Add local path for finding packages, set the local version first list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules") endif() -if(SOPHUS_USE_BASIC_LOGGING) - set (CMAKE_DISABLE_FIND_PACKAGE_fmt ON) -endif() - # Find public dependencies if targets are not yet defined. (Targets might be for example # defined by a parent project including Sophus via `add_subdirectory`.) @@ -69,7 +59,6 @@ add_library (Sophus::Sophus ALIAS sophus) set(SOPHUS_HEADER_FILES sophus/average.hpp sophus/cartesian.hpp - sophus/ceres_local_parameterization.hpp sophus/ceres_manifold.hpp sophus/ceres_typetraits.hpp sophus/common.hpp @@ -89,7 +78,6 @@ set(SOPHUS_HEADER_FILES sophus/so3.hpp sophus/spline.hpp sophus/types.hpp - sophus/velocities.hpp ) set(SOPHUS_OTHER_FILES @@ -110,16 +98,10 @@ else() target_include_directories (sophus SYSTEM INTERFACE ${EIGEN3_INCLUDE_DIR}) endif() -if(SOPHUS_USE_BASIC_LOGGING OR NOT TARGET fmt::fmt) - # NOTE fmt_FOUND does not seem to be defined even though the package config - # was found. - target_compile_definitions(sophus INTERFACE SOPHUS_USE_BASIC_LOGGING=1) - message(STATUS "Turning basic logging ON") -else() - target_link_libraries(sophus INTERFACE fmt::fmt) - set(fmt_DEPENDENCY "find_dependency (fmt ${fmt_VERSION})") - message(STATUS "Turning basic logging OFF") -endif() + +target_link_libraries(sophus INTERFACE fmt::fmt) +set(fmt_DEPENDENCY "find_dependency (fmt ${fmt_VERSION})") +message(STATUS "Turning basic logging OFF") # Associate target with include directory target_include_directories(sophus INTERFACE diff --git a/README.md b/README.md new file mode 100644 index 000000000..256f62ab5 --- /dev/null +++ b/README.md @@ -0,0 +1,73 @@ +

Sophus

+ +

+ A collection of c++ types for 2d and 3d geometric problems. +

+ +
+ + + Build CI Badge + + +Sympy CI Badge + + + License Badge + + +
+ + +This is a c++ implementation of Lie groups commonly used for 2d and 3d +geometric problems (i.e. for Computer Vision or Robotics applications). +Among others, this package includes the special orthogonal groups SO(2) and +SO(3) to present rotations in 2d and 3d as well as the special Euclidean group +SE(2) and SE(3) to represent rigid body transformations (i.e. rotations and +translations) in 2d and 3d. + +## Status + + +*Sophus (aka Sophus 1) is in maintenance mode and there is no plane to add new larger features +(as of June 2024).* + + +However, next versions of Sophus / spiritual successors are under development: + + + - sophus2 is the next c++ version of Sophus and is a complete rewrite. + In addition to the Lie groups, it includes a more geometric concepts + such unit vector, splines, image classes, camera models and more. + + It is currently hosted as part of the [farm-ng-core repository](https://github.com/farm-ng/farm-ng-core/tree/cygnet-dev) + and has likely only a few community users. While the code itself is in a good shape, there are + no good build instructions yet. Hopefully, this will change in the near future. + + + - sophus-rs is a Rust version of Sophus. Similar to sophus2, it includes a more geometric concepts + such unit vector, splines, image classes, camera models and more. Also it includes an early and + experimental version of non-linear least squares optimization library (similar to Ceres, g2o, + etc.). + + sophus-rs has likely only a few community users so far, but should be easy to build and + experiment with, of course being written in Rust. + + https://github.com/sophus-vision/sophus-rs + + https://crates.io/crates/sophus + + + +How to build +------------ + +Sophus is tested on Linux and macOS. It also worked on Windows in the past, however there is +currently no CI for Windows, so it might require some smaller patches to build on Windows. + +There are no comprehensive build instructions but inspecting the install [scripts] +as well as the [main.yml](.github/workflows/main.yml) file should give you a good idea how to +build the required dependencies. \ No newline at end of file diff --git a/README.rst b/README.rst deleted file mode 100644 index e7aab639b..000000000 --- a/README.rst +++ /dev/null @@ -1,44 +0,0 @@ -|GithubCICpp|_ windows: |AppVeyor|_ |GithubCISympy|_ |ci_cov|_ - - -Sophus -====== - -Overview --------- - -This is a c++ implementation of Lie groups commonly used for 2d and 3d -geometric problems (i.e. for Computer Vision or Robotics applications). -Among others, this package includes the special orthogonal groups SO(2) and -SO(3) to present rotations in 2d and 3d as well as the special Euclidean group -SE(2) and SE(3) to represent rigid body transformations (i.e. rotations and -translations) in 2d and 3d. - -API documentation: https://strasdat.github.io/Sophus/ - -Cross platform support ----------------------- - -Sophus compiles with clang and gcc on Linux and OS X as well as msvc on Windows. -The specific compiler and operating system versions which are supported are -the ones which are used in the Continuous Integration (CI): See GitHubCI_ and -AppVeyor_ for details. - -However, it should work (with no to minor modification) on many other -modern configurations as long they support c++14, CMake, Eigen 3.3.X and -(optionally) fmt. The fmt dependency can be eliminated by passing -"-DUSE_BASIC_LOGGING=ON" to cmake when configuring Sophus. - -.. _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 diff --git a/Sophus.code-workspace b/Sophus.code-workspace index 876a1499c..8fef94ca5 100644 --- a/Sophus.code-workspace +++ b/Sophus.code-workspace @@ -4,5 +4,67 @@ "path": "." } ], - "settings": {} + "settings": { + "files.associations": { + "type_traits": "cpp", + "array": "cpp", + "optional": "cpp", + "atomic": "cpp", + "bit": "cpp", + "*.tcc": "cpp", + "cctype": "cpp", + "chrono": "cpp", + "clocale": "cpp", + "cmath": "cpp", + "compare": "cpp", + "complex": "cpp", + "concepts": "cpp", + "cstdarg": "cpp", + "cstddef": "cpp", + "cstdint": "cpp", + "cstdio": "cpp", + "cstdlib": "cpp", + "cstring": "cpp", + "ctime": "cpp", + "cwchar": "cpp", + "cwctype": "cpp", + "deque": "cpp", + "list": "cpp", + "map": "cpp", + "set": "cpp", + "string": "cpp", + "unordered_map": "cpp", + "unordered_set": "cpp", + "vector": "cpp", + "exception": "cpp", + "algorithm": "cpp", + "functional": "cpp", + "iterator": "cpp", + "memory": "cpp", + "memory_resource": "cpp", + "numeric": "cpp", + "random": "cpp", + "ratio": "cpp", + "string_view": "cpp", + "system_error": "cpp", + "tuple": "cpp", + "utility": "cpp", + "initializer_list": "cpp", + "iosfwd": "cpp", + "iostream": "cpp", + "istream": "cpp", + "limits": "cpp", + "new": "cpp", + "numbers": "cpp", + "ostream": "cpp", + "semaphore": "cpp", + "sstream": "cpp", + "stdexcept": "cpp", + "stop_token": "cpp", + "streambuf": "cpp", + "thread": "cpp", + "cinttypes": "cpp", + "typeinfo": "cpp" + } + } } \ 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 deleted file mode 100755 index 39c188de4..000000000 --- a/scripts/install_linux_deps.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -set -x # echo on -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 .. - -git clone https://ceres-solver.googlesource.com/ceres-solver ceres-solver -cd ceres-solver -git reset --hard b0aef211db734379319c19c030e734d6e23436b0 -mkdir build -cd build -ccache -s -cmake -DCMAKE_CXX_COMPILER_LAUNCHER=ccache .. -make -j8 -sudo make install -cd ../.. 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/scripts/install_osx_deps.sh b/scripts/install_osx_deps.sh deleted file mode 100755 index e2125dff7..000000000 --- a/scripts/install_osx_deps.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash - -set -x # echo on -set -e # exit on error - -brew update -brew install fmt -brew install ccache - -# Build a specific version of ceres-solver instead of one shipped over brew -curl https://raw.githubusercontent.com/Homebrew/homebrew-core/b0792ccba6e71cd028263ca7621db894afc602d2/Formula/ceres-solver.rb -o ceres-solver.rb -patch < -optional iterativeMean( +std::optional iterativeMean( SequenceContainer const& foo_Ts_bar, int max_num_iterations) { size_t N = foo_Ts_bar.size(); SOPHUS_ENSURE(N >= 1, "N must be >= 1."); @@ -52,23 +52,16 @@ optional iterativeMean( foo_T_average = foo_T_newaverage; } // LCOV_EXCL_START - return nullopt; + return std::nullopt; // LCOV_EXCL_STOP } -#ifdef DOXYGEN_SHOULD_SKIP_THIS -/// Mean implementation for any Lie group. -template -optional average( - SequenceContainer const& foo_Ts_bar); -#else - // Mean implementation for Cartesian. template -enable_if_t >::value, - optional > +std::enable_if_t >::value, + std::optional > average(SequenceContainer const& foo_Ts_bar) { size_t N = std::distance(std::begin(foo_Ts_bar), std::end(foo_Ts_bar)); SOPHUS_ENSURE(N >= 1, "N must be >= 1."); @@ -84,9 +77,9 @@ average(SequenceContainer const& foo_Ts_bar) { // Mean implementation for SO(2). template -enable_if_t< +std::enable_if_t< std::is_same >::value, - optional > + std::optional > average(SequenceContainer const& foo_Ts_bar) { // This implements rotational part of Proposition 12 from Sec. 6.2 of // ftp://ftp-sop.inria.fr/epidaure/Publications/Arsigny/arsigny_rr_biinvariant_average.pdf. @@ -105,9 +98,9 @@ average(SequenceContainer const& foo_Ts_bar) { // Mean implementation for RxSO(2). template -enable_if_t< +std::enable_if_t< std::is_same >::value, - optional > + std::optional > average(SequenceContainer const& foo_Ts_bar) { size_t N = std::distance(std::begin(foo_Ts_bar), std::end(foo_Ts_bar)); SOPHUS_ENSURE(N >= 1, "N must be >= 1."); @@ -179,9 +172,9 @@ Eigen::Quaternion averageUnitQuaternion( // TODO: Detect degenerated cases and return nullopt. template -enable_if_t< +std::enable_if_t< std::is_same >::value, - optional > + std::optional > average(SequenceContainer const& foo_Ts_bar) { return SO3(details::averageUnitQuaternion(foo_Ts_bar)); } @@ -189,9 +182,9 @@ average(SequenceContainer const& foo_Ts_bar) { // Mean implementation for R x SO(3). template -enable_if_t< +std::enable_if_t< std::is_same >::value, - optional > + std::optional > average(SequenceContainer const& foo_Ts_bar) { size_t N = std::distance(std::begin(foo_Ts_bar), std::end(foo_Ts_bar)); @@ -208,9 +201,9 @@ average(SequenceContainer const& foo_Ts_bar) { template -enable_if_t< +std::enable_if_t< std::is_same >::value, - optional > + std::optional > average(SequenceContainer const& foo_Ts_bar, int max_num_iterations = 20) { // TODO: Implement Proposition 12 from Sec. 6.2 of // ftp://ftp-sop.inria.fr/epidaure/Publications/Arsigny/arsigny_rr_biinvariant_average.pdf. @@ -219,31 +212,29 @@ average(SequenceContainer const& foo_Ts_bar, int max_num_iterations = 20) { template -enable_if_t< +std::enable_if_t< std::is_same >::value, - optional > + std::optional > average(SequenceContainer const& foo_Ts_bar, int max_num_iterations = 20) { return iterativeMean(foo_Ts_bar, max_num_iterations); } template -enable_if_t< +std::enable_if_t< std::is_same >::value, - optional > + std::optional > average(SequenceContainer const& foo_Ts_bar, int max_num_iterations = 20) { return iterativeMean(foo_Ts_bar, max_num_iterations); } template -enable_if_t< +std::enable_if_t< std::is_same >::value, - optional > + std::optional > average(SequenceContainer const& foo_Ts_bar, int max_num_iterations = 20) { return iterativeMean(foo_Ts_bar, max_num_iterations); } -#endif // DOXYGEN_SHOULD_SKIP_THIS - } // namespace Sophus diff --git a/sophus/cartesian.hpp b/sophus/cartesian.hpp index 8ade57eae..ee3e210a5 100644 --- a/sophus/cartesian.hpp +++ b/sophus/cartesian.hpp @@ -191,8 +191,8 @@ class CartesianBase { /// Group action on points, again just vector addition. /// template ::value>::type> + typename = typename std::enable_if_t< + IsFixedSizeVector::value>> SOPHUS_FUNC PointProduct operator*( Eigen::MatrixBase const& p) const { return PointProduct(params() + p); @@ -201,8 +201,8 @@ class CartesianBase { /// Group action on homogeneous points. See above for more details. /// template ::value>::type> + typename = typename std::enable_if_t< + IsFixedSizeVector::value>> SOPHUS_FUNC HomogeneousPointProduct operator*( Eigen::MatrixBase const& p) const { const auto rp = *this * p.template head(); @@ -228,8 +228,8 @@ class CartesianBase { /// type. /// template >::value>::type> + typename = typename std::enable_if_t< + std::is_same>::value>> SOPHUS_FUNC CartesianBase& operator*=( CartesianBase const& other) { *static_cast(this) = *this * other; diff --git a/sophus/ceres_local_parameterization.hpp b/sophus/ceres_local_parameterization.hpp deleted file mode 100644 index 63ee4a715..000000000 --- a/sophus/ceres_local_parameterization.hpp +++ /dev/null @@ -1,52 +0,0 @@ -#pragma once - -#include - -#include - -namespace Sophus { - -/// Templated local parameterization for LieGroup [with implemented -/// LieGroup::Dx_this_mul_exp_x_at_0() ] -template