Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix usdot-fhwa-stol/carma-platform#1703 #136

Merged
merged 2 commits into from
Apr 6, 2022

Conversation

msmcconnell
Copy link
Contributor

@msmcconnell msmcconnell commented Apr 5, 2022

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

  • Defect fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that cause existing functionality to change)

Checklist:

  • I have added any new packages to the sonar-scanner.properties file
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
    CARMA Contributing Guide
  • I have added tests to cover my changes.
  • All new and existing tests passed.

console.log("system alert type" + message.type);
switch (message.type)
// Initialize a topic object
listenerSystemAlert = new ROSLIB.Topic({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type check after definition?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not quite following what you are asking here.
What are you asking to type check?

@dan-du-car dan-du-car merged commit 0ea6058 into release/jetta-gillet Apr 6, 2022
@dan-du-car dan-du-car deleted the fix/duplicate_alerts branch April 6, 2022 14:49
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