Occupancy grid graph changed detection: Quiet warning when map is empty

This commit is contained in:
matlabbe
2017-04-22 19:29:13 -04:00
parent af576ea0c4
commit a0a7237c01
2 changed files with 2 additions and 2 deletions

View File

@@ -424,7 +424,7 @@ void OccupancyGrid::update(const std::map<int, Transform> & posesIn)
// First, check of the graph has changed. If so, re-create the map by moving all occupied nodes (fullUpdate==false). // First, check of the graph has changed. If so, re-create the map by moving all occupied nodes (fullUpdate==false).
bool graphOptimized = false; // If a loop closure happened (e.g., poses are modified) bool graphOptimized = false; // If a loop closure happened (e.g., poses are modified)
bool graphChanged = true; // If the new map doesn't have any node from the previous map bool graphChanged = addedNodes_.size()>0; // If the new map doesn't have any node from the previous map
std::map<int, Transform> transforms; std::map<int, Transform> transforms;
for(std::map<int, Transform>::iterator iter=addedNodes_.begin(); iter!=addedNodes_.end(); ++iter) for(std::map<int, Transform>::iterator iter=addedNodes_.begin(); iter!=addedNodes_.end(); ++iter)
{ {

View File

@@ -89,7 +89,7 @@ void OctoMap::update(const std::map<int, Transform> & poses)
// First, check of the graph has changed. If so, re-create the octree by moving all occupied nodes. // First, check of the graph has changed. If so, re-create the octree by moving all occupied nodes.
bool graphOptimized = false; // If a loop closure happened (e.g., poses are modified) bool graphOptimized = false; // If a loop closure happened (e.g., poses are modified)
bool graphChanged = true; // If the new map doesn't have any node from the previous map bool graphChanged = addedNodes_.size()>0; // If the new map doesn't have any node from the previous map
std::map<int, Transform> transforms; std::map<int, Transform> transforms;
std::map<int, Transform> updatedAddedNodes; std::map<int, Transform> updatedAddedNodes;
for(std::map<int, Transform>::iterator iter=addedNodes_.begin(); iter!=addedNodes_.end(); ++iter) for(std::map<int, Transform>::iterator iter=addedNodes_.begin(); iter!=addedNodes_.end(); ++iter)