Skip to content

Commit 53ca1ab

Browse files
removed all other changes
Signed-off-by: suifengersan123 <[email protected]>
1 parent 07c716c commit 53ca1ab

File tree

4 files changed

+4
-21
lines changed

4 files changed

+4
-21
lines changed

nav2_amcl/src/amcl_node.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -699,12 +699,7 @@ AmclNode::laserReceived(sensor_msgs::msg::LaserScan::ConstSharedPtr laser_scan)
699699
// If the robot has moved, update the filter
700700
if (lasers_update_[laser_index]) {
701701
updateFilter(laser_index, laser_scan, pose);
702-
if(resample_interval_ == 0){
703-
RCLCPP_WARN(
704-
get_logger(), "You've set resample_interval to be zero,"
705-
" this isn't allowed so it will be set to default value to 1.");
706-
resample_interval_ = 1;
707-
}
702+
708703
// Resample the particles
709704
if (!(++resample_count_ % resample_interval_)) {
710705
pf_update_resample(pf_);

nav2_costmap_2d/src/costmap_2d.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -350,15 +350,11 @@ bool Costmap2D::setConvexPolygonCost(
350350
convexFillCells(map_polygon, polygon_cells);
351351

352352
// set the cost of those cells
353-
bool cells_written = false;
354353
for (unsigned int i = 0; i < polygon_cells.size(); ++i) {
355354
unsigned int index = getIndex(polygon_cells[i].x, polygon_cells[i].y);
356-
if (index < size_x_ * size_y_) {
357-
costmap_[index] = cost_value;
358-
cells_written = true;
359-
}
355+
costmap_[index] = cost_value;
360356
}
361-
return cells_written;
357+
return true;
362358
}
363359

364360
void Costmap2D::polygonOutlineCells(

nav2_costmap_2d/src/costmap_layer.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,6 @@ void CostmapLayer::touch(
5656
void CostmapLayer::matchSize()
5757
{
5858
Costmap2D * master = layered_costmap_->getCostmap();
59-
if (!master) {
60-
RCLCPP_WARN(
61-
rclcpp::get_logger("nav2_costmap_2d"),
62-
"Cannot match size for layer, master costmap is not initialized yet.");
63-
return;
64-
}
6559
resizeMap(
6660
master->getSizeInCellsX(), master->getSizeInCellsY(), master->getResolution(),
6761
master->getOriginX(), master->getOriginY());

nav2_costmap_2d/src/layered_costmap.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,7 @@ void LayeredCostmap::resizeMap(
9696
for (vector<std::shared_ptr<Layer>>::iterator plugin = plugins_.begin();
9797
plugin != plugins_.end(); ++plugin)
9898
{
99-
if (*plugin) {
100-
(*plugin)->matchSize();
101-
}
99+
(*plugin)->matchSize();
102100
}
103101
}
104102

0 commit comments

Comments
 (0)