Skip to content

Commit

Permalink
costmap_cspace: always store received overlay map (#109)
Browse files Browse the repository at this point in the history
If an overlay map arrives before a root map, overlay map was ignored
since frame_id of the root map is not yet given.
The commit enables to store overlay map and keep until receiving
the root map.
  • Loading branch information
at-wat authored Jan 25, 2018
1 parent 08fb8b9 commit 44c6626
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
11 changes: 10 additions & 1 deletion costmap_cspace/include/costmap_3d_layer/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,16 @@ class Costmap3dLayerBase

*map_overlay_ = *map_;
if (map_updated_.info.width > 0 && map_updated_.info.height > 0)
updateCSpace(map_updated_);
{
if (map_->header.frame_id == map_updated_.header.frame_id)
{
updateCSpace(map_updated_);
}
else
{
ROS_ERROR("map and map_overlay must have same frame_id. skipping");
}
}

if (updateChain())
return true;
Expand Down
5 changes: 0 additions & 5 deletions costmap_cspace/src/costmap_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,6 @@ class Costmap3DOFNode
ROS_DEBUG("Overlay 2D costmap received");

auto map_msg = map->getMap();
if (map_msg->header.frame_id != msg->header.frame_id)
{
ROS_ERROR("map and map_overlay must have same frame_id");
return;
}
if (map_msg->info.width < 1 ||
map_msg->info.height < 1)
return;
Expand Down

0 comments on commit 44c6626

Please sign in to comment.