Skip to content

Commit d899c63

Browse files
authored
Fix "enable" parameter for observation sources (SteveMacenski#252)
* Fix enable parameter for observation sources * new line * Revert "new line" This reverts commit 6690306. * Revert "Fix enable parameter for observation sources" This reverts commit c910de8. * Check if enabled on callback
1 parent 617f696 commit d899c63

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/spatio_temporal_voxel_layer.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,9 @@ void SpatioTemporalVoxelLayer::LaserScanCallback(
365365
const std::shared_ptr<buffer::MeasurementBuffer> & buffer)
366366
/*****************************************************************************/
367367
{
368+
if (!buffer->IsEnabled()) {
369+
return;
370+
}
368371
// laser scan where infinity is invalid callback function
369372
sensor_msgs::msg::PointCloud2 cloud;
370373
cloud.header = message->header;
@@ -390,6 +393,9 @@ void SpatioTemporalVoxelLayer::LaserScanValidInfCallback(
390393
const std::shared_ptr<buffer::MeasurementBuffer> & buffer)
391394
/*****************************************************************************/
392395
{
396+
if (!buffer->IsEnabled()) {
397+
return;
398+
}
393399
// Filter infinity to max_range
394400
float epsilon = 0.0001;
395401
sensor_msgs::msg::LaserScan message = *raw_message;
@@ -423,6 +429,9 @@ void SpatioTemporalVoxelLayer::PointCloud2Callback(
423429
const std::shared_ptr<buffer::MeasurementBuffer> & buffer)
424430
/*****************************************************************************/
425431
{
432+
if (!buffer->IsEnabled()) {
433+
return;
434+
}
426435
// buffer the point cloud
427436
buffer->Lock();
428437
buffer->BufferROSCloud(*message);

0 commit comments

Comments
 (0)