Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 20 additions & 15 deletions .github/workflows/linux_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,19 @@ jobs:
matrix:
# Github Actions requires a single row to be added to the build matrix.
# See https://help.github.com/en/articles/workflow-syntax-for-github-actions.
name: [
ubuntu-20.04-gcc-9,
ubuntu-20.04-clang-10,
]
name: [ubuntu-24.04-gcc-14, ubuntu-24.04-clang-16]

build_type: [Debug, Release]
include:
- name: ubuntu-20.04-gcc-9
os: ubuntu-20.04
- name: ubuntu-24.04-gcc-14
os: ubuntu-24.04
compiler: gcc
version: "9"
version: "14"

- name: ubuntu-20.04-clang-10
os: ubuntu-20.04
- name: ubuntu-24.04-clang-16
os: ubuntu-24.04
compiler: clang
version: "10"
version: "16"

steps:
- name: Setup Compiler
Expand Down Expand Up @@ -72,13 +69,21 @@ jobs:

- name: Install GTSAM
run: |
git clone https://github.com/borglab/gtsam.git
cd gtsam && mkdir build && cd $_
cmake -DGTSAM_ALLOW_DEPRECATED_SINCE_V43=OFF -DGTSAM_WITH_TBB=OFF -DGTSAM_BUILD_UNSTABLE=OFF .. && sudo make -j4 install
cd ../../
set -e
git clone https://github.com/borglab/gtsam.git /tmp/gtsam_source
cd /tmp/gtsam_source
mkdir build && cd $_
cmake -DGTSAM_ALLOW_DEPRECATED_SINCE_V43=OFF \
-DGTSAM_WITH_TBB=OFF \
-DGTSAM_BUILD_UNSTABLE=OFF \
-DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF ..
sudo make -j4 install
sudo ldconfig
cd ${{ github.workspace }}
rm -rf /tmp/gtsam_source

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Build Directory
run: mkdir build
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/macos_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ jobs:
matrix:
# Github Actions requires a single row to be added to the build matrix.
# See https://help.github.com/en/articles/workflow-syntax-for-github-actions.
name: [macOS-12-xcode-14.2]
name: [macos-14-xcode-15.4]

build_type: [Debug, Release]
include:
- name: macOS-12-xcode-14.2
os: macOS-12
- name: macos-14-xcode-15.4
os: macos-14
compiler: xcode
version: "14.2"
version: "15.4"

steps:
- name: Setup Compiler
Expand Down
86 changes: 44 additions & 42 deletions .github/workflows/python_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,16 @@ jobs:
CTEST_OUTPUT_ON_FAILURE: ON
CTEST_PARALLEL_LEVEL: 2
CMAKE_BUILD_TYPE: ${{ matrix.build_type }}
PYTHON_VERSION: ${{ matrix.python_version }}

strategy:
fail-fast: false
matrix:
# Github Actions requires a single row to be added to the build matrix.
# See https://help.github.com/en/articles/workflow-syntax-for-github-actions.
name: [ubuntu-22.04-gcc-9, ubuntu-22.04-clang-12, macOS-12-xcode-14.2]
name: [ubuntu-22.04-gcc-9, ubuntu-22.04-clang-12, macos-14-xcode-15.4]

build_type: [Debug, Release]
python_version: [3]
python_version: [3.11]
include:
- name: ubuntu-22.04-gcc-9
os: ubuntu-22.04
Expand All @@ -33,19 +32,19 @@ jobs:
compiler: clang
version: "12"

- name: ubuntu-22.04-clang-12
os: ubuntu-22.04
compiler: clang
version: "12"
build_type: Debug
python_version: "3"

- name: macOS-12-xcode-14.2
os: macOS-12
- name: macos-14-xcode-15.4
os: macos-14
compiler: xcode
version: "14.2"
version: "15.4"

steps:
- name: Checkout
uses: actions/checkout@v4

- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python_version }}

- name: Install Dependencies (Linux)
if: runner.os == 'Linux'
run: |
Expand Down Expand Up @@ -82,49 +81,52 @@ jobs:
brew tap borglab/core

- name: Python Dependencies
shell: bash
run: |
# Install dependencies for gtwrap
pip3 install -U setuptools numpy pyparsing pyyaml
pip install --upgrade pip
pip install -U "setuptools<70" wheel "numpy>=1.11.0" pyparsing "pybind11-stubgen>=2.5.1"

- name: GTSAM (Linux)
- name: Install GTSAM (Linux)
if: runner.os == 'Linux'
run: |
# Install gtsam
git clone https://github.com/borglab/gtsam.git /home/runner/work/gtsam
cd /home/runner/work/gtsam
git clone https://github.com/borglab/gtsam.git /tmp/gtsam_source
cd /tmp/gtsam_source
mkdir build && cd $_
cmake -D GTSAM_BUILD_EXAMPLES_ALWAYS=OFF -DGTSAM_BUILD_PYTHON=ON ..
sudo make -j$(nproc) install && sudo make python-install
cmake -DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF \
-DGTSAM_BUILD_PYTHON=ON \
-DWRAP_PYTHON_VERSION=${{ matrix.python_version }} \
-DGTSAM_WITH_TBB=OFF \
..
sudo make -j4 install
make -j4 python-install
sudo ldconfig
cd $GITHUB_WORKSPACE # go back to home directory
cd ${{ github.workspace }} # go back to home directory
sudo rm -rf /tmp/gtsam_source

- name: GTSAM (macOS)
- name: Install GTSAM (macOS)
if: runner.os == 'macOS'
run: |
# Install gtsam
git clone https://github.com/borglab/gtsam.git /Users/runner/work/gtsam
cd /Users/runner/work/gtsam
set -e
git clone https://github.com/borglab/gtsam.git ${{ github.workspace }}/gtsam
cd ${{ github.workspace }}/gtsam
mkdir build && cd $_
cmake -D GTSAM_BUILD_EXAMPLES_ALWAYS=OFF -DGTSAM_BUILD_PYTHON=ON -DPYTHON_EXECUTABLE=/usr/local/bin/python3 ..
make -j$(sysctl -n hw.physicalcpu) install && make python-install
cd $GITHUB_WORKSPACE # go back to home directory

- name: Checkout
uses: actions/checkout@v3
cmake -DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF \
-DGTSAM_BUILD_PYTHON=ON \
-DWRAP_PYTHON_VERSION=${{ matrix.python_version }} \
-DGTSAM_WITH_TBB=OFF \
..
sudo make -j4 install
make -j4 python-install
cd ${{ github.workspace }} # go back to home directory

- name: Build Directory
run: mkdir build
run: mkdir -p build

- name: Configure (Linux)
if: runner.os == 'Linux'
run: |
cmake -DGPMP2_BUILD_PYTHON_TOOLBOX=ON ..
working-directory: ./build

- name: Configure (macOS)
if: runner.os == 'macOS'
- name: Configure
run: |
cmake -DGPMP2_BUILD_PYTHON_TOOLBOX=ON -DPYTHON_EXECUTABLE=/usr/local/bin/python3 ..
cmake -DGPMP2_BUILD_PYTHON_TOOLBOX=ON \
-DWRAP_PYTHON_VERSION=${{ matrix.python_version }} \
..
working-directory: ./build

- name: Build
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ build*
*.pyc
*.asv
**/.DS_Store
.vscode
17 changes: 6 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.12)
enable_testing()
project(gpmp2
LANGUAGES CXX C
Expand All @@ -14,11 +14,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
#TODO(Varun) Verify C++17 is enabled on Windows as well
# Look at GtsamBuildTypes L153

# Mac ONLY. Define Relative Path on Mac OS
if(NOT DEFINED CMAKE_MACOSX_RPATH)
set(CMAKE_MACOSX_RPATH 0)
endif()

# version indicator
set(GPMP2_VERSION_MAJOR 1)
set(GPMP2_VERSION_MINOR 0)
Expand All @@ -42,7 +37,7 @@ if(GPMP2_ENABLE_BOOST_SERIALIZATION)
endif()

if(GPMP2_BUILD_STATIC_LIBRARY AND GPMP2_BUILD_MATLAB_TOOLBOX)
message(FATAL_ERROR "Matlab toolbox needs static lib to be built")
message(FATAL_ERROR "Matlab toolbox needs shared lib to be built")
endif()


Expand All @@ -52,11 +47,12 @@ include_directories(${GTSAM_INCLUDE_DIR})
set(GTSAM_LIBRARIES gtsam) # TODO: automatic search libs

find_package(GTSAMCMakeTools)
include(GtsamMakeConfigFile)
include(GtsamBuildTypes)
include(GtsamMakeConfigFile)
include(GtsamTesting)
include(GtsamPrinting)

# for unittest scripts
# for unit tests and scripts
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${GTSAM_DIR}/../GTSAMCMakeTools")

# Boost - same requirement as gtsam
Expand All @@ -68,8 +64,7 @@ include_directories(${Boost_INCLUDE_DIR})
configure_file("gpmp2/config.h.in" "gpmp2/config.h")
list(APPEND gpmp2_srcs "${PROJECT_BINARY_DIR}/gpmp2/config.h")
include_directories(BEFORE ${PROJECT_BINARY_DIR}) # So we can include generated config header files
install(FILES "${PROJECT_BINARY_DIR}/gpmp2/config.h" DESTINATION include/gpmp2)

install(FILES "${PROJECT_BINARY_DIR}/gpmp2/config.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/gpmp2)

# include current source folder, at the very beginning
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR})
Expand Down
2 changes: 2 additions & 0 deletions gpmp2/geometry/DynamicLieTraits.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ struct DynamicLieGroupTraits {
ChartJacobian H = {}) {
return m.inverse(H);
}

static Eigen::MatrixXd AdjointMap(const Class& m) { return m.AdjointMap(); }
/// @}
};

Expand Down
9 changes: 5 additions & 4 deletions gpmp2/geometry/ProductDynamicLieGroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include <gpmp2/geometry/utilsDynamic.h>
#include <gtsam/base/Lie.h>
#include <gtsam/base/ProductLieGroup.h>

#include <utility> // pair

Expand All @@ -18,11 +19,11 @@ namespace gpmp2 {
/// Template to construct the product Lie group of two other Lie groups
/// Assumes Lie group structure for G and H, at least one is dynamic size types
template <typename G, typename H>
class ProductDynamicLieGroup : public std::pair<G, H> {
class ProductDynamicLieGroup : public gtsam::ProductLieGroup<G, H> {
private:
GTSAM_CONCEPT_ASSERT((gtsam::IsLieGroup<G>));
GTSAM_CONCEPT_ASSERT((gtsam::IsLieGroup<H>));
typedef std::pair<G, H> Base;
GTSAM_CONCEPT_ASSERT(gtsam::IsLieGroup<G>);
GTSAM_CONCEPT_ASSERT(gtsam::IsLieGroup<H>);
typedef gtsam::ProductLieGroup<G, H> Base;

protected:
// static dimensions
Expand Down
8 changes: 4 additions & 4 deletions gpmp2/geometry/tests/testDynamicVector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ GTSAM_CONCEPT_LIE_INST(DynamicVector)

/* ************************************************************************** */
TEST(DynamicVector, Concept) {
GTSAM_CONCEPT_ASSERT((IsGroup<DynamicVector>));
GTSAM_CONCEPT_ASSERT((IsManifold<DynamicVector>));
GTSAM_CONCEPT_ASSERT((IsLieGroup<DynamicVector>));
GTSAM_CONCEPT_ASSERT((IsVectorSpace<DynamicVector>));
GTSAM_CONCEPT_ASSERT(IsGroup<DynamicVector>);
GTSAM_CONCEPT_ASSERT(IsManifold<DynamicVector>);
GTSAM_CONCEPT_ASSERT(IsLieGroup<DynamicVector>);
GTSAM_CONCEPT_ASSERT(IsVectorSpace<DynamicVector>);
}

/* ************************************************************************** */
Expand Down
6 changes: 3 additions & 3 deletions gpmp2/geometry/tests/testPose2Vector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ using namespace gpmp2;

/* ************************************************************************** */
TEST(Pose2Vector, Lie) {
GTSAM_CONCEPT_ASSERT((IsGroup<Pose2Vector>));
GTSAM_CONCEPT_ASSERT((IsManifold<Pose2Vector>));
GTSAM_CONCEPT_ASSERT((IsLieGroup<Pose2Vector>));
GTSAM_CONCEPT_ASSERT(IsGroup<Pose2Vector>);
GTSAM_CONCEPT_ASSERT(IsManifold<Pose2Vector>);
GTSAM_CONCEPT_ASSERT(IsLieGroup<Pose2Vector>);
}

/* ************************************************************************** */
Expand Down
6 changes: 3 additions & 3 deletions gpmp2/geometry/tests/testProductDynamicLieGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ struct traits<Product> : internal::DynamicLieGroupTraits<Product> {

//******************************************************************************
TEST(ProductDynamicLieGroup, ProductLieGroup) {
GTSAM_CONCEPT_ASSERT((IsGroup<Product>));
GTSAM_CONCEPT_ASSERT((IsManifold<Product>));
GTSAM_CONCEPT_ASSERT((IsLieGroup<Product>));
GTSAM_CONCEPT_ASSERT(IsGroup<Product>);
GTSAM_CONCEPT_ASSERT(IsManifold<Product>);
GTSAM_CONCEPT_ASSERT(IsLieGroup<Product>);
Product pair1(Point2(0, 0), Pose2());
Vector5 d;
d << 1, 2, 0.1, 0.2, 0.3;
Expand Down
2 changes: 1 addition & 1 deletion gpmp2/gp/GaussianProcessInterpolatorLie.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace gpmp2 {
template <typename T>
class GaussianProcessInterpolatorLie {
private:
GTSAM_CONCEPT_ASSERT((gtsam::IsLieGroup<T>));
GTSAM_CONCEPT_ASSERT(gtsam::IsLieGroup<T>);
typedef GaussianProcessInterpolatorLie<T> This;

size_t dof_;
Expand Down
2 changes: 1 addition & 1 deletion gpmp2/gp/GaussianProcessPriorLie.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ template <typename T>
class GaussianProcessPriorLie
: public gtsam::NoiseModelFactorN<T, gtsam::Vector, T, gtsam::Vector> {
private:
GTSAM_CONCEPT_ASSERT((gtsam::IsLieGroup<T>));
GTSAM_CONCEPT_ASSERT(gtsam::IsLieGroup<T>);
typedef GaussianProcessPriorLie<T> This;
typedef gtsam::NoiseModelFactorN<T, gtsam::Vector, T, gtsam::Vector> Base;

Expand Down
6 changes: 4 additions & 2 deletions python/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
numpy
gtsam
numpy>=1.11.0
gtsam
pyparsing>=2.4.2
pybind11-stubgen>=2.5.1