Skip to content

Fix LaserScan reset not invalidating the time_tolerance_#1700

Open
Hugal31 wants to merge 1 commit into
ros2:rollingfrom
Hugal31:fix/laser-scan-tolerance-reset
Open

Fix LaserScan reset not invalidating the time_tolerance_#1700
Hugal31 wants to merge 1 commit into
ros2:rollingfrom
Hugal31:fix/laser-scan-tolerance-reset

Conversation

@Hugal31

@Hugal31 Hugal31 commented Apr 8, 2026

Copy link
Copy Markdown

Description

Fix the LaserScanDisplay not working after a reset (disable-enable, change topic, etc...).

In order to transform a LaserScan, the LaserScanDisplay tf_filter is configured with a time tolerance in order to call processMessage only if the transform is known for the beginning and the end of the scan.

LaserScanDisplay only wants to increase the tolerance, and because tf2_ros::MessageFilter doesn't have a getTolerance() accessor, LaserScanDisplay stores it locally to only update it when the required tolerance is greater than the configured one:

if (tolerance > filter_tolerance_) {
filter_tolerance_ = tolerance;
tf_filter_->setTolerance(filter_tolerance_);
checkTolerance(filter_tolerance_);
}

However, when re-subscribing, MessageFilterDisplay resets the tf filter, thus setting its time_tolerance back to 0. This is not caught in LaserScanFilter, which never updates the tolerance on the new filter again.

This fix sets the cached copy filter_tolerance_ back to 0. after subscribing.

Is this user-facing behavior change?

This doesn't introduce unwanted behavior, it is only a fix.

Did you use Generative AI?

Only 100% human brain juice was used.

Additional Information

A back-port down to jazzy would be great.

@mergify

mergify Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@Hugal31
Hugal31 force-pushed the fix/laser-scan-tolerance-reset branch from c930a57 to 47ca6c7 Compare June 22, 2026 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants