Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with using inverse() on a poseSE3 MAC OS #373

Closed
tohsin opened this issue Aug 25, 2022 · 4 comments
Closed

Error with using inverse() on a poseSE3 MAC OS #373

tohsin opened this issue Aug 25, 2022 · 4 comments
Labels

Comments

@tohsin
Copy link

tohsin commented Aug 25, 2022

Error with using pose SE3 inverse MAC OS
[I am honestly not sure what the problem is but it seems calling the inverse function on a pose is causing it to break]

the error message is

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DGFLAGS_IS_A_DLL=0 -DHAVE_EIGEN -DHAVE_GLEW -DHAVE_PYTHON -DPANGO_DEFAULT_WIN_URI=\"cocoa\" -D_OSX_ -Dmyslam_EXPORTS -I/usr/include/eigen3 -I/Users/emma/dev/visual-slam/stereo_slam/include -isystem /usr/local/Cellar/opencv/4.6.0/include/opencv4 -iframework /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/System/Library/Frameworks -isystem /usr/local/include -isystem /Users/emma/dev/Pangolin/components/pango_core/include -isystem /Users/emma/dev/Pangolin/components/pango_display/include -isystem /Users/emma/dev/Pangolin/components/pango_opengl/include -isystem /Users/emma/dev/Pangolin/components/pango_image/include -isystem /usr/local/include/eigen3 -isystem /Users/emma/dev/Pangolin/components/pango_windowing/include -isystem /Users/emma/dev/Pangolin/build/include -isystem /Users/emma/dev/Pangolin/components/pango_vars/include -isystem /Users/emma/dev/Pangolin/components/pango_geometry/include -isystem /Users/emma/dev/Pangolin/components/tinyobj/include -isystem /Users/emma/dev/Pangolin/components/pango_glgeometry/include -isystem /Users/emma/dev/Pangolin/components/pango_packetstream/include -isystem /Users/emma/dev/Pangolin/components/pango_plot/include -isystem /Users/emma/dev/Pangolin/components/pango_python/include -isystem /Users/emma/dev/Pangolin/components/pango_video/include -isystem /Users/emma/dev/Pangolin/components/pango_scene/include -isystem /Users/emma/dev/Pangolin/components/pango_tools/include -g -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -fPIC -std=gnu++14 -MD -MT src/CMakeFiles/myslam.dir/viewer.cpp.o -MF src/CMakeFiles/myslam.dir/viewer.cpp.o.d -o src/CMakeFiles/myslam.dir/viewer.cpp.o -c /Users/emma/dev/visual-slam/stereo_slam/src/viewer.cpp
In file included from /Users/emma/dev/visual-slam/stereo_slam/src/viewer.cpp:4:
In file included from /Users/emma/dev/visual-slam/stereo_slam/include/stereo_slam/viewer.h:11:
In file included from /Users/emma/dev/visual-slam/stereo_slam/include/stereo_slam/common_include.h:102:
In file included from /usr/local/include/sophus/se3.hpp:6:
In file included from /usr/local/include/sophus/so3.hpp:6:
In file included from /usr/local/include/sophus/rotation_matrix.hpp:9:
In file included from /usr/local/include/sophus/types.hpp:7:
In file included from /usr/local/include/sophus/common.hpp:35:
In file included from /usr/local/include/fmt/format.h:48:
/usr/local/include/fmt/core.h:1756:3: error: static_assert failed due to requirement 'formattable' "Cannot format an argument. To make type T formattable provide a formatter<T> specialization: https://fmt.dev/latest/api.html#udt"
  static_assert(
  ^
/usr/local/include/fmt/core.h:1777:10: note: in instantiation of function template specialization 'fmt::detail::make_value<fmt::basic_format_context<fmt::appender, char>, Eigen::Transpose<Eigen::Matrix<double, 4, 1, 0>> &>' requested here
  return make_value<Context>(val);
         ^
/usr/local/include/fmt/core.h:1899:23: note: in instantiation of function template specialization 'fmt::detail::make_arg<true, fmt::basic_format_context<fmt::appender, char>, fmt::detail::type::custom_type, Eigen::Transpose<Eigen::Matrix<double, 4, 1, 0>> &, 0>' requested here
        data_{detail::make_arg<
                      ^
/usr/local/include/fmt/core.h:1918:10: note: in instantiation of function template specialization 'fmt::format_arg_store<fmt::basic_format_context<fmt::appender, char>, Eigen::Transpose<Eigen::Matrix<double, 4, 1, 0>>>::format_arg_store<Eigen::Transpose<Eigen::Matrix<double, 4, 1, 0>> &>' requested here
  return {FMT_FORWARD(args)...};
         ^
/usr/local/include/fmt/core.h:3291:28: note: in instantiation of function template specialization 'fmt::make_format_args<fmt::basic_format_context<fmt::appender, char>, Eigen::Transpose<Eigen::Matrix<double, 4, 1, 0>> &>' requested here
  const auto& vargs = fmt::make_format_args(args...);
                           ^
/usr/local/include/sophus/so3.hpp:303:5: note: in instantiation of function template specialization 'fmt::print<Eigen::Transpose<Eigen::Matrix<double, 4, 1, 0>>>' requested here
    SOPHUS_ENSURE(length >= Constants<Scalar>::epsilon(),
    ^
/usr/local/include/sophus/common.hpp:139:7: note: expanded from macro 'SOPHUS_ENSURE'
      SOPHUS_DEDAULT_ENSURE_FAILURE_IMPL(SOPHUS_FUNCTION, __FILE__, __LINE__, \
      ^
/usr/local/include/sophus/common.hpp:119:5: note: expanded from macro 'SOPHUS_DEDAULT_ENSURE_FAILURE_IMPL'
    SOPHUS_FMT_PRINT(description, ##__VA_ARGS__);                             \
    ^
/usr/local/include/sophus/common.hpp:60:8: note: expanded from macro 'SOPHUS_FMT_PRINT'
  fmt::print(SOPHUS_FMT_STRING(description), ##__VA_ARGS__); \
       ^
/usr/local/include/sophus/so3.hpp:515:11: note: in instantiation of member function 'Sophus::SO3Base<Sophus::SO3<double, 0>>::normalize' requested here
    Base::normalize();
          ^
/usr/local/include/sophus/so3.hpp:230:12: note: in instantiation of function template specialization 'Sophus::SO3<double, 0>::SO3<Eigen::Quaternion<double, 0>>' requested here
    return SO3<Scalar>(unit_quaternion().conjugate());
           ^
/usr/local/include/sophus/se3.hpp:209:30: note: in instantiation of member function 'Sophus::SO3Base<Sophus::SO3<double, 0>>::inverse' requested here
    SO3<Scalar> invR = so3().inverse();
                             ^
/Users/emma/dev/visual-slam/stereo_slam/include/stereo_slam/camera.h:26:27: note: in instantiation of member function 'Sophus::SE3Base<Sophus::SE3<double, 0>>::inverse' requested here
        pose_inv_ = pose_.inverse();
                          ^
1 error generated.

not sure if its useful but my cmakelist file is

cmake_minimum_required(VERSION 3.22)
project(stereo_slam)

set(CMAKE_CXX_STANDARD 14)

#add_executable(stereo_slam main.cpp)

list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)

############### dependencies ######################
# Eigen
include_directories("/usr/include/eigen3")

# OpenCV
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})

# pangolin
find_package(Pangolin REQUIRED)
include_directories(${Pangolin_INCLUDE_DIRS})

find_package(OpenGL REQUIRED QUIET)
include_directories(${OPENGL_INCLUDE_DIR})

# Sophus
find_package(Sophus REQUIRED)
include_directories(${Sophus_INCLUDE_DIRS})

# G2O
find_package(G2O REQUIRED)
include_directories(${G2O_INCLUDE_DIRS})

# glog
find_package(Glog REQUIRED)
include_directories(${GLOG_INCLUDE_DIRS})

# gtest
find_package(GTest REQUIRED)
include_directories(${GTEST_INCLUDE_DIRS})

# gflags
find_package(GFlags REQUIRED)
include_directories(${GFLAGS_INCLUDE_DIRS})

# csparse
find_package(CSPARSE REQUIRED)
include_directories(${CSPARSE_INCLUDE_DIR})

set(THIRD_PARTY_LIBS
        ${OpenCV_LIBS}
        ${Sophus_LIBRARIES}
        ${OPENGL_LIBRARIES}
        ${Pangolin_LIBRARIES}
        ${G2O_CORE_LIBRARY} ${G2O_STUFF_LIBRARY}
        ${G20_TYPES_LIBRARY}
        ${G2O_SOLVER_CSPARSE_LIBRARY}
        ${G2O_CSPARSE_EXTENSION}
        ${GTEST_BOTH_LIBRARIES}
        ${GLOG_LIBRARIES}
        ${GFLAGS_LIBRARIES}
        pthread
        ${CSPARSE_LIBRARY}
        Sophus::Sophus
        fmt
        )

enable_testing()

############### source and test ######################
include_directories(${PROJECT_SOURCE_DIR}/include)
add_subdirectory(src)
add_subdirectory(test)
add_subdirectory(app)


@tohsin tohsin added the bug label Aug 25, 2022
@NikolausDemmel
Copy link
Contributor

Looks like a duplicate of #366

@tohsin
Copy link
Author

tohsin commented Aug 27, 2022

Oh ok thanks, it says i should try to install a lower version of fmt?

@tohsin
Copy link
Author

tohsin commented Aug 27, 2022

If i just download 8.1.1 v of FMT and install that will it naturally override the old one?

@tohsin
Copy link
Author

tohsin commented Aug 27, 2022

It works thanks

@tohsin tohsin closed this as completed Aug 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants