def calc_error(self, angles):
    'Calculate the error between predicted and target angles, and\n        add the safety penalties.\n        '
    errors = [abs((x - y)) for (x, y) in zip(angles, self.target_angles)]
    error = sum(errors)
    error += self.penalty
    self.error = torch.tensor(error)
Calculate the error between predicted and target angles, and
add the safety penalties.
def calc_error(self, angles):
    'Calculate the error between predicted and target angles, and\n        add the safety penalties.\n        '
    errors = [abs((x - y)) for (x, y) in zip(angles, self.target_angles)]
    error = sum(errors)
    error += self.penalty
    self.error = torch.tensor(error)