Error counts continuously being reset#5
Open
richardw347 wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello,
We've been using the urg_node2 on our robots with the UAM-05LP scanner. Our robots are using ROS Humble. The problem we experienced was when the laser was disconnected/powered down temporarily. The driver gets stuck in a loop where the error_count_ never reaches the error_limit_ because when an error occurs the driver is updating the diagnostic status:
urg_node2/src/urg_node2.cpp
Lines 498 to 505 in 6632d1c
Which can take ~1-2 seconds each time. This is causing the error_counts to be reset before they reach the limit because of this block:
urg_node2/src/urg_node2.cpp
Lines 517 to 522 in 6632d1c
Semantically the purpose of the above block seems to be to reset the error counts if we haven't seen an error in a while but what's actually happening is the error counts are always being reset after the error_reset_period.
See the log from below (with an added log statement every time the error counts are reset).

This PR moves the setting of prev_time to error block. This fixes the error reset count loop and has been tested with our UAM's and works well. I've added it to the multi-echo branch but don't have a multi-echo scanner to test, given they are identical blocks it should work the same.