import random

class Randomizer():
    
    def __init__(self,filename) :
        self.filename = filename

    def subtractor(self):
        with open(self.filename, 'rt') as f_in, open('thetas_randomized.txt', 'w') as f_out:
            lines = f_in.readlines()
            for line in lines:
                x = float(line)
                x_new = x - random.uniform(-2, 2)
                f_out.write(str(x_new) + '\n')

def main():
    filename = '/home/andrea/Master_Thesis/ROS2/ros2_ws/src/my_traj/my_traj/thetas_correct.txt'
    randomizer = Randomizer(filename)
    randomizer.subtractor()


if __name__ == '__main__':
    main()