Skip to content

Commit ba24c05

Browse files
committed
Removing test code
Signed-off-by: anhnv3991 <anh.nguyen.2@tier4.jp>
1 parent 1e4a785 commit ba24c05

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

localization/ndt_scan_matcher/src/map_update_module.cpp

+13-13
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#define timeDiff(start, end) ((end.tv_sec - start.tv_sec) * 1000000 + end.tv_usec - start.tv_usec)
1919
#endif
2020

21-
// #define DEBUG_FLAG
21+
#define DEBUG_FLAG
2222

2323
MapUpdateModule::MapUpdateModule(
2424
rclcpp::Node * node, std::mutex * ndt_ptr_mutex,
@@ -135,23 +135,23 @@ void MapUpdateModule::prefetch_map(const geometry_msgs::msg::Point& position, Nd
135135
#ifdef DEBUG_FLAG
136136
// If the current position is super far from the previous loading position,
137137
// lock and rebuild ndt_ptr_
138-
// if (rebuild_)
139-
// {
140-
// ndt_ptr_mutex_->lock();
141-
// prefetch_map(position, ndt_ptr_);
142-
// ndt_ptr_mutex_->unlock();
143-
// rebuild_ = false;
144-
// }
145-
// else
146-
// {
138+
if (rebuild_)
139+
{
140+
ndt_ptr_mutex_->lock();
141+
prefetch_map(position, ndt_ptr_);
142+
ndt_ptr_mutex_->unlock();
143+
rebuild_ = false;
144+
}
145+
else
146+
{
147147
// Load map to the secondary_ndt_ptr, which does not require a mutex lock
148148
// Since the update of the secondary ndt ptr and the NDT align (done on
149149
// the main ndt_ptr_) overlap, the latency of updating/alignment reduces partly.
150150
// If the updating is done the main ndt_ptr_, either the update or the NDT
151151
// align will be blocked by the other.
152-
// ndt_ptr_mutex_->lock();
153-
// prefetch_map(position, ndt_ptr_);
154-
// ndt_ptr_mutex_->unlock();
152+
prefetch_map(position, secondary_ndt_ptr_);
153+
154+
auto tmp = ndt_ptr_;
155155

156156
// // Now lock and update the main ndt_ptr_ by the secondary_ndt_ptr_
157157
// ndt_ptr_mutex_->lock();

0 commit comments

Comments
 (0)