Skip to content

Commit 6807eee

Browse files
authored
Merge pull request #105 from robotology/fixeigen5
Fix compatibility with Eigen3 5.0.0 and bump version to 0.10.1
2 parents b180d03 + 4dc452e commit 6807eee

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ cmake_minimum_required(VERSION 3.5)
1111

1212
project(BayesFilters
1313
LANGUAGES CXX
14-
VERSION 0.10.0)
14+
VERSION 0.10.1)
1515

1616
set(CMAKE_CXX_STANDARD 11)
1717

@@ -77,7 +77,7 @@ install_basic_package_files(${PROJECT_NAME}
7777
NO_SET_AND_CHECK_MACRO
7878
VARS_PREFIX ${PROJECT_NAME}
7979
NO_CHECK_REQUIRED_COMPONENTS_MACRO
80-
DEPENDENCIES Threads)
80+
DEPENDENCIES Eigen3 Threads)
8181

8282
# Add the uninstall target
8383
include(AddUninstallTarget)

src/BayesFilters/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ set_target_properties(${LIBRARY_TARGET_NAME} PROPERTIES VERSION ${${PROJEC
155155

156156
target_include_directories(${LIBRARY_TARGET_NAME} PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
157157
"$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>")
158-
if(NOT TARGET Eigen3)
158+
if(NOT TARGET Eigen3::Eigen)
159159
target_include_directories(${LIBRARY_TARGET_NAME} PUBLIC ${EIGEN3_INCLUDE_DIR})
160160

161161
target_link_libraries(${LIBRARY_TARGET_NAME} PUBLIC Threads::Threads ${CMAKE_THREAD_LIBS_INIT})

src/BayesFilters/src/sigma_point.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,11 @@ MatrixXd bfl::sigma_point::sigma_point(const GaussianMixture& state, const doubl
8787

8888
for (std::size_t i = 0; i < state.components; i++)
8989
{
90+
#if EIGEN_VERSION_AT_LEAST(5,0,0)
91+
JacobiSVD<MatrixXd, Eigen::ComputeThinU> svd = state.covariance(i).jacobiSvd<Eigen::ComputeThinU>();
92+
#else
9093
JacobiSVD<MatrixXd> svd = state.covariance(i).jacobiSvd(ComputeThinU);
91-
94+
#endif
9295
MatrixXd A = svd.matrixU() * svd.singularValues().cwiseSqrt().asDiagonal();
9396

9497
Ref<MatrixXd> sp = sigma_points.middleCols(((state.dim_covariance * 2) + 1) * i, ((state.dim_covariance * 2) + 1));

0 commit comments

Comments
 (0)