コード例 #1
0
ファイル: radar_operator.py プロジェクト: bsaghafi/erdos
 def __init__(self, name, buffer_logs=False):
     super(RadarOperator, self).__init__(name, buffer_logs)
     self._logger = setup_logging(self.name, 'pylot.log')
     self._cnt = 0
コード例 #2
0
 def __init__(self, name, flags, log_file_name=None):
     super(DepthCameraVisualizer, self).__init__(name)
     self._logger = setup_logging(self.name, log_file_name)
     self._flags = flags
コード例 #3
0
 def __init__(self, name, flags, log_file_name=None):
     super(SegmentedTopDownVideoOperator, self).__init__(name)
     self._logger = setup_logging(self.name, log_file_name)
     self._flags = flags
コード例 #4
0
 def __init__(self, name, log_file_name=None):
     super(Sink, self).__init__(name)
     self._logger = setup_logging(self.name, log_file_name)
     self.last_received_num = None
コード例 #5
0
    def __init__(self,
                 name,
                 auto_pilot,
                 flags,
                 log_file_name=None,
                 csv_file_name=None):
        """ Initializes the CarlaOperator with the given name.

        Args:
            name: The unique name of the operator.
            auto_pilot: True to enable auto_pilot for ego vehicle.
            flags: A handle to the global flags instance to retrieve the
                configuration.
            log_file_name: The file to log the required information to.
            csv_file_name: The file to log info to in csv format.
        """
        super(CarlaOperator, self).__init__(name)
        self._flags = flags
        self._logger = setup_logging(self.name, log_file_name)
        self._csv_logger = setup_csv_logging(self.name + '-csv', csv_file_name)
        self._auto_pilot = auto_pilot
        # Connect to CARLA and retrieve the world running.
        self._client, self._world = get_world(self._flags.carla_host,
                                              self._flags.carla_port,
                                              self._flags.carla_timeout)
        if self._client is None or self._world is None:
            raise ValueError('There was an issue connecting to the simulator.')

        if self._flags.carla_version == '0.9.6':
            self._world = self._client.load_world(
                'Town{:02d}'.format(self._flags.carla_town))
        else:
            # TODO (Sukrit) :: ERDOS provides no way to retrieve handles to the
            # class objects to do garbage collection. Hence, objects from
            # previous runs of the simulation may persist. We need to clean
            # them up right now. In future, move this logic to a seperate
            # destroy function.
            reset_world(self._world)

        # Set the weather.
        weather, name = get_weathers()[self._flags.carla_weather - 1]
        self._logger.info('Setting the weather to {}'.format(name))
        self._world.set_weather(weather)
        # Turn on the synchronous mode so we can control the simulation.
        if self._flags.carla_synchronous_mode:
            set_synchronous_mode(self._world, self._flags.carla_fps)

        # Spawn the required number of vehicles.
        self._vehicles = self._spawn_vehicles(self._flags.carla_num_vehicles)

        # Spawn the vehicle that the pipeline has to drive and send it to
        # the downstream operators.
        self._driving_vehicle = self._spawn_driving_vehicle()

        if self._flags.carla_version == '0.9.6':
            # Pedestrians are do not move in versions older than 0.9.6.
            (self._pedestrians, ped_control_ids) = self._spawn_pedestrians(
                self._flags.carla_num_pedestrians)

        # Tick once to ensure that the actors are spawned before the data-flow
        # starts.
        self._tick_at = time.time()
        self._tick_simulator()

        # Start pedestrians
        if self._flags.carla_version == '0.9.6':
            self._start_pedestrians(ped_control_ids)
コード例 #6
0
ファイル: lidar_logger_operator.py プロジェクト: Rmao99/pylot
 def __init__(self, name, flags, log_file_name=None, csv_file_name=None):
     super(LidarLoggerOp, self).__init__(name)
     self._flags = flags
     self._logger = setup_logging(self.name, log_file_name)
     self._csv_logger = setup_csv_logging(self.name + '-csv', csv_file_name)
     self._pc_msg_cnt = 0
コード例 #7
0
 def __init__(self, name, log_file_name=None):
     super(FusionVerificationOperator, self).__init__(name)
     self._logger = setup_logging(self.name, log_file_name)
     self.vehicles = deque()
コード例 #8
0
 def __init__(self, name, num_points=100000, buffer_logs=False):
     super(LidarOperator, self).__init__(name, buffer_logs)
     self._logger = setup_logging(self.name, 'pylot.log')
     self._num_points = num_points
     self._cnt = 0
コード例 #9
0
 def __init__(self, name, log_file_name=None):
     super(CameraReplayOperator, self).__init__(name)
     self._logger = setup_logging(self.name, log_file_name)
     self._cnt = 1
     self._image = None
コード例 #10
0
ファイル: control_operator.py プロジェクト: amandhar/erdos
 def __init__(self, name, log_file_name=None):
     super(ControlOperator, self).__init__(name)
     self._logger = setup_logging(self.name, log_file_name)
コード例 #11
0
 def __init__(self, name, output_stream_name):
     super(DetectionOperator, self).__init__(name)
     self._logger = setup_logging(self.name)
     self._output_stream_name = output_stream_name
     self._net = None
     self.bridge = None