src/markov/sensors/sensors_rollout.py [392:429]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        except GenericError as ex:
            ex.log_except_and_exit(SIMAPP_SIMULATION_WORKER_EXCEPTION)
        except Exception as ex:
            raise GenericRolloutException('{}'.format(ex))

    def get_state(self, block=True):
        try:
            return {self.sensor_type: self.data_buffer.get(block=block, timeout=self.timeout)}
        except utils.DoubleBuffer.Empty:
            # For Lidar, we always call non-blocking get_state instead of
            # block-waiting for new state, and the expectation is
            # we always have outdated state data to be read in the worst case as
            # we don't clear the data on get for DoubleBuffer (Refer to __init__).
            # Thus, the expectation is utils.DoubleBuffer.Empty will be never raised.
            # However, there can be an edge case for first call of get_state as DoubleBuffer may be
            # Empty, in such case, this may cause issue for the inference due to
            # incompatible input to NN. Thus, we should get sensor data with blocking if
            # DoubleBuffer.Empty is raised.
            return {self.sensor_type: self.data_buffer.get(block=True, timeout=self.timeout)}
        except Exception as ex:
            raise GenericRolloutException("Unable to set state: {}".format(ex))

    def reset(self):
        self.data_buffer.clear()

    def get_input_embedders(self, network_type):
        try:
            return get_lidar_embedders(network_type, self.sensor_type)
        except GenericError as ex:
            ex.log_except_and_exit(SIMAPP_SIMULATION_WORKER_EXCEPTION)
        except Exception as ex:
            raise GenericRolloutException('{}'.format(ex))

    def _scan_cb(self, data):
        try:
            self.data_buffer.put(np.array(data.ranges))
        except Exception as ex:
            LOGGER.info("Unable to retrieve state: %s", ex)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



src/markov/sensors/sensors_rollout.py [451:488]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        except GenericError as ex:
            ex.log_except_and_exit(SIMAPP_SIMULATION_WORKER_EXCEPTION)
        except Exception as ex:
            raise GenericRolloutException('{}'.format(ex))

    def get_state(self, block=True):
        try:
            return {self.sensor_type: self.data_buffer.get(block=block, timeout=self.timeout)}
        except utils.DoubleBuffer.Empty:
            # For Lidar, we always call non-blocking get_state instead of
            # block-waiting for new state, and the expectation is
            # we always have outdated state data to be read in the worst case as
            # we don't clear the data on get for DoubleBuffer (Refer to __init__).
            # Thus, the expectation is utils.DoubleBuffer.Empty will be never raised.
            # However, there can be an edge case for first call of get_state as DoubleBuffer may be
            # Empty, in such case, this may cause issue for the inference due to
            # incompatible input to NN. Thus, we should get sensor data with blocking if
            # DoubleBuffer.Empty is raised.
            return {self.sensor_type: self.data_buffer.get(block=True, timeout=self.timeout)}
        except Exception as ex:
            raise GenericRolloutException("Unable to set state: {}".format(ex))

    def reset(self):
        self.data_buffer.clear()

    def get_input_embedders(self, network_type):
        try:
            return get_lidar_embedders(network_type, self.sensor_type)
        except GenericError as ex:
            ex.log_except_and_exit(SIMAPP_SIMULATION_WORKER_EXCEPTION)
        except Exception as ex:
            raise GenericRolloutException('{}'.format(ex))

    def _scan_cb(self, data):
        try:
            self.data_buffer.put(np.array(data.ranges))
        except Exception as ex:
            LOGGER.info("Unable to retrieve state: %s", ex)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



