@@ -40,7 +40,7 @@ MapUpdateModule::MapUpdateModule(
40
40
// From the second update, the update is done on secondary_ndt_ptr_,
41
41
// and ndt_ptr_ is only locked when swapping its pointer with
42
42
// secondary_ndt_ptr_.
43
- rebuild_ = true ;
43
+ need_rebuild_ = true ;
44
44
}
45
45
46
46
bool MapUpdateModule::should_update_map (const geometry_msgs::msg::Point & position)
@@ -56,7 +56,7 @@ bool MapUpdateModule::should_update_map(const geometry_msgs::msg::Point & positi
56
56
RCLCPP_ERROR_STREAM_THROTTLE (logger_, *clock_, 1000 , " Dynamic map loading is not keeping up." );
57
57
// If the map does not keep up with the current position,
58
58
// lock ndt_ptr_ entirely until it is fully rebuilt.
59
- rebuild_ = true ;
59
+ need_rebuild_ = true ;
60
60
}
61
61
62
62
return distance > param_.update_distance ;
@@ -95,7 +95,7 @@ void MapUpdateModule::update_map(const geometry_msgs::msg::Point & position)
95
95
{
96
96
// If the current position is super far from the previous loading position,
97
97
// lock and rebuild ndt_ptr_
98
- if (rebuild_ ) {
98
+ if (need_rebuild_ ) {
99
99
ndt_ptr_mutex_->lock ();
100
100
auto param = ndt_ptr_->getParams ();
101
101
@@ -105,7 +105,7 @@ void MapUpdateModule::update_map(const geometry_msgs::msg::Point & position)
105
105
106
106
prefetch_map (position, ndt_ptr_);
107
107
ndt_ptr_mutex_->unlock ();
108
- rebuild_ = false ;
108
+ need_rebuild_ = false ;
109
109
} else {
110
110
// Load map to the secondary_ndt_ptr, which does not require a mutex lock
111
111
// Since the update of the secondary ndt ptr and the NDT align (done on
@@ -172,8 +172,6 @@ void MapUpdateModule::update_ndt(
172
172
RCLCPP_INFO (logger_, " Time duration for creating new ndt_ptr: %lf [ms]" , exe_time);
173
173
}
174
174
175
- int count = 0 ;
176
-
177
175
void MapUpdateModule::publish_partial_pcd_map ()
178
176
{
179
177
pcl::PointCloud<PointTarget> map_pcl = ndt_ptr_->getVoxelPCD ();
0 commit comments