j'ai créé le temps

This commit is contained in:
mpboyer 2025-01-13 19:53:15 +01:00
parent 9b584a5c37
commit bf5b728050

View file

@ -1,6 +1,7 @@
import socket
import os
import typing
import time
import numpy as np
from sympy.abc import alpha
@ -28,6 +29,7 @@ class NaiveSimulator(Simulator):
speed = np.array([0., 0., 0.])
time_step = 0
last_update = 0.
# X_STEPS_PER_INCH = 4800
X_STEPS_PER_MM: float = 188.97
@ -43,6 +45,7 @@ class NaiveSimulator(Simulator):
def __init__(self, bind):
super().__init__(bind)
self.last_update = time.time()
while True:
self.loop()
@ -64,6 +67,9 @@ class NaiveSimulator(Simulator):
def realize(self):
print("MA VIE C'EST DE LA MERDE")
lt = time.time()
self.time_step = lt - self.last_update
self.last_update = lt
x_v = parse_speed(socket.SocketIO(self.s, 'r').readline())
y_v = parse_speed(socket.SocketIO(self.s, 'r').readline())
z_v = parse_speed(socket.SocketIO(self.s, 'r').readline())