def build_experiments(self): """ Creates the whole set of experiment objects, The experiments created depend on the selected Town. """ # We set the RGB, seg cameras if self.rgb: camera = Camera('rgb') camera.set(FOV=100) camera.set_image_size(800, 600) camera.set_position(2.0, 0.0, 1.4) camera.set_rotation(-15.0, 0, 0) if self.seg: seg = Camera('seg', PostProcessing='SemanticSegmentation') seg.set(FOV=100) seg.set_image_size(800, 600) seg.set_position(2.0, 0.0, 1.4) seg.set_rotation(-15.0, 0, 0) poses_tasks = self._poses() vehicles_tasks = [20] pedestrians_tasks = [50] task_names = ['normal'] experiments_vector = [] for weather in self.weathers: for iteration in range(len(poses_tasks)): poses = poses_tasks[iteration] vehicles = vehicles_tasks[iteration] pedestrians = pedestrians_tasks[iteration] conditions = CarlaSettings() conditions.set( SendNonPlayerAgentsInfo=True, NumberOfVehicles=vehicles, NumberOfPedestrians=pedestrians, WeatherId=weather ) conditions.set(DisableTwoWheeledVehicles=True) # Add all the cameras that were set for this experiments if self.rgb: conditions.add_sensor(camera) if self.seg: conditions.add_sensor(seg) experiment = Experiment() experiment.set( Conditions=conditions, Poses=poses, Task=iteration, TaskName=task_names[iteration], Repetitions=1 ) experiments_vector.append(experiment) return experiments_vector
def build_experiments(self): """ Creates the whole set of experiment objects, The experiments created depend on the selected Town. """ # We set the camera # This single RGB camera is used on every experiment camera = Camera('rgb') camera.set(FOV=100) camera.set_image_size(800, 600) camera.set_position(2.0, 0.0, 1.4) camera.set_rotation(-15.0, 0, 0) poses_tasks = self._poses() vehicles_tasks = [0, 15, 70] pedestrians_tasks = [0, 50, 150] vehicles_tasks = [70] pedestrians_tasks = [150] task_names = ['empty', 'normal', 'cluttered'] task_names = ['cuttered'] experiments_vector = [] for weather in self.weathers: for iteration in range(len(poses_tasks)): poses = poses_tasks[iteration] vehicles = vehicles_tasks[iteration] pedestrians = pedestrians_tasks[iteration] conditions = CarlaSettings() conditions.set(SendNonPlayerAgentsInfo=True, NumberOfVehicles=vehicles, NumberOfPedestrians=pedestrians, WeatherId=weather) conditions.set(DisableTwoWheeledVehicles=True) # Add all the cameras that were set for this experiments conditions.add_sensor(camera) experiment = Experiment() experiment.set(Conditions=conditions, Poses=poses, Task=iteration, TaskName=task_names[iteration], Repetitions=1) experiments_vector.append(experiment) return experiments_vector