@@ -242,11 +242,11 @@ void BaseAssembler<T>::msgCallback(const boost::shared_ptr<const T>& scan_ptr)
242
242
scan_hist_mutex_.lock () ;
243
243
if (scan_hist_.size () == max_scans_) // Is our deque full?
244
244
{
245
- total_pts_ -= scan_hist_.front ().get_points_size () ; // We're removing an elem, so this reduces our total point count
245
+ total_pts_ -= scan_hist_.front ().points . size () ; // We're removing an elem, so this reduces our total point count
246
246
scan_hist_.pop_front () ; // The front of the deque has the oldest elem, so we can get rid of it
247
247
}
248
248
scan_hist_.push_back (cur_cloud) ; // Add the newest scan to the back of the deque
249
- total_pts_ += cur_cloud.get_points_size () ; // Add the new scan to the running total of points
249
+ total_pts_ += cur_cloud.points . size () ; // Add the new scan to the running total of points
250
250
251
251
// printf("Scans: %4u Points: %10u\n", scan_hist_.size(), total_pts_) ;
252
252
@@ -284,7 +284,7 @@ bool BaseAssembler<T>::assembleScans(AssembleScans::Request& req, AssembleScans:
284
284
while ( i < scan_hist_.size () && // Don't go past end of deque
285
285
scan_hist_[i].header .stamp < req.end ) // Don't go past the end-time of the request
286
286
{
287
- req_pts += (scan_hist_[i].get_points_size ()+downsample_factor_-1 )/downsample_factor_ ;
287
+ req_pts += (scan_hist_[i].points . size ()+downsample_factor_-1 )/downsample_factor_ ;
288
288
i += downsample_factor_ ;
289
289
}
290
290
unsigned int past_end_index = i ;
@@ -293,20 +293,20 @@ bool BaseAssembler<T>::assembleScans(AssembleScans::Request& req, AssembleScans:
293
293
{
294
294
resp.cloud .header .frame_id = fixed_frame_ ;
295
295
resp.cloud .header .stamp = req.end ;
296
- resp.cloud .set_points_size (0 ) ;
297
- resp.cloud .set_channels_size (0 ) ;
296
+ resp.cloud .points . resize (0 ) ;
297
+ resp.cloud .channels . resize (0 ) ;
298
298
}
299
299
else
300
300
{
301
301
// Note: We are assuming that channel information is consistent across multiple scans. If not, then bad things (segfaulting) will happen
302
302
// Allocate space for the cloud
303
- resp.cloud .set_points_size ( req_pts ) ;
304
- const unsigned int num_channels = scan_hist_[start_index].get_channels_size () ;
305
- resp.cloud .set_channels_size (num_channels) ;
303
+ resp.cloud .points . resize ( req_pts) ;
304
+ const unsigned int num_channels = scan_hist_[start_index].channels . size () ;
305
+ resp.cloud .channels . resize (num_channels) ;
306
306
for (i = 0 ; i<num_channels; i++)
307
307
{
308
308
resp.cloud .channels [i].name = scan_hist_[start_index].channels [i].name ;
309
- resp.cloud .channels [i].set_values_size (req_pts) ;
309
+ resp.cloud .channels [i].values . resize (req_pts) ;
310
310
}
311
311
// resp.cloud.header.stamp = req.end ;
312
312
resp.cloud .header .frame_id = fixed_frame_ ;
@@ -317,11 +317,11 @@ bool BaseAssembler<T>::assembleScans(AssembleScans::Request& req, AssembleScans:
317
317
// Sanity check: Each channel should be the same length as the points vector
318
318
for (unsigned int chan_ind = 0 ; chan_ind < scan_hist_[i].channels .size (); chan_ind++)
319
319
{
320
- if (scan_hist_[i].get_points_size () != scan_hist_[i].channels [chan_ind].values .size ())
321
- ROS_FATAL (" Trying to add a malformed point cloud. Cloud has %u points, but channel %u has %u elems" , scan_hist_[i].get_points_size (), chan_ind, scan_hist_[i].channels [chan_ind].get_values_size ());
320
+ if (scan_hist_[i].points . size () != scan_hist_[i].channels [chan_ind].values .size ())
321
+ ROS_FATAL (" Trying to add a malformed point cloud. Cloud has %u points, but channel %u has %u elems" , ( int ) scan_hist_[i].points . size (), chan_ind, ( int ) scan_hist_[i].channels [chan_ind].values . size ());
322
322
}
323
323
324
- for (unsigned int j=0 ; j<scan_hist_[i].get_points_size (); j+=downsample_factor_)
324
+ for (unsigned int j=0 ; j<scan_hist_[i].points . size (); j+=downsample_factor_)
325
325
{
326
326
resp.cloud .points [cloud_count].x = scan_hist_[i].points [j].x ;
327
327
resp.cloud .points [cloud_count].y = scan_hist_[i].points [j].y ;
@@ -337,7 +337,7 @@ bool BaseAssembler<T>::assembleScans(AssembleScans::Request& req, AssembleScans:
337
337
}
338
338
scan_hist_mutex_.unlock () ;
339
339
340
- ROS_DEBUG (" Point Cloud Results: Aggregated from index %u->%u. BufferSize: %lu. Points in cloud: %u" , start_index, past_end_index, scan_hist_.size (), resp.cloud .get_points_size ()) ;
340
+ ROS_DEBUG (" Point Cloud Results: Aggregated from index %u->%u. BufferSize: %lu. Points in cloud: %u" , start_index, past_end_index, scan_hist_.size (), ( int ) resp.cloud .points . size ()) ;
341
341
return true ;
342
342
}
343
343
0 commit comments