Skip to content

fix(autoware_carla_interface): publish every camera type, not only sensor.camera.rgb - #13409

Merged
hakuturu583 merged 1 commit into
autowarefoundation:mainfrom
ujinf74:fix/carla-camera-sensor-types
Oct 1, 2026
Merged

hakuturu583 merged 1 commit into
autowarefoundation:mainfrom
ujinf74:fix/carla-camera-sensor-types

Conversation

@ujinf74

@ujinf74 ujinf74 commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Description

The four places that decide what a camera is do not agree:

path test
spawn (SensorWrapper._configure_sensor_blueprint) startswith("sensor.camera")
publisher lookup (carla_ros2_interface._setup_publishers) startswith("sensor.camera")
publisher creation (ROSPublisherManager.create_publisher_for_sensor) == "sensor.camera.rgb"
publish dispatch (carla_ros2_interface._publish_sensor_data) == "sensor.camera.rgb"

So a mapping naming sensor.camera.depth or sensor.camera.semantic_segmentation spawns the sensor and attaches its callback, but gets Unknown sensor type: sensor.camera.depth instead of publishers, and every frame it produces then falls through the dispatch into a debug log. The sensor renders for the whole run and nothing is ever published.

These cameras deliver the same BGRA frame through the same callback as the RGB one and want the same image/camera_info pair, so this PR matches the prefix in the two places that did not.

Related links

Parent Issue:

  • None

How was this PR tested?

  • Run against a live CARLA 0.9.16 server with a mapping naming sensor.camera.depth: the bridge creates its image and camera_info publishers and the camera publishes (640x480 bgra8, 1,228,800 bytes per frame, 19.80 Hz against a 20 Hz throttle). On main the same mapping logs Unknown sensor type: sensor.camera.depth and publishes nothing.
  • pytest over test/: 14 passed (no test touches these paths; nothing regressed).
  • markdownlint, prettier, isort, black and flake8-ros pre-commit hooks pass on the changed files.
  • Not run against a live CARLA server on this branch.

Notes for reviewers

The shipped mappings only use sensor.camera.rgb, so nothing changes for them.

The pixel values of a depth or semantic camera are an encoding, not a color, and this PR publishes them untouched as bgra8 for a consumer to decode. Decoding them in the bridge would be a separate change.

@github-actions github-actions Bot added type:documentation Creating or refining documentation. (auto-assigned) component:simulation Virtual environment setups and simulations. (auto-assigned) labels Sep 18, 2026
@github-actions

Copy link
Copy Markdown

Thank you for contributing to the Autoware project!

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

Please ensure:

@hakuturu583

Copy link
Copy Markdown
Contributor

@ujinf74 Could you resolve conflicts?

…nsor.camera.rgb

The spawn path accepts any sensor.camera.* blueprint and the publisher
lookup matches the same prefix, but publisher creation and the publish
dispatch compared the type exactly against sensor.camera.rgb. A mapping
naming CARLA's depth or semantic segmentation camera therefore spawned
the sensor, got a "Unknown sensor type" warning instead of publishers,
and then dropped every frame it produced into a debug log.

These cameras deliver the same BGRA frame through the same callback and
want the same pair of image/camera_info publishers, so match the prefix
in both places, as the other two paths already do.

Claude-Session: https://claude.ai/code/session_011TMdPd8VUDxUrFtckxg2AQ
Signed-off-by: ujinf74 <ujin@tukorea.ac.kr>
@ujinf74
ujinf74 force-pushed the fix/carla-camera-sensor-types branch from 39a137b to 4611858 Compare September 25, 2026 11:52
@ujinf74

ujinf74 commented Sep 25, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto main (aad308b2), conflicts resolved — thanks for the ping.

Both conflicts came from #13407/#13408/#13411 landing in the same file:

No behavior change from the previous revision. Package tests pass (22) and pre-commit is clean.

@hakuturu583 hakuturu583 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@hakuturu583 hakuturu583 added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Oct 1, 2026
@hakuturu583
hakuturu583 enabled auto-merge (squash) October 1, 2026 04:08
@codecov

codecov Bot commented Oct 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 20.74%. Comparing base (aad308b) to head (4611858).
⚠️ Report is 15 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13409      +/-   ##
==========================================
- Coverage   20.74%   20.74%   -0.01%     
==========================================
  Files        2058     2058              
  Lines      143007   143007              
  Branches    52631    52631              
==========================================
- Hits        29662    29661       -1     
  Misses      89560    89560              
- Partials    23785    23786       +1     
Flag Coverage Δ *Carryforward flag
daily ?
full-suite 20.74% <ø> (ø) Carriedforward from aad308b

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hakuturu583
hakuturu583 merged commit 859fc2d into autowarefoundation:main Oct 1, 2026
41 of 44 checks passed
shmpwk pushed a commit to tier4/pilot_auto_simulation that referenced this pull request Oct 14, 2026
…nsor.camera.rgb (autowarefoundation/autoware_universe#13409)

The spawn path accepts any sensor.camera.* blueprint and the publisher
lookup matches the same prefix, but publisher creation and the publish
dispatch compared the type exactly against sensor.camera.rgb. A mapping
naming CARLA's depth or semantic segmentation camera therefore spawned
the sensor, got a "Unknown sensor type" warning instead of publishers,
and then dropped every frame it produced into a debug log.

These cameras deliver the same BGRA frame through the same callback and
want the same pair of image/camera_info publishers, so match the prefix
in both places, as the other two paths already do.

Claude-Session: https://claude.ai/code/session_011TMdPd8VUDxUrFtckxg2AQ

Signed-off-by: ujinf74 <ujin@tukorea.ac.kr>
@ujinf74
ujinf74 deleted the fix/carla-camera-sensor-types branch October 18, 2026 12:48
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

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants