Fix bug in navigation, erroneous index

This commit is contained in:
bernatx 2019-10-22 15:46:25 +02:00 committed by bernat
parent b6cfcbe92c
commit f66593427b
1 changed files with 31 additions and 31 deletions

View File

@ -684,7 +684,7 @@ namespace nav {
std::lock_guard<std::mutex> lock(_mutex);
_crowd->removeAgent(it->second);
}
_walkerManager.RemoveWalker(it->second);
_walkerManager.RemoveWalker(id);
logging::log("Nav: removing walker agent", id);
// remove from mapping
_mappedWalkersId.erase(it);
@ -914,7 +914,7 @@ namespace nav {
// set a new random target
carla::geom::Location location;
GetRandomLocation(location, 1, nullptr);
_walkerManager.SetWalkerRoute(i, location);
_walkerManager.SetWalkerRoute(_mappedByIndex[i], location);
}
}
}