Skip to content

Commit

Permalink
Fix logic
Browse files Browse the repository at this point in the history
  • Loading branch information
at-wat committed Dec 24, 2024
1 parent 0781f10 commit 8e9e3e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,9 @@ class Costmap3dUpdateLayerOutput
update_msg->yaw = region_merged.yaw_;
update_msg->angle = region_merged.angle_;

if (update_msg->width_ * update_msg->height_ == 0)
if (region.width_ == 0 || region.height_ == 0)
{
update_msg->width = update_msg->height = 0;
return update_msg;
}

Expand Down
6 changes: 4 additions & 2 deletions costmap_cspace/src/costmap_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,11 @@ class Costmap3DOFNode
{
publishDebug(*map);
pub_costmap_update_.publish(*update);
if (update->width * update->height == 0)
if (update->width * update->height * update->angle == 0)
{
ROS_WARN_THROTTLE(5, "Updated region of the costmap is empty. The position may be out-of-boundary, or input map is wrong.");
ROS_WARN_THROTTLE(
5, "Updated region of the costmap is empty. "
"The position may be out-of-boundary, or input map is wrong.");
}
}
else
Expand Down

0 comments on commit 8e9e3e1

Please sign in to comment.