Mac: fixed crash when discarding a signature (not moving enough) with self refenced links. Fixed link error with realsense2 library on Mac.

This commit is contained in:
matlabbe
2020-07-02 12:54:43 -04:00
parent cd10cafd0e
commit 33e9abdfad
3 changed files with 12 additions and 5 deletions
+1 -1
View File
@@ -471,7 +471,7 @@ ENDIF(WITH_REALSENSE)
IF(WITH_REALSENSE2) IF(WITH_REALSENSE2)
IF(WIN32) IF(WIN32)
FIND_PACKAGE(RealSense2 QUIET) FIND_PACKAGE(RealSense2 QUIET)
ELSE() ELSE()
FIND_PACKAGE(realsense2 QUIET) FIND_PACKAGE(realsense2 QUIET)
ENDIF() ENDIF()
IF(realsense2_FOUND) IF(realsense2_FOUND)
+5
View File
@@ -293,6 +293,11 @@ IF(realsense2_FOUND)
${LIBRARIES} ${LIBRARIES}
${RealSense2_LIBRARIES} ${RealSense2_LIBRARIES}
) )
ELSEIF(APPLE)
SET(LIBRARIES
${LIBRARIES}
${realsense2_LIBRARIES}
)
ELSE() ELSE()
SET(LIBRARIES SET(LIBRARIES
${LIBRARIES} ${LIBRARIES}
+6 -4
View File
@@ -3475,11 +3475,13 @@ bool Rtabmap::process(
_optimizedPoses.erase(lastId); _optimizedPoses.erase(lastId);
for(std::multimap<int, Link>::iterator iter=_constraints.find(lastId); iter!=_constraints.end() && iter->first==lastId;++iter) for(std::multimap<int, Link>::iterator iter=_constraints.find(lastId); iter!=_constraints.end() && iter->first==lastId;++iter)
{ {
iter->second.to(); if(iter->second.to() != iter->second.from())
std::multimap<int, Link>::iterator jter = graph::findLink(_constraints, iter->second.to(), iter->second.from(), false);
if(jter != _constraints.end())
{ {
_constraints.erase(jter); std::multimap<int, Link>::iterator jter = graph::findLink(_constraints, iter->second.to(), iter->second.from(), false);
if(jter != _constraints.end())
{
_constraints.erase(jter);
}
} }
} }
_constraints.erase(lastId); _constraints.erase(lastId);