f = open(self.path, "r+")
re_moro = re.compile(r"MORO X=(.+) Y=(.+) Z=(.+) RX=(.+) RY=(.+) RZ=(.+)")
re_head = re.compile(r"Head X=(.+) Y=(.+) Z=(.+) RX=(.+) RY=(.+) RZ=(.+)")
re_eye = re.compile(r"Eye X=(.+) Y=(.+) Z=(.+) RX=(.+) RY=(.+) RZ=(.+)")
re_arm = re.compile(r"Arm ID=(.+) Angle=(.+)")
read_pos_arm = re_arm.findall(f.read())
read_pos_wheel = re_moro.findall(f.read())
read_pos_head = re_head.findall(f.read())
read_pos_eye = re_eye.findall(f.read())
self.write_data(read_pos_wheel, self.wheel_data)
self.write_data(read_pos_head, self.head_data)
self.write_data(read_pos_eye, self.eye_data)
self.write_data(read_pos_arm, self.arm_data)
I f got the file permissions, and my re is all right.
Why only read_pos_arm
can get the data, the rest will be empty. Put read_pos_wheel
in front, wheel can again, and the others are empty. What happened in it?