Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Patch for Ros bridge
diff --git a/carla_ros_bridge/src/carla_ros_bridge/bridge.py b/carla_ros_bridge/src/carla_ros_bridge/bridge.py
index 6a77453..0057229 100755
--- a/carla_ros_bridge/src/carla_ros_bridge/bridge.py
+++ b/carla_ros_bridge/src/carla_ros_bridge/bridge.py
@@ -367,8 +367,9 @@ class CarlaRosBridge(object):
elif carla_actor.type_id.startswith("sensor"):
if carla_actor.type_id.startswith("sensor.camera"):
if carla_actor.type_id.startswith("sensor.camera.rgb"):
+ if carla_actor.attributes["role_name"] == "noros": return None
actor = RgbCamera(
- carla_actor, parent, self.comm, self.carla_settings.synchronous_mode)
+ carla_actor, parent, self.comm, self.carla_settings.synchronous_mode)
elif carla_actor.type_id.startswith("sensor.camera.depth"):
actor = DepthCamera(
carla_actor, parent, self.comm, self.carla_settings.synchronous_mode)
diff --git a/carla_ros_bridge/src/carla_ros_bridge/sensor.py b/carla_ros_bridge/src/carla_ros_bridge/sensor.py
index 63270cc..ae754c8 100644
--- a/carla_ros_bridge/src/carla_ros_bridge/sensor.py
+++ b/carla_ros_bridge/src/carla_ros_bridge/sensor.py
@@ -99,7 +99,13 @@ class Sensor(Actor):
float(self.sensor_tick_time)
self.queue.put(carla_sensor_data)
else:
- self.publish_transform(self.get_ros_sensor_transform(carla_sensor_data.transform))
+ # Dont publish transform camera data
+ transform = self.get_ros_sensor_transform(carla_sensor_data.transform)
+ if "camera" not in transform.child_frame_id:
+ self.publish_transform(transform)
+
+ #self.publish_transform(self.get_ros_sensor_transform(carla_sensor_data.transform))
+
self.sensor_data_updated(carla_sensor_data)
@abstractmethod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment