Skip to content

Commit

Permalink
[RSDK-2560] Don't update map in localization mode (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmhilly authored Apr 19, 2023
1 parent 65b80c4 commit 82c6dd7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion viam-cartographer/src/slam_service/slam_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ ::grpc::Status SLAMServiceImpl::GetPointCloudMap(
try {
std::shared_lock optimization_lock{optimization_shared_mutex,
std::defer_lock};
if (optimization_lock.try_lock()) {
if (action_mode != ActionMode::LOCALIZING &&
optimization_lock.try_lock()) {
// We are able to lock the optimization_shared_mutex, which means
// that the optimization is not ongoing and we can grab the newest
// map
Expand Down

0 comments on commit 82c6dd7

Please sign in to comment.