diff --git a/integration/IMUEMGCombined.py b/integration/IMUEMGCombined.py index b3611ddb7527437d713093f7ebdd23737cdef92b..0a4128bc9e1bf3395eea3b6912a74a4ebbc935b3 100644 --- a/integration/IMUEMGCombined.py +++ b/integration/IMUEMGCombined.py @@ -11,7 +11,7 @@ data_collection_duration = 3 num_measurements_hand = 1 # Initialize the arduino object -arduino = serial.Serial('COM17', 115200) +arduino = serial.Serial('COM7', 115200) # braccio = serial.Serial('COM6', 115200) sleep(1) @@ -49,8 +49,8 @@ def collect_emg_data(duration): try: emg1 = float(data[0]) emg2 = float(data[1]) - #print("Emg1: ",emg1) - #print("Emg2: ",emg2) + print("Emg1: ",emg1) + print("Emg2: ",emg2) emg_data.append((emg1, emg2)) except ValueError: continue @@ -167,6 +167,8 @@ def main(): pitch = -asin(2 * (q0 * q2 - q3 * q1)) yaw = -atan2(2 * (q0 * q3 + q1 * q2), 1 - 2 * (q2 * q2 + q3 * q3)) + print(f"roll: {roll}, pitch: {pitch}, yaw: {yaw}") + k = vector(cos(yaw) * cos(pitch), sin(pitch), sin(yaw) * cos(pitch)) # this is the x vector y = vector(0, 1, 0) # y vector: pointing down s = cross(k, y) # this is pointing to the side