-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcoding seesion log 3-17-20
299 lines (193 loc) · 7.56 KB
/
coding seesion log 3-17-20
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
Hi Sravya!
Hi Demetris,how are you?
Good. How are you?
Good! Let us start.
Ok. We need to make a minor change to the code. I will show you the example really quick.
We just need to call that command in the midca code to start simulation and then stop it using
stopSimulation command before midca closes.
Sure, so I should call the simulation during the initialize time and stop it when it closes?
Yes.
is it a python thread? if so then exiting midca will automatically closes it right?
Not necessarily. It can continue to run in the background sometime, but it isn't difficult to kill if
that happens.
Sure. how does the simulator work?
This function mimics the physical motion of the robot (like
speed, position, and so on) by integrating the physiscs
based equations and then you can acess the position
information using the same functions we did initially.
can we call this in percieve phase as well?
You can, but to have them setup to have the same info,
you would need tho use the same object in both percieve and
act.
got you, ok I will first initialize this in percieve and
store the object in memory. that should be fine right?
yes.
I will go ahead and open percieve.py
I think I need to have the class definition in here,
You can import like so
sure ! where is it located ?
It is in the same folder as the act module.
Do you mind if i change the location of it ?
We can just import that path. I don't mind, but we would
have to change act module because put the object there
initially. Which ever is easier for you.
The only reason I want to change the location of GraceAct.py
is to be consistent with midca. We usually have domain
specific information in domains folder.
That is fine as long as you can still import it in the
midca modules.
sure.
so what should I do with this.
You no longer need it correct?
I thought this was a different example
Ok ! I need to percieve depth in percieve phase.
You can do it with the other class.
sure. Let me know if I do anything wrong
Just to clarify. This still works with the physical robot,
but calling the simmulation function allows you to use
the simulated information rather that the real robot
info. If you don't call it, we will just read physical
sensors.
sure. I will change the name
THat should work right?
Yes. The depth is in meters correct?
Sure. then 20 might be too much right ?
Yea. That was what I was going to say.
ok what could be the maximum depth the robot can dive?
SO that I can have the idea of the scale.
Supposedly, it can dive to 20 meters, but it would just
take for ever. If you look at the terminal. That
took 191 seconds to go to 5 meters and then back up to
3.
sure.
that should do it, let me go to act phase
and do the necessary changes
That is correct right?
Yes.
Tha communicateDepth function will still work right?
Yes
I see you have written some function for this
Yes. All the functionality that we orignally had for the
graceMidcaAct class i moved to the new one and added
simulation functionality.
Nice. I will then change the code there
I think I am done making changes
ok. One last thing. remove the import statement from begining
of act module
done. Lets test if this works
Let's do it.
May have to close and check in a text editor.
The ide does wierd things with spaces and tabs sometimes.
Sure.
Do we have a text editor here ?
Yes. Just right click the file and open it with text editor.
ok
just a minute. I will solve the error
ok.
Do you want to run without the simulator until you figure
out the bugs?
No I gave the wrong goal. I havent tested the interpret
code because I did not have an actual anomaly. Now
that you wrote the simulator I should test it. Let me
do it one more time to check if I have no problem with
simulator and then I can work on my code.
ok.
my mistake. let me test this function befor you run the
midca code again.
sure, no problem
ok. it's working. Just need to fix it in the other folder.
thanks
I will try to run midca again
Are you calling the dive function multiple times without
stopping the previous dive?
just a sec, I see the problem.
No, I am jsut calling it once. I will show you where
Let me direct you to the file. I think i have to set the dive
flag. just a sec. That should do it. Let me run it ag.
my mistake
no problem. before you run it again. Do you call the
action again for raise?
yes I do.
Do you stop the regulation in between?
I am not sure about that. I dont think I did.
It should be something like this "stopRegulation()" when
you are done diving and want to use the comand to go to
a different step.
Sure. Right now the agent will go directly to the depth
instead of intermediete depths and rise. So there will
only be one rais and one dive action. I will use
that before raise action.
I will run it again
ok.
It is working. I have to make a few changes to test anamoly.
at this point I think i can do it myself. I will let
you know if something is wrong. I will complete it in
an hour or so.thank you
No problem. Text or email me if you need something. I am
going to go get some food. If you get it working tonight
suprise me in the meeting tommorrow!
sure. Thanks for all the help. I appreciate it.
No problem. See you later.
Bye.
*****************************************************
I got these two errors
Error 1: I only got the error once. The problem might be from
my end. I thought you might know
RuntimeWarning: overflow encountered in double_scalars
M2=0.5 * rho * V ** 2 * S * (C_M0 + C_alpha_MP * alpha + K_q2 * omega2)
****** Starting Interpret Phase ******
Next MIDCA command: state: [[ -9.89732960e+199]
[ 0.00000000e+000]
[ 0.00000000e+000]
[ -7.94682984e+241]
[ 0.00000000e+000]
[ -6.78881874e+241]
[ nan]
[ nan]
[ nan]
[ 7.11868789e+242]
[ 0.00000000e+000]
[ 9.12626690e+242]
[ 0.00000000e+000]
[ 1.00000000e+000]
[ 0.00000000e+000]
[ -9.12626690e+242]
[ 0.00000000e+000]
[ 7.11868789e+242]]
dx: [[ -2.07843922e+201]
[ 0.00000000e+000]
[ -2.09684967e+200]
[ -1.66883427e+243]
[ 0.00000000e+000]
[ -1.42565194e+243]
[ nan]
[ nan]
[ nan]
[ 1.49492446e+244]
[ 0.00000000e+000]
[ 1.91651605e+244]
[ 0.00000000e+000]
[ 1.00000000e+000]
[ 0.00000000e+000]
[ -1.91651605e+244]
[ 0.00000000e+000]
[ 1.49492446e+244]]
277.95
*****************************************************
Error 2: During communicate action
Error checking completion status for action communicate(grace, fumin, bottom) - Assuming failure:
Traceback (most recent call last):
File "/home/pi/Desktop/GraceMIDCA/midca/modules/_plan/asynch/asynch_3d_test.py", line 157, in check_complete
complete = self.isComplete(self.mem, self.midcaAction, self.status)
File "/home/pi/Desktop/GraceMIDCA/midca/modules/_plan/asynch/asynch_3d_test.py", line 314, in <lambda>
completionCheck = lambda mem, midcaAction, status: self.check_confirmation()
File "/home/pi/Desktop/GraceMIDCA/midca/modules/_plan/asynch/asynch_3d_test.py", line 334, in check_confirmation
self.GraceAct.communicateDepth(self.depth)
File "/home/pi/Desktop/GraceMIDCA/midca/domains/grace/GraceAct.py", line 35, in communicateDepth
f = open(gracePath + "Next_Dive_GO", 'w')
NameError: global name 'gracePath' is not defined
***************************************************8
Error 2 should be fixed now. The first one has to do with the numerical
integration failing sometime. It is not your fault, but it will occur
once in a while. I haven't been able to find what the cause was, but it
seemed to not happen much so I let it as it was.