-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkuka_demo_test.lua
728 lines (630 loc) · 28.6 KB
/
kuka_demo_test.lua
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
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
require 'qtcore'
require 'qtgui'
require 'qtuitools'
require 'os'
require 'rttlib'
-- in ui folder call : OROCOS_TARGET=xenomai rosrun ocl rttlua kuka_demo_test.lua -style plastique
app = QApplication(select('#',...) + 1, {'lua', ...})
connected = false
function Q(s) return QString.fromUtf8(s, #s) end
uifile = QFile.new(Q"kukademo.ui")
uifile:open(QIODevice.OpenModeFlag.ReadOnly)
uiloader = QUiLoader.new()
window = uiloader:load(uifile)
window:show()
tc = rtt.getTC()
dp = tc:getPeer('Deployer')
dp:runScript("orocos/init.ops")
dp:import("ATISensor")
dp:loadComponent("ATI", "ATISensor")
ATI = dp:getPeer("ATI")
selected_controller = 0
app:__addmethod("connectRobot(bool)", function(self, checked)
local connectRobot = window:findChild("actionConnect")
local lwr = dp:getPeer("lwr")
if selected_controller ~= 0 then
if checked == true then
print("Connect to robot")
connected = true
connectRobot:setText(Q"Connected")
lwr:start()
--dp:runScript("orocos/load_simple_demo.ops")
--kukademo = dp:getPeer("KukaDemo")
else
print("Disconnect")
connected = false
connectRobot:setText(Q"Connect")
lwr:stop()
--dp:runScript("orocos/unload_simple_demo.ops")
end
end
--dp:runScript("../kuka_simple_demo/orocos_script/kuka_demo.ops")
--dp:loadComponent('name','OCL::LuaComponent')
--name = dp:getPeer('name')
--name:exec_str('function updateHook() print(rtt.getTime()) end')
--name:setPeriod(0.1)
--name:configure()
--name:start()
end)
app:__addmethod("selectController(int)", function(self, index)
selected_controller = index
if index == 1 then
--Dummy controller
print ("Launch Dummy")
dp:runScript("orocos/load_simple_demo.ops")
elseif index == 2 then
print ("Launch Kuka Transpose")
dp:runScript("../kuka_jacobian_demo/orocos_script/KukaJacobianDemoRTNET.ops")
elseif index == 3 then
print ("Launch Kuka Model Transpose")
dp:runScript("../kuka_model_demo/orocos_script/kuka_model_demo.ops")
end
kukademo = dp:getPeer("KukaDemo")
end)
app:__addmethod("startJacobian()", function()
print ("Launch Kuka Transpose")
dp:runScript("../kuka_jacobian_demo/orocos_script/KukaJacobianDemoRTNET.ops")
kukademo = dp:getPeer("KukaDemo")
end)
app:__addmethod("startModel()", function()
print ("Launch Kuka Model Transpose")
dp:runScript("../kuka_model_demo/orocos_script/kuka_model_demo.ops")
kukademo = dp:getPeer("KukaDemo")
end)
app:__addmethod("ATIcalibration()", function()
print ("Launch ATI Calibration")
dp:runScript("../kuka_ATI_calibration_demo/orocos_script/kukaATICalibrationDemoRTNET.ops")
ATI = dp:getPeer("ATI")
kukademo = dp:getPeer("KukaDemo")
end)
app:__addmethod("getNameKukaDemo()", function()
print(kukademo:getName())
end)
app:__addmethod("setCons()", function()
print(kukademo:getName())
local Xdes = window:findChild("Xdes")
local Ydes = window:findChild("Ydes")
local Zdes = window:findChild("Zdes")
local CurrentXdes = window:findChild("currentXdes")
local CurrentYdes = window:findChild("currentYdes")
local CurrentZdes = window:findChild("currentZdes")
local Xdes_value = Xdes:text()
CurrentXdes:setText(Xdes:text())
local Ydes_value = Ydes:text()
CurrentYdes:setText(Ydes:text())
local Zdes_value = Zdes:text()
CurrentZdes:setText(Zdes:text())
local pos_des = rtt.Variable("array")
pos_des:resize(3)
pos_des:fromtab{Xdes_value:toDouble(), Ydes_value:toDouble(), Zdes_value:toDouble()}
kukademo:setXcons(pos_des)
print ("SetCons")
end)
app:__addmethod("startStop(bool)", function(self, checked)
local startComponent = window:findChild("actionStartComponent")
if checked ==true then
--getPeriod
local period = window:findChild("period")
local period_value = period:text()
startComponent:setText(Q"Stop Component")
--sendPeriod to component
kukademo:setPeriod(period_value:toDouble())
print("Start component")
kukademo:start()
else
startComponent:setText(Q"Start Component")
kukademo:stop()
end
end)
app:__addmethod("Start()", function()
--getPeriod
local period = window:findChild("period")
local period_value = period:text()
--sendPeriod to component
kukademo:setPeriod(period_value:toDouble())
kukademo:start()
end)
app:__addmethod("Stop()", function()
kukademo:stop()
end)
--app:__addmethod("SetControlStrategy()", function()
-- local controlmode = window:findChild("controlmode")
-- local controlmode_value = controlmode:text()
-- kukademo:friStop()
-- print(controlmode_value:toUInt())
-- kukademo:setControlStrategy(controlmode_value:toUInt())
--end)
app:__addmethod("SetControlStrategy(int)", function(self, index)
local controlmode = window:findChild("controlModeMenu")
kukademo:friStop()
print(index)
kukademo:setControlStrategy(index+1)
end)
app:__addmethod("fricmd()", function()
kukademo:friStart()
end)
app:__addmethod("frimon()", function()
kukademo:friStop()
end)
app:__addmethod("setJntImp()", function()
local stiffness = window:findChild("stiffness")
local stiffness_value = stiffness:text()
local stiffness_table = {}
for i=1,7 do stiffness_table[i] = stiffness_value:toDouble() end
local stiffness_array = rtt.Variable("array")
stiffness_array:resize(7)
stiffness_array:fromtab(stiffness_table)
local damping = window:findChild("damping")
local damping_value = damping:text()
local damping_table = {}
for i=1,7 do damping_table[i] = damping_value:toDouble() end
local damping_array = rtt.Variable("array")
damping_array:resize(7)
damping_array:fromtab(damping_table)
kukademo:setJointImpedance(stiffness_array,damping_array)
end)
app:__addmethod("setKpKd()", function()
local Kp = window:findChild("kp")
local Kp_value = Kp:text()
local Kd = window:findChild("kd")
local Kd_value = Kd:text()
kukademo:setGains(Kp_value:toDouble(),Kd_value:toDouble())
end)
app:__addmethod("setTool()", function()
local tool = window:findChild("settool")
local tool_value = tool:text()
kukademo:setTool(tool_value:toUInt())
end)
app:__addmethod("setFRIQdes()", function()
local A1des = window:findChild("A1des")
local A2des = window:findChild("A2des")
local E1des = window:findChild("E1des")
local A3des = window:findChild("A3des")
local A4des = window:findChild("A4des")
local A5des = window:findChild("A5des")
local A6des = window:findChild("A6des")
local previousA1des = window:findChild("previousA1des")
local previousA2des = window:findChild("previousA2des")
local previousE1des = window:findChild("previousE1des")
local previousA3des = window:findChild("previousA3des")
local previousA4des = window:findChild("previousA4des")
local previousA5des = window:findChild("previousA5des")
local previousA6des = window:findChild("previousA6des")
local A1desValue = A1des:text()
local A2desValue = A2des:text()
local E1desValue = E1des:text()
local A3desValue = A3des:text()
local A4desValue = A4des:text()
local A5desValue = A5des:text()
local A6desValue = A6des:text()
previousA1des:setText(A1des)
previousA2des:setText(A2des)
previousE1des:setText(E1des)
previousA3des:setText(A3des)
previousA4des:setText(A4des)
previousA5des:setText(A5des)
previousA6des:setText(A6des)
local q_array = rtt.Variable("array")
q_array:resize(7)
q_tab = {}
q_tab[1] = A1desValue:toDouble()
q_tab[2] = A2desValue:toDouble()
q_tab[3] = E1desValue:toDouble()
q_tab[4] = A3desValue:toDouble()
q_tab[5] = A4desValue:toDouble()
q_tab[6] = A5desValue:toDouble()
q_tab[7] = A6desValue:toDouble()
q_array:fromtab(q_tab)
kukademo:sendJointPosition(q_array)
end)
app:__addmethod("exec_lua()", function()
local lua_interpreter = window:findChild("lua_interpreter")
local lua_cmd = lua_interpreter:text()
loadstring(lua_cmd:toStdString())()
lua_interpreter:setText("")
end)
connect_robot = window:findChild("actionConnect")
connect_robot:connect('2toggled(bool)', app, '1connectRobot(bool)')
current_controller = window:findChild("CurrentController")
current_controller:connect('2currentIndexChanged(int)', app, '1selectController(int)')
current_controlMode = window:findChild("controlModeMenu")
current_controlMode:connect('2currentIndexChanged(int)', app, '1SetControlStrategy(int)')
start_component = window:findChild("actionStartComponent")
start_component:connect('2toggled(bool)', app, '1startStop(bool)')
ATI_calibration_demo = window:findChild("Calibration_button")
ATI_calibration_demo:connect('2clicked()', app, '1ATIcalibration()')
SetCons = window:findChild("SetCons_button")
SetCons:connect('2clicked()', app, '1setCons()')
--SetControlStrategy = window:findChild("SetControlMode_button")
--SetControlStrategy:connect('2clicked()', app, '1SetControlStrategy()')
FRI_cmd_mode = window:findChild("fri_cmd_button")
FRI_cmd_mode:connect('2clicked()', app, '1fricmd()' )
FRI_mon_mode = window:findChild("fri_mon_button")
FRI_mon_mode:connect('2clicked()', app, '1frimon()' )
SetJointImpedance = window:findChild("set_joint_impedance_button")
SetJointImpedance:connect('2clicked()', app, '1setJntImp()' )
SetKpKd = window:findChild("setkpkd_button")
SetKpKd:connect('2clicked()', app, '1setKpKd()' )
SetTool = window:findChild("set_tool_button")
SetTool:connect('2clicked()', app, '1setTool()' )
SetQdes = window:findChild("setQdes_button")
SetQdes:connect('2clicked()', app, '1setFRIQdes()')
lua_interpreter_button = window:findChild("lua_interpreter_button")
lua_interpreter_button:connect('2clicked()', app, '1exec_lua()')
function updateMassMatrix()
local M00 = window:findChild("MassMatrix00")
local M01 = window:findChild("MassMatrix01")
local M02 = window:findChild("MassMatrix02")
local M03 = window:findChild("MassMatrix03")
local M04 = window:findChild("MassMatrix04")
local M05 = window:findChild("MassMatrix05")
local M06 = window:findChild("MassMatrix06")
local M10 = window:findChild("MassMatrix10")
local M11 = window:findChild("MassMatrix11")
local M12 = window:findChild("MassMatrix12")
local M13 = window:findChild("MassMatrix13")
local M14 = window:findChild("MassMatrix14")
local M15 = window:findChild("MassMatrix15")
local M16 = window:findChild("MassMatrix16")
local M20 = window:findChild("MassMatrix20")
local M21 = window:findChild("MassMatrix21")
local M22 = window:findChild("MassMatrix22")
local M23 = window:findChild("MassMatrix23")
local M24 = window:findChild("MassMatrix24")
local M25 = window:findChild("MassMatrix25")
local M26 = window:findChild("MassMatrix26")
local M30 = window:findChild("MassMatrix30")
local M31 = window:findChild("MassMatrix31")
local M32 = window:findChild("MassMatrix32")
local M33 = window:findChild("MassMatrix33")
local M34 = window:findChild("MassMatrix34")
local M35 = window:findChild("MassMatrix35")
local M36 = window:findChild("MassMatrix36")
local M40 = window:findChild("MassMatrix40")
local M41 = window:findChild("MassMatrix41")
local M42 = window:findChild("MassMatrix42")
local M43 = window:findChild("MassMatrix43")
local M44 = window:findChild("MassMatrix44")
local M45 = window:findChild("MassMatrix45")
local M46 = window:findChild("MassMatrix46")
local M50 = window:findChild("MassMatrix50")
local M51 = window:findChild("MassMatrix51")
local M52 = window:findChild("MassMatrix52")
local M53 = window:findChild("MassMatrix53")
local M54 = window:findChild("MassMatrix54")
local M55 = window:findChild("MassMatrix55")
local M56 = window:findChild("MassMatrix56")
local M60 = window:findChild("MassMatrix60")
local M61 = window:findChild("MassMatrix61")
local M62 = window:findChild("MassMatrix62")
local M63 = window:findChild("MassMatrix63")
local M64 = window:findChild("MassMatrix64")
local M65 = window:findChild("MassMatrix65")
local M66 = window:findChild("MassMatrix66")
local massMatrix = rtt.Variable("array")
massMatrix:resize(49)
massMatrix = kukademo:getMassMatrix()
M00:setText(QString():setNum(massMatrix[0]))
M01:setText(QString():setNum(massMatrix[1]))
M02:setText(QString():setNum(massMatrix[2]))
M03:setText(QString():setNum(massMatrix[3]))
M04:setText(QString():setNum(massMatrix[4]))
M05:setText(QString():setNum(massMatrix[5]))
M06:setText(QString():setNum(massMatrix[6]))
M10:setText(QString():setNum(massMatrix[7]))
M11:setText(QString():setNum(massMatrix[8]))
M12:setText(QString():setNum(massMatrix[9]))
M13:setText(QString():setNum(massMatrix[10]))
M14:setText(QString():setNum(massMatrix[11]))
M15:setText(QString():setNum(massMatrix[12]))
M16:setText(QString():setNum(massMatrix[13]))
M20:setText(QString():setNum(massMatrix[14]))
M21:setText(QString():setNum(massMatrix[15]))
M22:setText(QString():setNum(massMatrix[16]))
M23:setText(QString():setNum(massMatrix[17]))
M24:setText(QString():setNum(massMatrix[18]))
M25:setText(QString():setNum(massMatrix[19]))
M26:setText(QString():setNum(massMatrix[20]))
M30:setText(QString():setNum(massMatrix[21]))
M31:setText(QString():setNum(massMatrix[22]))
M32:setText(QString():setNum(massMatrix[23]))
M33:setText(QString():setNum(massMatrix[24]))
M34:setText(QString():setNum(massMatrix[25]))
M35:setText(QString():setNum(massMatrix[26]))
M36:setText(QString():setNum(massMatrix[27]))
M40:setText(QString():setNum(massMatrix[28]))
M41:setText(QString():setNum(massMatrix[29]))
M42:setText(QString():setNum(massMatrix[30]))
M43:setText(QString():setNum(massMatrix[31]))
M44:setText(QString():setNum(massMatrix[32]))
M45:setText(QString():setNum(massMatrix[33]))
M46:setText(QString():setNum(massMatrix[34]))
M50:setText(QString():setNum(massMatrix[35]))
M51:setText(QString():setNum(massMatrix[36]))
M52:setText(QString():setNum(massMatrix[37]))
M53:setText(QString():setNum(massMatrix[38]))
M54:setText(QString():setNum(massMatrix[39]))
M55:setText(QString():setNum(massMatrix[40]))
M56:setText(QString():setNum(massMatrix[41]))
M60:setText(QString():setNum(massMatrix[42]))
M61:setText(QString():setNum(massMatrix[43]))
M62:setText(QString():setNum(massMatrix[44]))
M63:setText(QString():setNum(massMatrix[45]))
M64:setText(QString():setNum(massMatrix[46]))
M65:setText(QString():setNum(massMatrix[47]))
M66:setText(QString():setNum(massMatrix[48]))
end
timer= QTimer(parent)
timer:connect('2timeout()', function()
if connected == true then
local pos_cart = rtt.Variable("array")
pos_cart:resize(12)
pos_cart = kukademo:getCartPos() -- to add in friexamples
--pos_cart:fromtab{1.0,2.2,-2.3}
local Xee = window:findChild("Xee")
local Yee = window:findChild("Yee")
local Zee = window:findChild("Zee")
local Mee00 = window:findChild("Mee00")
local Mee01 = window:findChild("Mee01")
local Mee02 = window:findChild("Mee02")
local Mee03 = window:findChild("Mee03")
local Mee10 = window:findChild("Mee10")
local Mee11 = window:findChild("Mee11")
local Mee12 = window:findChild("Mee12")
local Mee13 = window:findChild("Mee13")
local Mee20 = window:findChild("Mee20")
local Mee21 = window:findChild("Mee21")
local Mee22 = window:findChild("Mee22")
local Mee23 = window:findChild("Mee23")
Xee:setText(QString():setNum(pos_cart[0]))
Yee:setText(QString():setNum(pos_cart[1]))
Zee:setText(QString():setNum(pos_cart[2]))
Mee00:setText(QString():setNum(pos_cart[3]))
Mee01:setText(QString():setNum(pos_cart[4]))
Mee02:setText(QString():setNum(pos_cart[5]))
Mee03:setText(QString():setNum(pos_cart[0]))
Mee10:setText(QString():setNum(pos_cart[6]))
Mee11:setText(QString():setNum(pos_cart[7]))
Mee12:setText(QString():setNum(pos_cart[8]))
Mee13:setText(QString():setNum(pos_cart[1]))
Mee20:setText(QString():setNum(pos_cart[9]))
Mee21:setText(QString():setNum(pos_cart[10]))
Mee22:setText(QString():setNum(pos_cart[11]))
Mee23:setText(QString():setNum(pos_cart[2]))
local ATIvalues = rtt.Variable("array")
ATIvalues:resize(8)
ATIvalues = ATI:getATIvalues()
Fx = window:findChild("data_Fx")
Fy = window:findChild("data_Fy")
Fz = window:findChild("data_Fz")
Tx = window:findChild("data_Tx")
Ty = window:findChild("data_Ty")
Tz = window:findChild("data_Tz")
Fnorm = window:findChild("data_normF")
Tnorm = window:findChild("data_normT")
local EstValues = rtt.Variable("array")
EstValues:resize(8)
EstValues = ATI:getKukaEstValues()
Est_Fx = window:findChild("data_Festx")
Est_Fy = window:findChild("data_Festy")
Est_Fz = window:findChild("data_Festz")
Est_Tx = window:findChild("data_Testx")
Est_Ty = window:findChild("data_Testy")
Est_Tz = window:findChild("data_Testz")
Est_Fnorm = window:findChild("data_normFest")
Est_Tnorm = window:findChild("data_normTest")
Fx:setText(QString():setNum(ATIvalues[0]))
Fy:setText(QString():setNum(ATIvalues[1]))
Fz:setText(QString():setNum(ATIvalues[2]))
Tx:setText(QString():setNum(ATIvalues[3]))
Ty:setText(QString():setNum(ATIvalues[4]))
Tz:setText(QString():setNum(ATIvalues[5]))
Fnorm:setText(QString():setNum(ATIvalues[6]))
Tnorm:setText(QString():setNum(ATIvalues[7]))
Est_Fx:setText(QString():setNum(EstValues[0]))
Est_Fy:setText(QString():setNum(EstValues[1]))
Est_Fz:setText(QString():setNum(EstValues[2]))
Est_Tx:setText(QString():setNum(EstValues[3]))
Est_Ty:setText(QString():setNum(EstValues[4]))
Est_Tz:setText(QString():setNum(EstValues[5]))
Est_Fnorm:setText(QString():setNum(EstValues[6]))
Est_Tnorm:setText(QString():setNum(EstValues[7]))
local jacobian_matrix = rtt.Variable("array")
jacobian_matrix:resize(42)
jacobian_matrix = kukademo:getJacobian()
J11 = window:findChild("J11")
J12 = window:findChild("J12")
J13 = window:findChild("J13")
J14 = window:findChild("J14")
J15 = window:findChild("J15")
J16 = window:findChild("J16")
J17 = window:findChild("J17")
J21 = window:findChild("J21")
J22 = window:findChild("J22")
J23 = window:findChild("J23")
J24 = window:findChild("J24")
J25 = window:findChild("J25")
J26 = window:findChild("J26")
J27 = window:findChild("J27")
J31 = window:findChild("J31")
J32 = window:findChild("J32")
J33 = window:findChild("J33")
J34 = window:findChild("J34")
J35 = window:findChild("J35")
J36 = window:findChild("J36")
J37 = window:findChild("J37")
J41 = window:findChild("J41")
J42 = window:findChild("J42")
J43 = window:findChild("J43")
J44 = window:findChild("J44")
J45 = window:findChild("J45")
J46 = window:findChild("J46")
J47 = window:findChild("J47")
J51 = window:findChild("J51")
J52 = window:findChild("J52")
J53 = window:findChild("J53")
J54 = window:findChild("J54")
J55 = window:findChild("J55")
J56 = window:findChild("J56")
J57 = window:findChild("J57")
J61 = window:findChild("J61")
J62 = window:findChild("J62")
J63 = window:findChild("J63")
J64 = window:findChild("J64")
J65 = window:findChild("J65")
J66 = window:findChild("J66")
J67 = window:findChild("J67")
J11:setText(QString():setNum(jacobian_matrix[0]))
J12:setText(QString():setNum(jacobian_matrix[1]))
J13:setText(QString():setNum(jacobian_matrix[2]))
J14:setText(QString():setNum(jacobian_matrix[3]))
J15:setText(QString():setNum(jacobian_matrix[4]))
J16:setText(QString():setNum(jacobian_matrix[5]))
J17:setText(QString():setNum(jacobian_matrix[6]))
J21:setText(QString():setNum(jacobian_matrix[7]))
J22:setText(QString():setNum(jacobian_matrix[8]))
J23:setText(QString():setNum(jacobian_matrix[9]))
J24:setText(QString():setNum(jacobian_matrix[10]))
J25:setText(QString():setNum(jacobian_matrix[11]))
J26:setText(QString():setNum(jacobian_matrix[12]))
J27:setText(QString():setNum(jacobian_matrix[13]))
J31:setText(QString():setNum(jacobian_matrix[14]))
J32:setText(QString():setNum(jacobian_matrix[15]))
J33:setText(QString():setNum(jacobian_matrix[16]))
J34:setText(QString():setNum(jacobian_matrix[17]))
J35:setText(QString():setNum(jacobian_matrix[18]))
J36:setText(QString():setNum(jacobian_matrix[19]))
J37:setText(QString():setNum(jacobian_matrix[20]))
J41:setText(QString():setNum(jacobian_matrix[21]))
J42:setText(QString():setNum(jacobian_matrix[22]))
J43:setText(QString():setNum(jacobian_matrix[23]))
J44:setText(QString():setNum(jacobian_matrix[24]))
J45:setText(QString():setNum(jacobian_matrix[25]))
J46:setText(QString():setNum(jacobian_matrix[26]))
J47:setText(QString():setNum(jacobian_matrix[27]))
J51:setText(QString():setNum(jacobian_matrix[28]))
J52:setText(QString():setNum(jacobian_matrix[29]))
J53:setText(QString():setNum(jacobian_matrix[30]))
J54:setText(QString():setNum(jacobian_matrix[31]))
J55:setText(QString():setNum(jacobian_matrix[32]))
J56:setText(QString():setNum(jacobian_matrix[33]))
J57:setText(QString():setNum(jacobian_matrix[34]))
J61:setText(QString():setNum(jacobian_matrix[35]))
J62:setText(QString():setNum(jacobian_matrix[36]))
J63:setText(QString():setNum(jacobian_matrix[37]))
J64:setText(QString():setNum(jacobian_matrix[38]))
J65:setText(QString():setNum(jacobian_matrix[39]))
J66:setText(QString():setNum(jacobian_matrix[40]))
J67:setText(QString():setNum(jacobian_matrix[41]))
--Qmes
local currentA1 = window:findChild("currentA1_label")
local currentA2 = window:findChild("currentA2_label")
local currentE1 = window:findChild("currentE1_label")
local currentA3 = window:findChild("currentA3_label")
local currentA4 = window:findChild("currentA4_label")
local currentA5 = window:findChild("currentA5_label")
local currentA6 = window:findChild("currentA6_label")
local q = rtt.Variable("array")
q:resize(7)
q = kukademo:getQ()
currentA1:setText(QString():setNum(q[0]))
currentA2:setText(QString():setNum(q[1]))
currentE1:setText(QString():setNum(q[2]))
currentA3:setText(QString():setNum(q[3]))
currentA4:setText(QString():setNum(q[4]))
currentA5:setText(QString():setNum(q[5]))
currentA6:setText(QString():setNum(q[6]))
if selected_controller == 3 then
local J00_model = window:findChild("J00_model")
local J01_model = window:findChild("J01_model")
local J02_model = window:findChild("J02_model")
local J03_model = window:findChild("J03_model")
local J04_model = window:findChild("J04_model")
local J05_model = window:findChild("J05_model")
local J06_model = window:findChild("J06_model")
local J10_model = window:findChild("J10_model")
local J11_model = window:findChild("J11_model")
local J12_model = window:findChild("J12_model")
local J13_model = window:findChild("J13_model")
local J14_model = window:findChild("J14_model")
local J15_model = window:findChild("J15_model")
local J16_model = window:findChild("J16_model")
local J20_model = window:findChild("J20_model")
local J21_model = window:findChild("J21_model")
local J22_model = window:findChild("J22_model")
local J23_model = window:findChild("J23_model")
local J24_model = window:findChild("J24_model")
local J25_model = window:findChild("J25_model")
local J26_model = window:findChild("J26_model")
local J30_model = window:findChild("J30_model")
local J31_model = window:findChild("J31_model")
local J32_model = window:findChild("J32_model")
local J33_model = window:findChild("J33_model")
local J34_model = window:findChild("J34_model")
local J35_model = window:findChild("J35_model")
local J36_model = window:findChild("J36_model")
local J40_model = window:findChild("J40_model")
local J41_model = window:findChild("J41_model")
local J42_model = window:findChild("J42_model")
local J43_model = window:findChild("J43_model")
local J44_model = window:findChild("J44_model")
local J45_model = window:findChild("J45_model")
local J46_model = window:findChild("J46_model")
local J50_model = window:findChild("J50_model")
local J51_model = window:findChild("J51_model")
local J52_model = window:findChild("J52_model")
local J53_model = window:findChild("J53_model")
local J54_model = window:findChild("J54_model")
local J55_model = window:findChild("J55_model")
local J56_model = window:findChild("J56_model")
local jacobian_model = rtt.Variable("array")
jacobian_model:resize(42)
jacobian_model = kukademo:getJacobianModel(6)
J00_model:setText(QString():setNum(jacobian_model[0]))
J01_model:setText(QString():setNum(jacobian_model[1]))
J02_model:setText(QString():setNum(jacobian_model[2]))
J03_model:setText(QString():setNum(jacobian_model[3]))
J04_model:setText(QString():setNum(jacobian_model[4]))
J05_model:setText(QString():setNum(jacobian_model[5]))
J06_model:setText(QString():setNum(jacobian_model[6]))
J10_model:setText(QString():setNum(jacobian_model[7]))
J11_model:setText(QString():setNum(jacobian_model[8]))
J12_model:setText(QString():setNum(jacobian_model[9]))
J13_model:setText(QString():setNum(jacobian_model[10]))
J14_model:setText(QString():setNum(jacobian_model[11]))
J15_model:setText(QString():setNum(jacobian_model[12]))
J16_model:setText(QString():setNum(jacobian_model[13]))
J20_model:setText(QString():setNum(jacobian_model[14]))
J21_model:setText(QString():setNum(jacobian_model[15]))
J22_model:setText(QString():setNum(jacobian_model[16]))
J23_model:setText(QString():setNum(jacobian_model[17]))
J24_model:setText(QString():setNum(jacobian_model[18]))
J25_model:setText(QString():setNum(jacobian_model[19]))
J26_model:setText(QString():setNum(jacobian_model[20]))
J30_model:setText(QString():setNum(jacobian_model[21]))
J31_model:setText(QString():setNum(jacobian_model[22]))
J32_model:setText(QString():setNum(jacobian_model[23]))
J33_model:setText(QString():setNum(jacobian_model[24]))
J34_model:setText(QString():setNum(jacobian_model[25]))
J35_model:setText(QString():setNum(jacobian_model[26]))
J36_model:setText(QString():setNum(jacobian_model[27]))
J40_model:setText(QString():setNum(jacobian_model[28]))
J41_model:setText(QString():setNum(jacobian_model[29]))
J42_model:setText(QString():setNum(jacobian_model[30]))
J43_model:setText(QString():setNum(jacobian_model[31]))
J44_model:setText(QString():setNum(jacobian_model[32]))
J45_model:setText(QString():setNum(jacobian_model[33]))
J46_model:setText(QString():setNum(jacobian_model[34]))
J50_model:setText(QString():setNum(jacobian_model[35]))
J51_model:setText(QString():setNum(jacobian_model[36]))
J52_model:setText(QString():setNum(jacobian_model[37]))
J53_model:setText(QString():setNum(jacobian_model[38]))
J54_model:setText(QString():setNum(jacobian_model[39]))
J55_model:setText(QString():setNum(jacobian_model[40]))
J56_model:setText(QString():setNum(jacobian_model[41]))
end
updateMassMatrix()
end
end)
timer:start(1000) --msec
app.exec();