Skip to content
Snippets Groups Projects
Commit a74b05e7 authored by ym13n22's avatar ym13n22
Browse files

origion combine

parent 99cfcfb4
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment