Skip to content

Commit 859fc2d

Browse files
authored
fix(autoware_carla_interface): publish every camera type, not only sensor.camera.rgb (#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>
1 parent 7e5be2a commit 859fc2d

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

‎simulator/autoware_carla_interface/README.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,11 @@ reads, so it costs no information at all. A 1600x900 frame is 5,760,000 bytes as
298298

299299
For CARLA sensor parameters, see [CARLA Sensor Reference](https://carla.readthedocs.io/en/latest/ref_sensors/).
300300

301+
A `carla_type` of any `sensor.camera.*` is published as a camera: CARLA's depth
302+
and semantic segmentation cameras deliver the same BGRA frame through the same
303+
callback as the RGB one, and are published on the mapping's `topic_image` and
304+
`topic_info` with the encoded values untouched.
305+
301306
##### Capture Rate
302307

303308
`frequency_hz` throttles what the bridge publishes; it does not change how often

‎simulator/autoware_carla_interface/src/autoware_carla_interface/carla_ros.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1659,7 +1659,7 @@ def _publish_sensor_data(self, key, measurement, timestamp):
16591659
)
16601660
return
16611661

1662-
if sensor_type == "sensor.camera.rgb":
1662+
if sensor_type.startswith("sensor.camera"):
16631663
if not self.checkFrequency(key, timestamp):
16641664
self.sensor_registry.update_sensor_timestamp(key, timestamp)
16651665
self._submit_to_publish_worker(key, self.camera, measurement, key, timestamp)

‎simulator/autoware_carla_interface/src/autoware_carla_interface/modules/ros_publisher_manager.py‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,12 @@ def create_publisher_for_sensor(self, sensor_config: SensorConfig) -> bool:
124124
try:
125125
sensor_type = sensor_config.carla_type
126126

127-
if sensor_type == "sensor.camera.rgb":
127+
# Any camera, not only the rgb one. CARLA's depth and semantic
128+
# segmentation cameras deliver the same BGRA frame through the same
129+
# callback and want the same pair of publishers. Matching the type
130+
# exactly meant a mapping could name one, have it spawned, and then
131+
# lose every frame it produced with only a warning to say so.
132+
if sensor_type.startswith("sensor.camera"):
128133
return self._create_camera_publishers(sensor_config)
129134
elif sensor_type == "sensor.lidar.ray_cast":
130135
return self._create_lidar_publisher(sensor_config)

0 commit comments

Comments
 (0)