code: def _weights_callback(self, msg):
          
          # Read weights
          weights = np.array(msg.data)
  
          # If needed, initialize indiv_weight_buffers
          if len(self._weight_buffers) == 0:
              self._weight_buffers = [[] for i in range(len(weights))]
  
          # Record individual weights
          for i, w in enumerate(weights):
              if len(self._weight_buffers[i]) == self._ntaps:
                  self._weight_buffers[i].pop(0)
              self._weight_buffers[i].append(w)
docs: Callback for recording weights from sensor.