diff options
| author | Edvin <[email protected]> | 2025-05-06 12:11:35 +0200 |
|---|---|---|
| committer | Edvin <[email protected]> | 2025-05-06 12:11:35 +0200 |
| commit | 66557fa2666712e205924544e60afe46c13b0a24 (patch) | |
| tree | 6a3104621eaac650a3a457b0fdb35ed337bf1018 /DWM.py | |
| parent | 7b75f8477e6591c5897e2c2d7fa21e69a6a2fc15 (diff) | |
Added some direction code
Diffstat (limited to 'DWM.py')
| -rwxr-xr-x | DWM.py | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -30,8 +30,9 @@ kf.P = np.array([[x_std**2, 0.], kf.R = np.array([[x_mu, 0.], [0., y_mu]]) -updRate = "1 1" # Active Idle +position = np.array([0, 0]) +updRate = "10 10" # Active Idle with serial.Serial('/dev/ttyACM0', 115200, timeout = 1) as s: @@ -91,9 +92,10 @@ with serial.Serial('/dev/ttyACM0', 115200, timeout = 1) as s: x = int(kf.x[0] * 1000) y = int(kf.x[1] * 1000) - print(f"x: {x}, y: {y}") + with open("position.txt", "w") as f: - f.write(f"x,y\n") + print(f"{x},{y}") + f.write(f"{x},{y}\n") f.close() print("Shutting down serial communication") |
