jedeschaud / kitti_carla_simulator

KITTI-CARLA: Python scripts to generate the KITTI-CARLA dataset
MIT License
65 stars 12 forks source link

Code improvement #4

Open RaviBeagle opened 2 years ago

RaviBeagle commented 2 years ago

The self.set_attributes is a method in the sub-class. Is this a good design ? Perhaps the super class should only do a basic setup and actual setup should be sub-classes ?


class Sensor:
    initial_ts = 0.0
    initial_loc = carla.Location()
    initial_rot = carla.Rotation()

    def __init__(self, vehicle, world, actor_list, output_folder, transform):
        self.queue = queue.Queue()
        self.bp = self.set_attributes(world.get_blueprint_library())