testing multistep mpc
This commit is contained in:
parent
8548348edd
commit
c31bb9cb11
|
@ -353,7 +353,7 @@ class RemoteController:
|
||||||
self.controlling = True
|
self.controlling = True
|
||||||
elif event.key == pygame.K_DOWN:
|
elif event.key == pygame.K_DOWN:
|
||||||
self.controlling = False
|
self.controlling = False
|
||||||
self.rc_socket.send('(0.0,0.0)\n')
|
self.rc_socket.send('(0.1, 0.0,0.0)\n')
|
||||||
elif event.key == pygame.K_0:
|
elif event.key == pygame.K_0:
|
||||||
self.target = (0.0, 0.0)
|
self.target = (0.0, 0.0)
|
||||||
elif event.key == pygame.K_1:
|
elif event.key == pygame.K_1:
|
||||||
|
@ -397,7 +397,7 @@ class RemoteController:
|
||||||
# if tgrid is not None:
|
# if tgrid is not None:
|
||||||
tmpc_end = time.time()
|
tmpc_end = time.time()
|
||||||
print("---------------- mpc solution took {} seconds".format(tmpc_end-tmpc_start))
|
print("---------------- mpc solution took {} seconds".format(tmpc_end-tmpc_start))
|
||||||
for i in range(0, 1):
|
for i in range(0, 5):
|
||||||
u1 = us1[i]
|
u1 = us1[i]
|
||||||
u2 = us2[i]
|
u2 = us2[i]
|
||||||
dt_mpc = time.time() - self.t
|
dt_mpc = time.time() - self.t
|
||||||
|
@ -405,7 +405,7 @@ class RemoteController:
|
||||||
# time.sleep(0.1 - dt_mpc)
|
# time.sleep(0.1 - dt_mpc)
|
||||||
self.rc_socket.send('({},{},{})\n'.format(0.1,u1, u2))
|
self.rc_socket.send('({},{},{})\n'.format(0.1,u1, u2))
|
||||||
self.t = time.time()
|
self.t = time.time()
|
||||||
time.sleep(0.01)
|
time.sleep(0.1)
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user