-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrunning_robobee.py
More file actions
59 lines (42 loc) · 1.18 KB
/
running_robobee.py
File metadata and controls
59 lines (42 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 9 18:52:30 2019
@author: jonbs
"""
import time
#from roboBee_class import *
from roboBee_class_PD_and_LQR import *
tester = roboBee()
#tester.run_analytical(1200)
#tester.run_pd(1200)
#print(input[0].shape, output.shape)
"""
JIA: use the 'input' and 'output' variables below to train the neural network, if
you want more data, just increaes x in run_pd(x) as that is the number of time
steps the simulation will run
"""
input, output = tester.run_lqr(1000, verbose=True)
#input1, output1 = tester.run_pd(1000)
"""
#Timing different method funcs, will probably delete eventually
start = time.time()
for i in range(2500):
print(i)
end = time.time()
print("LQR controller: ", end - start)
start = time.time()
for i in range(10):
tester.run_lqr(2500)
end = time.time()
print("LQR controller: ", end - start)
start = time.time()
for i in range(10):
tester.run_pd(2500)
end = time.time()
print("PD controller: ", end - start)
start = time.time()
for i in range(10):
tester.run_analytical(2500)
end = time.time()
print("Analytical controller: ", end - start)
"""