Skip to content

Commit 33e9abd

Browse files
committed
Mac: fixed crash when discarding a signature (not moving enough) with self refenced links. Fixed link error with realsense2 library on Mac.
1 parent cd10caf commit 33e9abd

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ ENDIF(WITH_REALSENSE)
471471
IF(WITH_REALSENSE2)
472472
IF(WIN32)
473473
FIND_PACKAGE(RealSense2 QUIET)
474-
ELSE()
474+
ELSE()
475475
FIND_PACKAGE(realsense2 QUIET)
476476
ENDIF()
477477
IF(realsense2_FOUND)

corelib/src/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,11 @@ IF(realsense2_FOUND)
293293
${LIBRARIES}
294294
${RealSense2_LIBRARIES}
295295
)
296+
ELSEIF(APPLE)
297+
SET(LIBRARIES
298+
${LIBRARIES}
299+
${realsense2_LIBRARIES}
300+
)
296301
ELSE()
297302
SET(LIBRARIES
298303
${LIBRARIES}

corelib/src/Rtabmap.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3475,11 +3475,13 @@ bool Rtabmap::process(
34753475
_optimizedPoses.erase(lastId);
34763476
for(std::multimap<int, Link>::iterator iter=_constraints.find(lastId); iter!=_constraints.end() && iter->first==lastId;++iter)
34773477
{
3478-
iter->second.to();
3479-
std::multimap<int, Link>::iterator jter = graph::findLink(_constraints, iter->second.to(), iter->second.from(), false);
3480-
if(jter != _constraints.end())
3478+
if(iter->second.to() != iter->second.from())
34813479
{
3482-
_constraints.erase(jter);
3480+
std::multimap<int, Link>::iterator jter = graph::findLink(_constraints, iter->second.to(), iter->second.from(), false);
3481+
if(jter != _constraints.end())
3482+
{
3483+
_constraints.erase(jter);
3484+
}
34833485
}
34843486
}
34853487
_constraints.erase(lastId);

0 commit comments

Comments
 (0)