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 invalid comparisions with string literals in RSS example #8117

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

Daraan
Copy link
Contributor

@Daraan Daraan commented Sep 9, 2024

Description

This PR addresses some string comparisons in the rss_visualization.py that are written like:
ad.rss.state.RssStateEvaluator.LongitudinalDistanceOppositeDirection == "LongitudinalDistanceOppositeDirection" which is always False as the enum is an int and has no support for string comparison.

In the example some arrows on the HUD were therefore always or never printed.


For verification try this statement which returns False but is intended to be True.

from carla import ad
print(ad.rss.state.RssStateEvaluator.LongitudinalDistanceOppositeDirection == "LongitudinalDistanceOppositeDirection")
# False

Where has this been tested?

  • Python version(s): Python 3.10

Possible Drawbacks


This change is Reviewable

@Daraan Daraan requested a review from a team as a code owner September 9, 2024 13:07
Copy link

update-docs bot commented Sep 9, 2024

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would update our CHANGELOG.md based on your changes.

@Daraan Daraan force-pushed the fixes/rss-wrong-rendering branch 2 times, most recently from 5f82dc4 to ccc4a08 Compare September 12, 2024 10:52
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.

1 participant