diff --git a/carla_ros_bridge/src/carla_ros_bridge/pseudo_actor.py b/carla_ros_bridge/src/carla_ros_bridge/pseudo_actor.py index 6cdfa0f9..7a70f13a 100644 --- a/carla_ros_bridge/src/carla_ros_bridge/pseudo_actor.py +++ b/carla_ros_bridge/src/carla_ros_bridge/pseudo_actor.py @@ -87,10 +87,10 @@ def get_prefix(self): :return: prefix :rtype: string """ - if self.parent is not None: - return self.parent.get_prefix() + "/" + self.name - else: - return self.name + class_name = self.__class__.__name__ + prefix = "" if self.parent is None else self.parent.get_prefix() + "/" + prefix += "{}{}/{}".format(prefix, class_name, self.name) + return prefix def get_topic_prefix(self): """