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

Optimizer.cpp & map.cpp some erros #14

Open
umutboz opened this issue Feb 9, 2019 · 4 comments
Open

Optimizer.cpp & map.cpp some erros #14

umutboz opened this issue Feb 9, 2019 · 4 comments

Comments

@umutboz
Copy link

umutboz commented Feb 9, 2019

macOS Mojave

Xcode 10.1

I get some errors when building on the device.

Showing Recent Messages
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/map:818:5: Static_assert failed due to requirement 'is_same<typename allocator_type::value_type, value_type>::value' "Allocator::value_type must be same type as value_type"

ORB_SLAM/Optimizer.cpp:581:43: No viable overloaded operator[] for type 'LoopClosing::KeyFrameAndPose' (aka 'map<ORB_SLAM::KeyFrame *, g2o::Sim3, std::less<KeyFrame *>, Eigen::aligned_allocator<std::pair<const KeyFrame *, g2o::Sim3> > >')

ORB_SLAM/Optimizer.cpp:582:49: No viable overloaded operator[] for type 'LoopClosing::KeyFrameAndPose' (aka 'map<ORB_SLAM::KeyFrame *, g2o::Sim3, std::less<KeyFrame *>, Eigen::aligned_allocator<std::pair<const KeyFrame *, g2o::Sim3> > >')

ORB_SLAM/Optimizer.cpp:648:33: No member named 'count' in 'std::__1::map<ORB_SLAM::KeyFrame *, g2o::Sim3, std::__1::less<ORB_SLAM::KeyFrame *>, Eigen::aligned_allocator<std::__1::pair<const ORB_SLAM::KeyFrame *, g2o::Sim3> > >'

ORB_SLAM/Optimizer.cpp:649:39: No viable overloaded operator[] for type 'LoopClosing::KeyFrameAndPose' (aka 'map<ORB_SLAM::KeyFrame *, g2o::Sim3, std::less<KeyFrame *>, Eigen::aligned_allocator<std::pair<const KeyFrame *, g2o::Sim3> > >')

SLAM/ORB_SLAM/Optimizer.cpp:662:37: No member named 'count' in 'std::__1::map<ORB_SLAM::KeyFrame *, g2o::Sim3, std::__1::less<ORB_SLAM::KeyFrame *>, Eigen::aligned_allocator<std::__1::pair<const ORB_SLAM::KeyFrame *, g2o::Sim3> > >'

SLAM/ORB_SLAM/Optimizer.cpp:663:43: No viable overloaded operator[] for type 'LoopClosing::KeyFrameAndPose' (aka 'map<ORB_SLAM::KeyFrame *, g2o::Sim3, std::less<KeyFrame *>, Eigen::aligned_allocator<std::pair<const KeyFrame *, g2o::Sim3> > >')

ORB_SLAM/Optimizer.cpp:686:41: No member named 'count' in 'std::__1::map<ORB_SLAM::KeyFrame *, g2o::Sim3, std::__1::less<ORB_SLAM::KeyFrame *>, Eigen::aligned_allocator<std::__1::pair<const ORB_SLAM::KeyFrame *, g2o::Sim3> > >'

SLAM/ORB_SLAM/Optimizer.cpp:687:47: No viable overloaded operator[] for type 'LoopClosing::KeyFrameAndPose' (aka 'map<ORB_SLAM::KeyFrame *, g2o::Sim3, std::less<KeyFrame *>, Eigen::aligned_allocator<std::pair<const KeyFrame *, g2o::Sim3> > >')

SLAM/ORB_SLAM/Optimizer.cpp:714:45: No member named 'count' in 'std::__1::map<ORB_SLAM::KeyFrame *, g2o::Sim3, std::__1::less<ORB_SLAM::KeyFrame *>, Eigen::aligned_allocator<std::__1::pair<const ORB_SLAM::KeyFrame *, g2o::Sim3> > >'

SLAM/ORB_SLAM/Optimizer.cpp:715:51: No viable overloaded operator[] for type 'LoopClosing::KeyFrameAndPose' (aka 'map<ORB_SLAM::KeyFrame *, g2o::Sim3, std::less<KeyFrame *>, Eigen::aligned_allocator<std::pair<const KeyFrame *, g2o::Sim3> > >')

@month612
Copy link

Same problem,Have you solved it?

@ftahir999
Copy link

@umutboz @month612 did you guys able to solve this compilation issue? Please share if you able to solve it

@ftahir999
Copy link

I am able run this project on older Xcode (8.2.1) and on OS High Sierra

@quimnuss
Copy link

quimnuss commented Sep 20, 2019

The correct way is to change LoopClosing.h map definition from

typedef map<KeyFrame*, g2o::Sim3, std::less<KeyFrame*>,
        Eigen::aligned_allocator<std::pair<const KeyFrame*, g2o::Sim3> > > KeyFrameAndPose;

to

typedef map<KeyFrame*, g2o::Sim3, std::less<KeyFrame*>,
        Eigen::aligned_allocator<std::pair<KeyFrame* const, g2o::Sim3> > > KeyFrameAndPose;

see

https://lists.freebsd.org/pipermail/freebsd-hackers/2016-June/049595.html

Patch:

diff --git a/include/LoopClosing.h b/include/LoopClosing.h
index 7eb0416..c3adf13 100644
--- a/include/LoopClosing.h
+++ b/include/LoopClosing.h
@@ -47,7 +47,7 @@ public:
 
     typedef pair<set<KeyFrame*>,int> ConsistentGroup;    
     typedef map<KeyFrame*,g2o::Sim3,std::less<KeyFrame*>,
-        Eigen::aligned_allocator<std::pair<const KeyFrame*, g2o::Sim3> > > KeyFrameAndPose;
+        Eigen::aligned_allocator<std::pair<KeyFrame* const, g2o::Sim3> > > KeyFrameAndPose;
 
 public:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants