Skip to content

feat(dummy_traffic_light_publisher): add new node to publish traffic light message instead of Rviz#12456

Open
takam5f2 wants to merge 14 commits intoautowarefoundation:mainfrom
takam5f2:feat/add-dummy_traffic_light_publisher
Open

feat(dummy_traffic_light_publisher): add new node to publish traffic light message instead of Rviz#12456
takam5f2 wants to merge 14 commits intoautowarefoundation:mainfrom
takam5f2:feat/add-dummy_traffic_light_publisher

Conversation

@takam5f2
Copy link
Copy Markdown
Contributor

@takam5f2 takam5f2 commented Apr 9, 2026

Description

Add autoware_dummy_traffic_light_publisher — a dedicated simulator node that publishes dummy traffic light signals for Planning Simulator environments where the traffic light recognition pipeline is not available.

Background

In the current Planning Simulator workflow, traffic light signals are injected via the tier4_traffic_light_rviz_plugin (TrafficLightPublishPanel), which publishes directly to /perception/traffic_light_recognition/traffic_signals. This procedure is documented in the official Autoware documentation:

However, an RViz plugin — a GUI visualization tool — should not publish messages directly to topics that the autonomous driving system consumes as sensor/perception input. This creates an implicit and undesirable dependency between the visualization layer and the AD control logic.

rviz_plugin_before_after_v5

This PR introduces a simulator node (autoware_dummy_traffic_light_publisher) that sits between external inputs (e.g., the RViz plugin) and the AD system, so that the plugin no longer needs to publish directly to a perception topic.

Features

  • Standalone mode: Cycles all traffic lights through Green → Yellow → Red based on the vector map
  • Empty mode: Publishes empty TrafficLightGroupArray (no signal information)
  • Pass-through mode: Relays external input (e.g., from the RViz plugin) as-is; falls back to the configured mode after a timeout

Architecture

Layer Class Role
ROS I/O DummyTrafficLightPublisherNode Subscriptions (take()), timer, publisher, vector map parsing
Message assembly DummyTrafficLight Pass-through judgment, traffic light ID management, TrafficLightGroupArray construction
Signal generation TrafficLightCycle Phase transition and TrafficLightElement output

Related links

Parent Issue:

Relevant documentation (current behavior to be updated):

How was this PR tested?

  • Unit tests for TrafficLightCycle (14 tests) and DummyTrafficLight (14 tests) — all pass

  • Code coverage: traffic_light_cycle.cpp 100%, dummy_traffic_light.cpp 95% (uncovered lines are closing braces only)

  • Verified with Planning Simulator (standalone mode):

    Ego vehicle passes the intersection on green signal after stopping on red signal:

standalone_mode_running

Ego vehicle is not engaged and traffic lights state changes time by time.

standalone_mode_stop

Notes for reviewers

  • The node uses subscription->take() in the timer callback instead of subscription callbacks
  • Logic is fully separated from the ROS Node for testability — Node-level tests are intentionally omitted
  • autoware_launch integration (adding to simulator.launch.xml) and RViz plugin topic redirection will be handled in separate PRs

Interface changes

Topic changes

Additions and removals

Change type Topic Type Topic Name Message Type Description
Added Sub ~/input/vector_map autoware_map_msgs/msg/LaneletMapBin Lanelet2 map to extract traffic light IDs
Added Sub ~/input/traffic_signals autoware_perception_msgs/msg/TrafficLightGroupArray External signals for pass-through
Added Pub ~/output/traffic_signals autoware_perception_msgs/msg/TrafficLightGroupArray Generated or relayed traffic light signals

Modifications

None.

ROS Parameter Changes

Additions and removals

Change type Parameter Name Type Default Value Description
Added mode string "empty" Operating mode: "standalone" or "empty"
Added publish_rate double 10.0 Publishing frequency [Hz]
Added green_duration double 30.0 Green phase duration [s]
Added yellow_duration double 3.0 Yellow phase duration [s]
Added red_duration double 30.0 Red phase duration [s]
Added passthrough_timeout double 1.0 Timeout before fallback to configured mode [s]

Modifications

None.

Effects on system behavior

None. This is a new standalone package with no integration into existing launch files yet.

takam5f2 added 3 commits April 9, 2026 22:24
…simulator

Signed-off-by: Takayuki AKAMINE <takayuki.akamine@tier4.jp>
Signed-off-by: Takayuki AKAMINE <takayuki.akamine@tier4.jp>
…ation

Signed-off-by: Takayuki AKAMINE <takayuki.akamine@tier4.jp>
@github-actions github-actions Bot added type:documentation Creating or refining documentation. (auto-assigned) component:simulation Virtual environment setups and simulations. (auto-assigned) labels Apr 9, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 9, 2026

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

@takam5f2 takam5f2 added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Apr 9, 2026
@takam5f2 takam5f2 requested review from sasakisasaki and wep21 April 9, 2026 13:48
@takam5f2 takam5f2 changed the title feat(dummy_traffic_light_publisher): feat(dummy_traffic_light_publisher): add new node to publish traffic light message instead of Rviz Apr 9, 2026
takam5f2 and others added 8 commits April 9, 2026 22:54
Signed-off-by: Takayuki AKAMINE <takayuki.akamine@tier4.jp>
Signed-off-by: Takayuki AKAMINE <takayuki.akamine@tier4.jp>
Signed-off-by: Takayuki AKAMINE <takayuki.akamine@tier4.jp>
Signed-off-by: Takayuki AKAMINE <takayuki.akamine@tier4.jp>
Signed-off-by: Takayuki AKAMINE <takayuki.akamine@tier4.jp>
@takam5f2 takam5f2 marked this pull request as ready for review April 10, 2026 02:03
@takam5f2 takam5f2 self-assigned this Apr 13, 2026
@takam5f2
Copy link
Copy Markdown
Contributor Author

@sasakisasaki
I'd like you to check this PR rather than #12077. Best,

@takam5f2 takam5f2 requested a review from YoshiRi April 28, 2026 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:simulation Virtual environment setups and simulations. (auto-assigned) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) type:documentation Creating or refining documentation. (auto-assigned)

Projects

Status: To Triage

Development

Successfully merging this pull request may close these issues.

1 participant