Fix usdot-fhwa-stol/carma-platform#1703 #136
Merged
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.
PR Details
Description
This PR resolves usdot-fhwa-stol/carma-platform#1703 by ensuring that the global scoped topic object only gets created once during the startup interval loop used to check driver status. If the object already exists then the callback is removed such that a new subscription can be created.
An alternative approach might be to only call subscriber() once, but it was unclear to me if that call needed to be done every time such that the statup interval loop would ensure valid connection.
Solution was informed based on similar issues reported here RobotWebTools/roslibjs#343 and RobotWebTools/roslibjs#288
Related Issue
Fixes usdot-fhwa-stol/carma-platform#1703
Motivation and Context
UI does not get cluttered with duplicate alerts
How Has This Been Tested?
Successfully tested in silver lexus.
Types of changes
Checklist:
CARMA Contributing Guide