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

Traffic Light Indicator Weird Behavior #6880

Closed
3 tasks done
KhalilSelyan opened this issue Apr 24, 2024 · 5 comments · Fixed by #6899
Closed
3 tasks done

Traffic Light Indicator Weird Behavior #6880

KhalilSelyan opened this issue Apr 24, 2024 · 5 comments · Fixed by #6899
Assignees
Labels
type:bug Software flaws or errors. type:ui-ux User interface, user experience, graphical user interfaces.

Comments

@KhalilSelyan
Copy link
Contributor

KhalilSelyan commented Apr 24, 2024

Checklist

  • I've read the contribution guidelines.
  • I've searched other issues and no duplicate issues were found.
  • I'm convinced that this is not my fault but a bug.

Description

Traffic Light Indicator in the Rviz2 Overlay, flickers between indicators (green/red/yellow) because of sensor messages received ? planning seems to be doing the correct thing and following the indicator it should but not the indicator in the UI

Video

Watch the video

Expected behavior

No flickering, just stable light indicator according to which one the planning is following

Actual behavior

Signals received alternate between colors depending on which signal is first on the array of signals received in the message from the topic being subscribed to

Steps to reproduce

  1. Launch Autoware and AWSIM
  2. Drive by a few traffic lights

Versions

  • OS : Ubuntu 22.04
  • ROS: Humble

Possible causes

The way the UI Indicator subscribes/displays the data is not the same as how the planning is being handled most likely

Additional context

  • The code related to the drawing of the traffic display in the overlay
    if (!current_traffic_.signals.empty()) {
    switch (current_traffic_.signals[0].elements[0].color) {
    case 1:
    painter.setBrush(QBrush(tl_red_));
    painter.drawEllipse(circleRect);
    break;
    case 2:
    painter.setBrush(QBrush(tl_yellow_));
    painter.drawEllipse(circleRect);
    break;
    case 3:
    painter.setBrush(QBrush(tl_green_));
    painter.drawEllipse(circleRect);
    break;
    case 4:
    painter.setBrush(tl_gray_);
    painter.drawEllipse(circleRect);
    break;
    default:
    painter.setBrush(tl_gray_);
    painter.drawEllipse(circleRect);
    break;
    }
    }
@KhalilSelyan KhalilSelyan added the type:ui-ux User interface, user experience, graphical user interfaces. label Apr 24, 2024
@KhalilSelyan KhalilSelyan self-assigned this Apr 24, 2024
@KhalilSelyan
Copy link
Contributor Author

Ping: @xmfcx @miura @takayuki5168

@xmfcx xmfcx added the type:bug Software flaws or errors. label Apr 24, 2024
@maxime-clem
Copy link
Contributor

I think we need to do the following:

  • use the traffic_signal_id in the TrafficSignal messages to get the corresponding traffic lights in the map.
  • calculate the traffic light longitudinal positions on the ego path.
  • select the traffic light with the smallest longitudinal position (but ahead of the ego position).

Doing this requires adding many dependencies and topics to the rviz panel. If that's okay then I can implement it.

@xmfcx
Copy link
Contributor

xmfcx commented Apr 25, 2024

@maxime-clem what about publishing this from where the planning code already does this as a debug message?

@maxime-clem
Copy link
Contributor

@maxime-clem what about publishing this from where the planning code already does this as a debug message?

It may be better yes. I will try that first.

@maxime-clem
Copy link
Contributor

@KhalilSelyan I opened a PR with the change: #6899
I cannot easily test it at the moment so please confirm if it fixes the chattering issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Software flaws or errors. type:ui-ux User interface, user experience, graphical user interfaces.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants