Commentaires:
// simple ligne
aucune instruction sur la même ligne donc pas de commentaire après une instruction
https://bvdp.inetdoc.net/files/iut/staubliiut/projets_srs/Cellule_depart_staubli_light.zip
→ il y a un probleme a cause du path du fichier .wrl de la cellule en relatif
je fait un projet sans la cellule:
https://bvdp.inetdoc.net/files/iut/staubliiut/projets_srs/Cellule_depart_staubli_vide.zip 176Ko
→ faire un script python
changement nom projet
substitution simple fonctionnelle:
find . -name "test" -exec sed -i 's,Demo_vissage_bvdp,Demo_rubiks_bvdp, g' {} \;
sed avec variables en bash: https://askubuntu.com/questions/76808/how-do-i-use-variables-in-a-sed-command
sed -i "s/$var1/ZZ/g" "$file"
substitution complete fonctionnelle:
ancien_nom="Demo_vissage_bvdp" nouveau_nom="Demo_rubiks_bvdp" find . -name "*.cuo" -exec sed -i "s,$ancien_nom,$nouveau_nom, g" {} \; find . -name "*.pjx" -exec sed -i "s,$ancien_nom,$nouveau_nom, g" {} \; git mv Controller1/usr/usrapp/$ancien_nom/$ancien_nom.dtx Controller1/usr/usrapp/$ancien_nom/$nouveau_nom.dtx git mv Controller1/usr/usrapp/$ancien_nom/$ancien_nom.pjx Controller1/usr/usrapp/$ancien_nom/$nouveau_nom.pjx git mv Controller1/usr/usrapp/$ancien_nom Controller1/usr/usrapp/$nouveau_nom
~/testgit/rubiksstaubli$ grep -nRi Demo_vissage_bvdp * CELL_IUT0.cuo:4: <Application>Disk://Demo_vissage_bvdp/Demo_vissage_bvdp.pjx</Application> CELL_IUT0.cuo:10: <Node Path="CELL_IUT0\Controller1\Disk:##Demo_vissage_bvdp#Demo_vissage_bvdp.pjx" IsExpanded="true" /> CELL_IUT0.cuo:11: <Node Path="CELL_IUT0\Controller1\Disk:##Demo_vissage_bvdp#Demo_vissage_bvdp.pjx\bool" IsExpanded="true" /> CELL_IUT0.cuo:12: <Node Path="CELL_IUT0\Controller1\Disk:##Demo_vissage_bvdp#Demo_vissage_bvdp.pjx\mdesc" IsExpanded="true" /> CELL_IUT0.cuo:13: <Node Path="CELL_IUT0\Controller1\Disk:##Demo_vissage_bvdp#Demo_vissage_bvdp.pjx\num" IsExpanded="true" /> CELL_IUT0.cuo:14: <Node Path="CELL_IUT0\Controller1\Disk:##Demo_vissage_bvdp#Demo_vissage_bvdp.pjx\num\ndebatement_Angulaire" IsExpanded="true" /> CELL_IUT0.cuo:15: <Node Path="CELL_IUT0\Controller1\Disk:##Demo_vissage_bvdp#Demo_vissage_bvdp.pjx\num\nPas_de_vissage" IsExpanded="true" /> CELL_IUT0.cuo:16: <Node Path="CELL_IUT0\Controller1\Disk:##Demo_vissage_bvdp#Demo_vissage_bvdp.pjx\pointRx" IsExpanded="true" /> CELL_IUT0.cuo:17: <Node Path="CELL_IUT0\Controller1\Disk:##Demo_vissage_bvdp#Demo_vissage_bvdp.pjx\pointRx\pDeposeBouchon" IsExpanded="true" /> CELL_IUT0.cuo:18: <Node Path="CELL_IUT0\Controller1\Disk:##Demo_vissage_bvdp#Demo_vissage_bvdp.pjx\pointRx\pSaisieBouchon" IsExpanded="true" /> CELL_IUT0.cuo:19: <Node Path="CELL_IUT0\Controller1\Disk:##Demo_vissage_bvdp#Demo_vissage_bvdp.pjx\sio" IsExpanded="true" /> CELL_IUT0.cuo:20: <Node Path="CELL_IUT0\Controller1\Disk:##Demo_vissage_bvdp#Demo_vissage_bvdp.pjx\sio\siSocketTCP" IsExpanded="true" /> CELL_IUT0.cuo:21: <Node Path="CELL_IUT0\Controller1\Disk:##Demo_vissage_bvdp#Demo_vissage_bvdp.pjx\sio\siSocketUDP" IsExpanded="true" /> CELL_IUT0.cuo:22: <Node Path="CELL_IUT0\Controller1\Disk:##Demo_vissage_bvdp#Demo_vissage_bvdp.pjx\tool" IsExpanded="true" /> CELL_IUT0.cuo:23: <Node Path="CELL_IUT0\Controller1\Disk:##Demo_vissage_bvdp#Demo_vissage_bvdp.pjx\tool\tTool" IsExpanded="true" /> CELL_IUT0.cuo:30: <Node Path="CELL_IUT0\Controller1\Disk:##Demo_vissage_bvdp#Demo_vissage_bvdp.pjx" IsExpanded="true" /> CELL_IUT0.cuo:31: <Node Path="CELL_IUT0\Controller1\Disk:##Demo_vissage_bvdp#Demo_vissage_bvdp.pjx\emissionEtat" IsExpanded="true" /> CELL_IUT0.cuo:32: <Node Path="CELL_IUT0\Controller1\Disk:##Demo_vissage_bvdp#Demo_vissage_bvdp.pjx\start" IsExpanded="true" /> CELL_IUT0.cuo:33: <Node Path="CELL_IUT0\Controller1\Disk:##Demo_vissage_bvdp#Demo_vissage_bvdp.pjx\start\Locals" IsExpanded="true" /> CELL_IUT0.cuo:40: <Node Path="CELL_IUT0\Controller1\Demo_vissage_bvdp" IsExpanded="true" /> CELL_IUT0.cuo:41: <Node Path="CELL_IUT0\Controller1\Demo_vissage_bvdp\world[0]" IsExpanded="true" /> CELL_IUT0.cuo:42: <Node Path="CELL_IUT0\Controller1\Demo_vissage_bvdp\world[0]\pSaisieBouchon" IsExpanded="true" /> CELL_IUT0.cuo:43: <Node Path="CELL_IUT0\Controller1\Demo_vissage_bvdp\world[0]\pDeposeBouchon" IsExpanded="true" /> CELL_IUT0.cuo:44: <Node Path="CELL_IUT0\Controller1\Demo_vissage_bvdp\flange[0]" IsExpanded="true" /> CELL_IUT0.cuo:45: <Node Path="CELL_IUT0\Controller1\Demo_vissage_bvdp\flange[0]\tTool" IsExpanded="true" /> CELL_IUT0.cuo:46: <Node Path="CELL_IUT0\Controller1\Demo_vissage_bvdp\jointRx" IsExpanded="true" /> CELL_IUT0.cuo:47: <Node Path="CELL_IUT0\Controller1\Demo_vissage_bvdp\jointRx\jBrasLeve" IsExpanded="true" /> CELL_IUT0.cuo:48: <Node Path="CELL_IUT0\Controller1\Demo_vissage_bvdp\jointRx\jBrasbaisse" IsExpanded="true" /> CELL_IUT0.cuo:53: <Breakpoint Controller="Controller1" Application="Disk://Demo_vissage_bvdp/Demo_vissage_bvdp.pjx" ProgramName="start" Line="90" /> Controller1/log/user.log:14610:{"entry":{"date":"2022-11-08T19:06:41","ts":"2135.720476500","type":"msg","lvl":"INFO","id":"0x5402","val":"Application 'Demo_vissage_bvdp' lancée."},"hash":"04c46e3bef440bba71"} Controller1/log/user.log:15234:{"entry":{"date":"2022-11-08T19:10:01","ts":"2335.247940600","type":"msg","lvl":"INFO","id":"0x5403","val":"Application 'Demo_vissage_bvdp' arrêtée."},"hash":"55e1a6ad9da24163c0"} Controller1/log/user.log:15235:{"entry":{"date":"2022-11-08T19:10:01","ts":"2335.581087000","type":"msg","lvl":"INFO","id":"0x5402","val":"Application 'Demo_vissage_bvdp' lancée."},"hash":"041388c8938667f628"} Controller1/log/user.log:15766:{"entry":{"date":"2022-11-08T19:13:01","ts":"2514.791671600","type":"msg","lvl":"INFO","id":"0x5403","val":"Application 'Demo_vissage_bvdp' arrêtée."},"hash":"7d5fc809542efcc4de"} Controller1/log/user.log:15767:{"entry":{"date":"2022-11-08T19:13:01","ts":"2515.034596100","type":"msg","lvl":"INFO","id":"0x5402","val":"Application 'Demo_vissage_bvdp' lancée."},"hash":"c7bf4b434cbf4ce311"} Controller1/log/user.log:15772:{"entry":{"date":"2022-11-08T19:14:29","ts":"2603.271855100","type":"msg","lvl":"INFO","id":"0x5403","val":"Application 'Demo_vissage_bvdp' arrêtée."},"hash":"7bd84f45101910458a"} Controller1/log/user.log:15773:{"entry":{"date":"2022-11-08T19:14:29","ts":"2603.593135100","type":"msg","lvl":"INFO","id":"0x5402","val":"Application 'Demo_vissage_bvdp' lancée."},"hash":"28791b14976eccc924"} Controller1/log/user.log:16001:{"entry":{"date":"2022-11-08T19:23:40","ts":"3154.261730800","type":"msg","lvl":"INFO","id":"0x5403","val":"Application 'Demo_vissage_bvdp' arrêtée."},"hash":"f3ba94b4717505fcd2"} Controller1/log/user.log:16004:{"entry":{"date":"2022-11-08T19:25:18","ts":"3252.202974300","type":"msg","lvl":"INFO","id":"0x5402","val":"Application 'Demo_vissage_bvdp' lancée."},"hash":"2744ae21c081b14249"} Controller1/log/user.log:16067:{"entry":{"date":"2022-11-08T19:26:24","ts":"3317.745352399","type":"msg","lvl":"INFO","id":"0x5403","val":"Application 'Demo_vissage_bvdp' arrêtée."},"hash":"77b92e868d8dc13e8c"} Controller1/log/user.log:16068:{"entry":{"date":"2022-11-08T19:26:24","ts":"3317.992475999","type":"msg","lvl":"INFO","id":"0x5402","val":"Application 'Demo_vissage_bvdp' lancée."},"hash":"0359f6bc452209f8f0"} Controller1/log/user.log:16454:{"entry":{"date":"2022-11-08T19:31:04","ts":"3598.639613999","type":"msg","lvl":"INFO","id":"0x5403","val":"Application 'Demo_vissage_bvdp' arrêtée."},"hash":"7b889c9be276912468"} Controller1/log/user.log:16455:{"entry":{"date":"2022-11-08T19:31:05","ts":"3598.799416699","type":"msg","lvl":"INFO","id":"0x5402","val":"Application 'Demo_vissage_bvdp' lancée."},"hash":"1ea1cacf43596d7234"} Controller1/log/user.log:16548:{"entry":{"date":"2022-11-08T19:32:00","ts":"3654.586997100","type":"msg","lvl":"INFO","id":"0x5403","val":"Application 'Demo_vissage_bvdp' arrêtée."},"hash":"22360f252d34190909"} Controller1/log/user.log:16549:{"entry":{"date":"2022-11-08T19:32:01","ts":"3654.796171000","type":"msg","lvl":"INFO","id":"0x5402","val":"Application 'Demo_vissage_bvdp' lancée."},"hash":"cd6895f3b95dce80f6"} Controller1/log/user.log:16577:{"entry":{"date":"2022-11-08T19:32:29","ts":"3683.497306100","type":"msg","lvl":"INFO","id":"0x5403","val":"Application 'Demo_vissage_bvdp' arrêtée."},"hash":"97257919cc9ca7b943"} Controller1/log/user.log:16578:{"entry":{"date":"2022-11-08T19:32:29","ts":"3683.594245500","type":"msg","lvl":"INFO","id":"0x5402","val":"Application 'Demo_vissage_bvdp' lancée."},"hash":"bf492a13eded5accf1"} Controller1/log/user.log:16906:{"entry":{"date":"2022-11-08T19:36:01","ts":"3894.769062499","type":"msg","lvl":"INFO","id":"0x5403","val":"Application 'Demo_vissage_bvdp' arrêtée."},"hash":"c42d3ee2c673a08e8b"} Controller1/log/user.log:16907:{"entry":{"date":"2022-11-08T19:36:01","ts":"3894.980314200","type":"msg","lvl":"INFO","id":"0x5402","val":"Application 'Demo_vissage_bvdp' lancée."},"hash":"6b76f7da276146eb6a"} Controller1/log/user.log:16939:{"entry":{"date":"2022-11-08T19:36:31","ts":"3925.186446900","type":"msg","lvl":"INFO","id":"0x5403","val":"Application 'Demo_vissage_bvdp' arrêtée."},"hash":"1f6830a0c9bc385484"} Controller1/log/user.log:16940:{"entry":{"date":"2022-11-08T19:36:31","ts":"3925.440486900","type":"msg","lvl":"INFO","id":"0x5402","val":"Application 'Demo_vissage_bvdp' lancée."},"hash":"2c5c349c6286b19f8f"} Controller1/log/user.log:17162:{"entry":{"date":"2022-11-08T19:38:57","ts":"4071.388284400","type":"msg","lvl":"INFO","id":"0x5403","val":"Application 'Demo_vissage_bvdp' arrêtée."},"hash":"4fa1a9e36ed3f64092"} Controller1/log/user.log:17163:{"entry":{"date":"2022-11-08T19:38:57","ts":"4071.580464500","type":"msg","lvl":"INFO","id":"0x5402","val":"Application 'Demo_vissage_bvdp' lancée."},"hash":"0b1e1670403e92274b"} Controller1/log/user.log:18785:{"entry":{"date":"2022-11-08T20:04:22","ts":"494.728978199","type":"msg","lvl":"INFO","id":"0x5402","val":"Application 'Demo_vissage_bvdp' lancée."},"hash":"16b660b20e3ab10b23"} Controller1/log/user.log:18790:{"entry":{"date":"2022-11-08T20:04:43","ts":"516.126917499","type":"msg","lvl":"ERROR","id":"0x5404","val":"Erreur d'exécution VAL3. Accès à un tableau avec un index plus grand que la taille du tableau.. Demo_vissage_bvdp~. "},"hash":"71a8da682f2f7c72a8"} Controller1/log/user.log:18791:{"entry":{"date":"2022-11-08T20:04:43","ts":"516.126941699","type":"msg","lvl":"ERROR","id":"0x5404","val":"ERR 20 Accès à un tableau avec un index plus grand que la taille du tableau.. Demo_vissage_bvdp~. "},"hash":"a066dadfca71305675"} Controller1/log/user.log:18792:{"entry":{"date":"2022-11-08T21:12:31","ts":"4583.828104699","type":"msg","lvl":"INFO","id":"0x5403","val":"Application 'Demo_vissage_bvdp' arrêtée."},"hash":"38be06f72fcfc74c04"} Controller1/log/user.log:18793:{"entry":{"date":"2022-11-08T21:12:31","ts":"4584.034821800","type":"msg","lvl":"INFO","id":"0x5402","val":"Application 'Demo_vissage_bvdp' lancée."},"hash":"d050926879c7bec4be"} Controller1/log/user.log:19201:{"entry":{"date":"2022-11-08T21:16:26","ts":"4819.194506799","type":"msg","lvl":"INFO","id":"0x5403","val":"Application 'Demo_vissage_bvdp' arrêtée."},"hash":"04ecf6463adc50b936"} Controller1/log/user.log:19202:{"entry":{"date":"2022-11-08T21:16:26","ts":"4819.397078899","type":"msg","lvl":"INFO","id":"0x5402","val":"Application 'Demo_vissage_bvdp' lancée."},"hash":"3c4e30378220d93eb6"} Controller1/log/user.log:19331:{"entry":{"date":"2022-11-08T21:17:40","ts":"4893.141122199","type":"msg","lvl":"INFO","id":"0x5403","val":"Application 'Demo_vissage_bvdp' arrêtée."},"hash":"1c4b53f194e4ba41fb"} Controller1/log/user.log:19332:{"entry":{"date":"2022-11-08T21:17:40","ts":"4893.359090499","type":"msg","lvl":"INFO","id":"0x5402","val":"Application 'Demo_vissage_bvdp' lancée."},"hash":"c4ba5f1e5abaa14029"} Controller1/log/user.log:20272:{"entry":{"date":"2022-11-08T21:21:58","ts":"5150.815771199","type":"msg","lvl":"INFO","id":"0x5403","val":"Application 'Demo_vissage_bvdp' arrêtée."},"hash":"dc3580217bd0123d77"} Controller1/log/user.log:20273:{"entry":{"date":"2022-11-08T21:21:58","ts":"5151.023802199","type":"msg","lvl":"INFO","id":"0x5402","val":"Application 'Demo_vissage_bvdp' lancée."},"hash":"870cffd920c99bd892"} Controller1/log/user.log:20531:{"entry":{"date":"2022-11-08T21:23:25","ts":"5238.200896200","type":"msg","lvl":"INFO","id":"0x5403","val":"Application 'Demo_vissage_bvdp' arrêtée."},"hash":"6e36dbd77832e77a66"} Controller1/log/user.log:20532:{"entry":{"date":"2022-11-08T21:23:26","ts":"5238.457031499","type":"msg","lvl":"INFO","id":"0x5402","val":"Application 'Demo_vissage_bvdp' lancée."},"hash":"6423620317503e748e"} Controller1/log/user.log:20630:{"entry":{"date":"2022-11-08T21:24:30","ts":"5303.091238699","type":"msg","lvl":"INFO","id":"0x5403","val":"Application 'Demo_vissage_bvdp' arrêtée."},"hash":"b16b720d5ecbdbc2d4"} Controller1/log/user.log:20631:{"entry":{"date":"2022-11-08T21:24:30","ts":"5303.395415899","type":"msg","lvl":"INFO","id":"0x5402","val":"Application 'Demo_vissage_bvdp' lancée."},"hash":"f6603b70fb9c0dccca"} Controller1/log/user.log:20869:{"entry":{"date":"2022-11-08T21:27:54","ts":"5507.043431999","type":"msg","lvl":"INFO","id":"0x5403","val":"Application 'Demo_vissage_bvdp' arrêtée."},"hash":"aa3866ec4ec7af2ee0"} Controller1/log/user.log:20870:{"entry":{"date":"2022-11-08T21:27:55","ts":"5507.423099600","type":"msg","lvl":"INFO","id":"0x5402","val":"Application 'Demo_vissage_bvdp' lancée."},"hash":"434c0f9bcb8e6a3796"} Controller1/log/user.log:20875:{"entry":{"date":"2022-11-08T21:29:56","ts":"5629.215342500","type":"msg","lvl":"INFO","id":"0x5403","val":"Application 'Demo_vissage_bvdp' arrêtée."},"hash":"5c4fb4063e6d295b08"} Controller1/log/user.log:20876:{"entry":{"date":"2022-11-08T21:29:57","ts":"5629.442880399","type":"msg","lvl":"INFO","id":"0x5402","val":"Application 'Demo_vissage_bvdp' lancée."},"hash":"e943d4217414b450b5"} Controller1/log/user.log:20881:{"entry":{"date":"2022-11-08T21:30:32","ts":"5665.136526999","type":"msg","lvl":"INFO","id":"0x5403","val":"Application 'Demo_vissage_bvdp' arrêtée."},"hash":"e583700a5ff40cb180"} Controller1/log/user.log:20882:{"entry":{"date":"2022-11-08T21:30:33","ts":"5665.455688200","type":"msg","lvl":"INFO","id":"0x5402","val":"Application 'Demo_vissage_bvdp' lancée."},"hash":"4a180211c51094be2d"} Controller1/log/user.log:20934:{"entry":{"date":"2022-11-08T21:31:18","ts":"5711.218030100","type":"msg","lvl":"INFO","id":"0x5403","val":"Application 'Demo_vissage_bvdp' arrêtée."},"hash":"91515917fa363e8eee"} Controller1/log/user.log:20935:{"entry":{"date":"2022-11-08T21:31:19","ts":"5711.455119999","type":"msg","lvl":"INFO","id":"0x5402","val":"Application 'Demo_vissage_bvdp' lancée."},"hash":"8db2f0b2d7962366e1"} Controller1/log/user.log:21010:{"entry":{"date":"2022-11-21T16:22:20","ts":"1510.238550400","type":"msg","lvl":"INFO","id":"0x5402","val":"Application 'Demo_vissage_bvdp' lancée."},"hash":"6b1254e2032579ad29"} Controller1/log/user.log:21015:{"entry":{"date":"2022-11-21T16:24:49","ts":"27.520267400","type":"msg","lvl":"INFO","id":"0x5402","val":"Application 'Demo_vissage_bvdp' lancée."},"hash":"9e99e86d2b7e42f7ab"} Controller1/log/user.old:738:{"entry":{"date":"2022-02-20T18:45:35","ts":"1357.143896699","type":"msg","lvl":"INFO","id":"0x5403","val":"Application 'Demo_vissage_bvdp' arrêtée."},"hash":"97d4f8e14d7e3fad24"} Controller1/log/user.old:739:{"entry":{"date":"2022-02-20T18:45:36","ts":"1357.357032500","type":"msg","lvl":"INFO","id":"0x5402","val":"Application 'Demo_vissage_bvdp' lancée."},"hash":"db09751f4b38af26a5"} Controller1/log/user.old:13238:{"entry":{"date":"2022-02-20T20:08:34","ts":"597.090076200","type":"msg","lvl":"INFO","id":"0x5402","val":"Application 'Demo_vissage_bvdp' lancée."},"hash":"f0ef8e0e00af6a145f"} Controller1/log/user.old:17124:{"entry":{"date":"2022-02-20T21:02:23","ts":"3826.311147500","type":"msg","lvl":"INFO","id":"0x5403","val":"Application 'Demo_vissage_bvdp' arrêtée."},"hash":"6226336956c02d89de"} Controller1/log/user.old:17125:{"entry":{"date":"2022-02-20T21:02:23","ts":"3826.630530600","type":"msg","lvl":"INFO","id":"0x5402","val":"Application 'Demo_vissage_bvdp' lancée."},"hash":"cb1ce5f14c1ca7242f"} Controller1/log/user.old:17132:{"entry":{"date":"2022-02-20T21:02:48","ts":"3850.892647500","type":"msg","lvl":"INFO","id":"0x5403","val":"Application 'Demo_vissage_bvdp' arrêtée."},"hash":"ef1ed9c44d84ddfa42"} Controller1/log/user.old:17133:{"entry":{"date":"2022-02-20T21:02:48","ts":"3851.104061000","type":"msg","lvl":"INFO","id":"0x5402","val":"Application 'Demo_vissage_bvdp' lancée."},"hash":"604e6d4d56ea692f1a"} Controller1/log/user.old:18991:{"entry":{"date":"2022-02-20T21:08:39","ts":"4201.987151599","type":"msg","lvl":"INFO","id":"0x5403","val":"Application 'Demo_vissage_bvdp' arrêtée."},"hash":"cd1f5fe86b3069ac0c"} Controller1/log/user.old:18992:{"entry":{"date":"2022-02-20T21:08:39","ts":"4202.454484899","type":"msg","lvl":"INFO","id":"0x5402","val":"Application 'Demo_vissage_bvdp' lancée."},"hash":"3887df931a48c7187c"} Controller1/log/user.old:19137:{"entry":{"date":"2022-02-20T21:09:41","ts":"4264.330786099","type":"msg","lvl":"INFO","id":"0x5403","val":"Application 'Demo_vissage_bvdp' arrêtée."},"hash":"90251afa31e70244f0"} Controller1/log/user.old:19138:{"entry":{"date":"2022-02-20T21:09:41","ts":"4264.647409700","type":"msg","lvl":"INFO","id":"0x5402","val":"Application 'Demo_vissage_bvdp' lancée."},"hash":"b70778ef8d9e00d2f8"} Controller1/log/user.old:19273:{"entry":{"date":"2022-02-20T21:17:56","ts":"4758.839484499","type":"msg","lvl":"INFO","id":"0x5403","val":"Application 'Demo_vissage_bvdp' arrêtée."},"hash":"e7f2bf98fda2b5a279"} Controller1/log/user.old:19274:{"entry":{"date":"2022-02-20T21:17:56","ts":"4759.272553299","type":"msg","lvl":"INFO","id":"0x5402","val":"Application 'Demo_vissage_bvdp' lancée."},"hash":"64e711e5232acc678b"} Controller1/log/user.old:19832:{"entry":{"date":"2022-02-20T21:21:59","ts":"5001.898113900","type":"msg","lvl":"INFO","id":"0x5403","val":"Application 'Demo_vissage_bvdp' arrêtée."},"hash":"6b906435cfd5e5c66d"} Controller1/log/user.old:19833:{"entry":{"date":"2022-02-20T21:21:59","ts":"5002.156467899","type":"msg","lvl":"INFO","id":"0x5402","val":"Application 'Demo_vissage_bvdp' lancée."},"hash":"9b46ff77ffdf337df9"} Controller1/log/user.old:20236:{"entry":{"date":"2022-02-20T21:22:43","ts":"5045.943205299","type":"msg","lvl":"ERROR","id":"0x5404","val":"Erreur d'exécution VAL3. L'entrée-sortie ne répond pas.. Demo_vissage_bvdp~. "},"hash":"88eaf93869386fc37c"} Controller1/log/user.old:20237:{"entry":{"date":"2022-02-20T21:22:43","ts":"5045.943218699","type":"msg","lvl":"ERROR","id":"0x5404","val":"ERR 125 L'entrée-sortie ne répond pas.. Demo_vissage_bvdp~. "},"hash":"7e73e0100b1ae0aaa8"} Controller1/log/user.old:20238:{"entry":{"date":"2022-02-20T21:22:49","ts":"5052.303203400","type":"msg","lvl":"INFO","id":"0x5403","val":"Application 'Demo_vissage_bvdp' arrêtée."},"hash":"749a578d472670dacb"} Controller1/log/user.old:20239:{"entry":{"date":"2022-02-20T21:22:49","ts":"5052.625404799","type":"msg","lvl":"INFO","id":"0x5402","val":"Application 'Demo_vissage_bvdp' lancée."},"hash":"d5dc1c84ea4df7a403"} Controller1/log/user.old:20263:{"entry":{"date":"2022-02-20T21:23:13","ts":"5076.135020700","type":"msg","lvl":"ERROR","id":"0x5404","val":"Erreur d'exécution VAL3. Le temps maximal d'exécution de l'instruction a été atteint. Demo_vissage_bvdp~. "},"hash":"e1a392707d2f7c086b"} Controller1/log/user.old:20264:{"entry":{"date":"2022-02-20T21:23:13","ts":"5076.135030300","type":"msg","lvl":"ERROR","id":"0x5404","val":"ERR 60 Le temps maximal d'exécution de l'instruction a été atteint. Demo_vissage_bvdp~. "},"hash":"262070e2ffee660509"} Controller1/log/user.old:20266:{"entry":{"date":"2022-11-07T14:41:02","ts":"96.653606199","type":"msg","lvl":"INFO","id":"0x5402","val":"Application 'Demo_vissage_bvdp' lancée."},"hash":"f304afc5410ad7e18f"} Controller1/log/user.old:20290:{"entry":{"date":"2022-11-07T14:42:51","ts":"206.602255700","type":"msg","lvl":"ERROR","id":"0x5404","val":"Erreur d'exécution VAL3. Le temps maximal d'exécution de l'instruction a été atteint. Demo_vissage_bvdp~. "},"hash":"4bc932a1c6a494accd"} Controller1/log/user.old:20291:{"entry":{"date":"2022-11-07T14:42:51","ts":"206.602273699","type":"msg","lvl":"ERROR","id":"0x5404","val":"ERR 60 Le temps maximal d'exécution de l'instruction a été atteint. Demo_vissage_bvdp~. "},"hash":"a1a38ce53041d4c285"} Controller1/log/user.old:20292:{"entry":{"date":"2022-11-07T14:44:38","ts":"312.838417800","type":"msg","lvl":"INFO","id":"0x5403","val":"Application 'Demo_vissage_bvdp' arrêtée."},"hash":"f258d15c404d89dbb9"} Controller1/log/user.old:20293:{"entry":{"date":"2022-11-07T14:44:38","ts":"313.304041900","type":"msg","lvl":"INFO","id":"0x5402","val":"Application 'Demo_vissage_bvdp' lancée."},"hash":"f66c92628115623bc9"} Controller1/usr/usrapp/Demo_vissage_bvdp/Demo_vissage_bvdp.pjx:11: <Data file="Demo_vissage_bvdp.dtx" /> bvandepo@bvandepo-HP-ZBook-14-G2:~/testgit/rubiksstaubli$ et ~/testgit/rubiksstaubli$ find .| grep -i Demo_vissage_bvdp ./Controller1/usr/usrapp/Demo_vissage_bvdp ./Controller1/usr/usrapp/Demo_vissage_bvdp/start.pgx ./Controller1/usr/usrapp/Demo_vissage_bvdp/Demo_vissage_bvdp.dtx ./Controller1/usr/usrapp/Demo_vissage_bvdp/emissionEtat.pgx ./Controller1/usr/usrapp/Demo_vissage_bvdp/stop.pgx ./Controller1/usr/usrapp/Demo_vissage_bvdp/logMsgBlock.pgx ./Controller1/usr/usrapp/Demo_vissage_bvdp/Demo_vissage_bvdp.pjx ./Controller1/usr/usrapp/Demo_vissage_bvdp/.outlining.json
a quoi servent les données PUBLIQUES? (partagées entre applications?)
comment animer la pince?
onglet accueil→deboguer sur→tableau de bord DIO ??????
Déplacement manuel en cartésien: c'est quel repère (bride/outils)?
Import du modèle de pince
Récupérer le modèle STL de la pince Schunk et du préhenseur de bouchon: https://bvdp.inetdoc.net/files/iut/staubli/stl/adaptateur_pince_rubiks_iut2022_open.stl
Régler tout à 0 dans la position absolue sauf Z à 140.00 → je garde la même valeur comme çà j'aurai la même variable tTool que pour vissage
Ajout des éléments dans la cellule
https://bvdp.inetdoc.net/files/iut/staubli/stl/rubikscube_support_et_pied_LR.stl
https://bvdp.inetdoc.net/files/iut/staubli/stl/rubikscube.stl
faire une première version avec une liste de 9 position à apprendre
ensuite une seconde ou le rubiks cube définit un repère et les positions sont calculées à partir du repère cube
point appro(point pPosition, trsf trTransformation)
variable globale: pPointSaisieCubeRef Données→pPointSaisieCubeRef→pPointSaisieCubeRef[0]→clic droit→ici avec config 0 396,903687 -66,361694 77,289926 -180 0 -180 LEFTY EPOSITIVE WPOSITIVE
jBrasbaisse 0 -16,0396692462951 4,20500190148891 64,320275201713 -3,58871392837573E-14 111,474722896799 -16,0396692462945
- fVariable est une variable de type frame
voir chapitre 9: Positions du bras Organigramme : frame / point / tool / trsf
Le type frame décrit un repère géométrique. L'utilisation de repères rend en particulier les manipulations géométriques sur les points plus simples et intuitives. Le type trsf décrit une transformation géométrique. Il est utilisé par les types tool, point et frame.
point compose(point pPosition, frame fReference, trsf trTransformation) trsf position(point pPosition, frame fReference) trsf position(frame fFrame, frame fReference)
point here(tool tTool, frame fReference)
9.4. Type frame 9.4.1. Définition
Le type frame permet de définir la position de repères de référence dans la cellule. Le type frame est un type structuré avec un seul champ accessible : trsf trsf position du repère dans son repère de référence
Le repère de référence d'une variable de type frame est défini quand il est initialisé (à l'aide de l'interface utilisateur, de l'opérateur = ou de l'instruction link()). Le repère de référence world est toujours défini dans une application : tout repère de référence est, directement ou via d'autres repères, lié au repère world. Une erreur d'exécution est générée pendant un calcul géométrique si les coordonnées du repère world ont été modifiées.
Par défaut, les variables de repère local et les repères dans les variables de type utilisateur n'ont pas de repère de référence. Avant de pouvoir être utilisés, ils doivent être initialisés à partir d'un autre repère à l'aide de l'opérateur ’=’ ou de l'une des instructions link() et setFrame().
9.4.2. Utilisation
L'utilisation de repères de référence dans une application robotique est vivement recommandée :
L'affichage des points de la cellule est structuré selon l'organisation hiérarchique des repères.
Dès qu'un point de l'application est lié à un objet, il est souhaitable de définir un repère pour cet objet, et de lier les points à ce repère. Si l'objet est déplacé, il suffit de réapprendre le repère pour que tous les points qui y sont liés soient corrigés du même coup.
On peut pour cela définir les points de la trajectoire par rapport à un repère de travail, et apprendre un repère pour chaque endroit où la trajectoire doit être reproduite. En affectant la valeur d'un repère appris au repère de travail, la trajectoire entière se “déplace” sur le repère appris.
L'instruction compose() permet d'effectuer sur tout point des déplacements géométriques exprimés dans un repère de référence quelconque. L'instruction position() permet de calculer la position d'un point dans un repère de référence quelconque
num setFrame(point pOrigin, point pAxisOx, point pPlaneOxy, frame& fResult) trsf position(frame fFrame, frame fReference) void link(frame fFrame, frame fReference)
point compose(point pPosition, frame fReference,trsf trTransformation) Cette instruction renvoie le pPosition auquel la transformation géométrique trTransformation est appliquée par rapport au repère fReference.
DANGER La composante rotation de tTransformation modifie en général non seulement l'orientation de pPosition, mais aussi ses coordonnées cartésiennes (sauf si pPosition se situe sur l'origine de fReference). Si l'on souhaite que tTransformation ne modifie que l'orientation de pPosition, il faut mettre à jour le résultat avec les coordonnées cartésiennes de pPosition (voir exemple).
Le repère de référence et la configuration du point renvoyé sont ceux de pPosition. Une erreur d'exécution est générée si aucun repère de référence n'est défini pour pPosition. Exemple modification of the orientation without modification of PositionpResult = compose(pPosition,fReference,trTransformation)pResult.trsf.x = pPosition.trsf.xpResult.trsf.y = pPosition.trsf.ypResult.trsf.z = pPosition.trsf.z modification of Position without modification of the orientationtrTransformation.rx = trTransformation.ry =trTransformation.rz = 0pResult = compose(pResult,fReference,trTransformation)
Bertrand travail dans le dossier D:\travail\bertrand
installation de git portable dans D:\travail\bertrand\git
création des alias pour git voir git
D:\travail\bertrand\alias.txt:
git=D:\travail\bertrand\git\bin\git $* gitk=D:\travail\bertrand\git\cmd\gitk
pour ajouter la clef:
reg add "HKCU\Software\Microsoft\command processor" /v AutoRun /d "Doskey /MACROFILE=D:\travail\bertrand\alias.txt" /f >null
pour recharger le fichier d'alias sans redémarrer:
Doskey /MACROFILE=D:\travail\bertrand\alias.txt
Télécharger le fichier d'application python en cliquant droit sur le nom du fichier puis “Enregistrer sous”.
Avec l'explorateur, cliquer droit sur le fichier puis “Edit with IDLE”.
Modifier le code tel que demandé dans le sujet.
Lancer le programme en tapant sur la touche F5.
En cas de message d'avertissement de pare feu, cliquer sur Annuler.
15/12 a 11h38 rapid récupère sur prise 41 à gauche du robot un ip sur vlan rouge (alors que philippe avait mis les 2 prises sur vlan bleu le 13/12….????
enp0s25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether a0:8c:fd:a7:a0:52 brd ff:ff:ff:ff:ff:ff inet 172.16.8.65/24 brd 172.16.8.255 scope global dynamic enp0s25 valid_lft 295sec preferred_lft 295sec
Philippe remet les 2 prises 41 et 42 sur VLAN bleu. Mise en commentaire sur raspberry pi de passerelle 192.168.1.254 sur config wifi dans /etc/network/interface. Fixation raspberry pi vision sur robot. ssh -X fonctionnel.
slogin -Y pi@172.16.6.57
Pour visualiser image camera:
~/bvdp/opencv_bouchon/camera3.py
Pour sauver une image, la fenêtre avec l'image ayant le focus, presser S. (image .jpg dans le dossier sur raspberry pi) . pour quitter, presser q.
Utilisable sous windows à l'IUT, mais avec le warning pare feu :( Ignorer ce message, il n'empêche pas de communiquer. Comment le désactiver?
#!/usr/bin/python3 # -*- coding: utf-8 -* #Bertrand Vandeportaele 2022 import os import sys debug=True global numeroPremiereDonneeCapteur #TODO: donner une valeur à cette variable en fonction de votre numéro d'étudiant numeroPremiereDonneeCapteur=156 global destIP global portOut global etatBouton etatBouton=0 global slider1Value slider1Value=0 global slider2Value slider2Value=0 global led0Button ######################################## #https://stackoverflow.com/questions/1051254/check-if-python-package-is-installed #install automatically watchdog if not already installed import subprocess import sys reqs = subprocess.check_output([sys.executable, '-m', 'pip', 'freeze']) installed_packages = [r.decode().split('==')[0] for r in reqs.split()] if 'PyQt5' in installed_packages: if debug: print('PyQt5 pip package already installed') else: if debug: print('PyQt5 pip package missing, lets install it') import pip pip.main(['install','PyQt5']) ''' Could not find a version that satisfies the requirement PyQt5-Qt5>=5.15.2 (from PyQt5) (from versions: )[0m [31mNo matching distribution found for PyQt5-Qt5>=5.15.2 (from PyQt5)[0m [33mYou are using pip version 9.0.1, however version 21.3.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command.[0m Traceback (most recent call last): File "/home/bvandepo/Bureau/pythonb/staubli/simu_sensor_2_qt5.py", line 32, in <module> from PyQt5.QtGui import * ModuleNotFoundError: No module named 'PyQt5' ''' ######################################## #from PyQt5 import QtCore, QtGui, QtWidgets ''' from PyQt5.QtGui import * from PyQt5.QtNetwork import * from PyQt5.QtCore import * from PyQt5 import * from PyQt5.QtWidgets import * ''' from PyQt5.QtGui import * from PyQt5.QtNetwork import * from PyQt5.QtCore import * from PyQt5.QtWidgets import * from PyQt5 import * import re #pour découpage chaine comme sur https://stackoverflow.com/questions/2175080/sscanf-in-python ################################################################################ def close(): print('close') exit(0) ################################################################################ def commutTimer(): global timer print('commutTimer') if timer.isActive(): timer.stop() commutTimerButton.setText('start stream sensor') else: timer.start() commutTimerButton.setText('stop stream sensor') ################################################################################ def slider1ValueChanged( value ): #label.setText( str( value ) global numeroPremiereDonneeCapteur global labelSlider1Value global slider1Value slider1Value=value labelSlider1Value.setText( str( numeroPremiereDonneeCapteur+5)+" : {:6d}".format(slider1Value) ) #print('changed') ################################################################################ def slider2ValueChanged( value ): #label.setText( str( value ) global numeroPremiereDonneeCapteur global labelSlider2Value global slider2Value slider2Value=value labelSlider2Value.setText( str( numeroPremiereDonneeCapteur+6)+" : {:6d}".format(slider2Value) ) #print('changed') ################################################################################ def bouton0(): global numeroPremiereDonneeCapteur global labelButtonValue global led0Button global etatBouton etatBouton=(etatBouton+1)%2 if etatBouton==0: led0Button.setText('Activer la sortie TOR') else: led0Button.setText('Desactiver la sortie TOR') labelButtonValue.setText( str( numeroPremiereDonneeCapteur+2)+" : {:6d}".format(etatBouton) ) print('etatBouton: '+ str(etatBouton) +" \n"); ################################################################################ def sendUDP(i): global udpSocket global destIP global portOut DestIP = QHostAddress(destIP); global slider1Value global slider2Value global etatBouton global numeroPremiereDonneeCapteur # chaine=str(slider1Value)+ " " + str(slider2Value) #ajout @MAC bidon # chaine="00:00:00:00:00:00 "+str(slider1Value)+ " " + str(slider2Value) #ajout champs vides pour être compatible avec le joystick wifi #@MAC: BC:DD:C2:FE:6F:F0 num: 0 0 -> 529.0 , 1 -> 534.0 , 2 -> 0.0 , 3 -> 0.0 , 4 -> 0.0 , 5 -> -73.0 , 6 -> 63.0 , chaine="00:00:00:00:00:00 "+str(numeroPremiereDonneeCapteur)+" 0 0 "+str(etatBouton)+" 0 0 "+str(slider1Value)+ " " + str(slider2Value) #chaines bidons pour générer erreur de parsing sur le serveur # chaine="00:00:00:00:00:00 0 0 0 "+"687f"+" 0 0 "+str(slider1Value)+ " " + str(slider2Value) chaine=chaine+chr(13)+chr(10) print("la chaine envoyée vers ip: "+str(destIP)+":"+str(portOut) +" est: "+chaine) udpSocket.writeDatagram(chaine.encode('utf-8'),DestIP, portOut); ################################################################################ def timerUpdate(): sendUDP(0) ################################################################################ global led0Button #destIP='192.168.1.50' #pc simulateur #destIP='192.168.0.112' #pc simulateur #destIP='192.168.1.49' #pc serveur rapid connecté en filaire à réseau AIP #destIP='127.0.0.1' #pc serveur sur la boucle locale #destIP='192.168.3.5' #pc serveur rapid connecté en wifi à réseau AIP #destIP='192.168.3.4' #pc serveur rapid connecté en ethernet à réseau AIP #destIP='127.0.0.1' #ip locale destIP='10.6.11.62' #un pc de la salle u2 IUT portOut=10000 posx=100 posy=100 sizex=500 sizey=150 ################################################################################ app = QApplication(sys.argv) w=QDialog() statusLabel =QLabel('En attente de datagrammes UDP depuis le PIC32') commutTimerButton=QPushButton('stop stream sensor') quitButton = QPushButton('&Quit') led0Button = QPushButton('Activer la sortie TOR') udpSocket =QUdpSocket() udpSocket.bind(portOut, QUdpSocket.ShareAddress) quitButton.clicked.connect(close) commutTimerButton.clicked.connect(commutTimer) led0Button.clicked.connect(bouton0) #led1Button.clicked.connect(bouton1) #led2Button.clicked.connect(bouton2) #app.connect(quitButton,QtCore.SIGNAL('clicked()'), close) #app.connect(commutTimerButton, QtCore.SIGNAL('clicked()'), commutTimer) #app.connect(led0Button,QtCore.SIGNAL('clicked()'), bouton0) buttonLayout =QHBoxLayout() buttonLayout.addStretch(1) buttonLayout.addWidget(quitButton) buttonLayout.addWidget(commutTimerButton) buttonLayout.addStretch(1) global labelButtonValue labelButtonValue=QLabel( ) labelButtonValue.setGeometry(250, 50, 50, 35) #labelButtonValue.setText( "x: "+str(0 ) ) labelButtonValue.setText( str( numeroPremiereDonneeCapteur+2)+" : {:6d}".format(0) ) button1Layout =QHBoxLayout() button1Layout.addStretch(1) button1Layout.addWidget(labelButtonValue) button1Layout.addStretch(1) button1Layout.addWidget(led0Button) button1Layout.addStretch(1) ####################################################"" #http://koor.fr/Python/CodeSamplesQt/PyQtSlider.wp slider1 = QSlider(Qt.Horizontal); amplitude=1800; slider1.setMinimum(int(-amplitude/2)) slider1.setMaximum(int(amplitude/2)) slider1.setGeometry( 10, 10, 600, 40 ) slider1.valueChanged.connect(slider1ValueChanged ) slider1.setValue( 0 ) global labelSlider1Value labelSlider1Value=QLabel( ) labelSlider1Value.setGeometry(250, 50, 50, 35) #labelSlider1Value.setText( "x: "+str(0 ) ) labelSlider1Value.setText( str( numeroPremiereDonneeCapteur+5)+" : {:6d}".format(0) ) slider1Layout =QHBoxLayout() slider1Layout.addWidget(labelSlider1Value) slider1Layout.addWidget(slider1) #labelSlider1Value=QLabel( ) #labelSlider1Value.setGeometry(250, 50, 50, 35) #labelSlider1Value.setText( str( slider1.getValue() ) ) sliderLayout =QHBoxLayout() sliderLayout.addStretch(1) sliderLayout.addWidget(slider1) sliderLayout.addStretch(1) #sliderLayout.addWidget(labelSlider1Value) #sliderLayout.addStretch(1) slider2 = QSlider(Qt.Horizontal); slider2.setMinimum(int(-amplitude/2)) slider2.setMaximum(int(amplitude/2)) slider2.setGeometry( 10, 10, 600, 40 ) slider2.valueChanged.connect(slider2ValueChanged ) slider2.setValue( 0 ) global labelSlider2Value labelSlider2Value=QLabel( ) labelSlider2Value.setGeometry(250, 50, 50, 35) #labelSlider2Value.setText( "Y: "+str(0 ) ) labelSlider2Value.setText( str( numeroPremiereDonneeCapteur+6)+" : {:6d}".format(0) ) slider2Layout =QHBoxLayout() slider2Layout.addWidget(labelSlider2Value) slider2Layout.addWidget(slider2) sliderLayout.addWidget(slider2) sliderLayout.addStretch(1) mainLayout = QVBoxLayout() mainLayout.addLayout(buttonLayout) mainLayout.addLayout(button1Layout) mainLayout.addLayout(slider1Layout) mainLayout.addLayout(slider2Layout) mainLayout.addWidget(statusLabel) w.setLayout(mainLayout) chaine='@BVDP2022: Port Em '+str(portOut) +' vers IP: '+str(destIP) print(chaine) w.setWindowTitle(chaine) #timer adapted from example 1 of https://www.programcreek.com/python/example/52106/PyQt4.QtCore.QTimer timer = QtCore.QTimer() #app.connect(timer, QtCore.SIGNAL('timeout()'), timerUpdate) timer.timeout.connect(timerUpdate) timer.setInterval(100) timer.start() w.setGeometry(posx,posy,sizex,sizey) #donne le focus au bouton 1 led0Button.setDefault(True) w.show() app.exec_()
Autre programme de simulateur:
#!/usr/bin/python3 # -*- coding: utf-8 -* #Bertrand Vandeportaele 2019 import os import sys debug=True ######################################## #https://stackoverflow.com/questions/1051254/check-if-python-package-is-installed #install automatically watchdog if not already installed import subprocess import sys reqs = subprocess.check_output([sys.executable, '-m', 'pip', 'freeze']) installed_packages = [r.decode().split('==')[0] for r in reqs.split()] if 'PyQt5' in installed_packages: if debug: print('PyQt5 pip package already installed') else: if debug: print('PyQt5 pip package missing, lets install it') import pip pip.main(['install','PyQt5']) ''' Could not find a version that satisfies the requirement PyQt5-Qt5>=5.15.2 (from PyQt5) (from versions: )[0m [31mNo matching distribution found for PyQt5-Qt5>=5.15.2 (from PyQt5)[0m [33mYou are using pip version 9.0.1, however version 21.3.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command.[0m Traceback (most recent call last): File "/home/bvandepo/Bureau/pythonb/staubli/simu_sensor_2_qt5.py", line 32, in <module> from PyQt5.QtGui import * ModuleNotFoundError: No module named 'PyQt5' ''' ######################################## #from PyQt5 import QtCore, QtGui, QtWidgets ''' from PyQt5.QtGui import * from PyQt5.QtNetwork import * from PyQt5.QtCore import * from PyQt5 import * from PyQt5.QtWidgets import * ''' from PyQt5.QtGui import * from PyQt5.QtNetwork import * from PyQt5.QtCore import * from PyQt5.QtWidgets import * from PyQt5 import * import re #pour découpage chaine comme sur https://stackoverflow.com/questions/2175080/sscanf-in-python global capteur0 global capteur1 global capteur2 capteur0=0 capteur1=0 capteur2=0 global slider1Value slider1Value=0 global slider2Value slider2Value=0 ################################################################################ def close(): print('close') exit(0) ################################################################################ def commutTimer(): global timer print('commutTimer') if timer.isActive(): timer.stop() commutTimerButton.setText('start stream sensor') else: timer.start() commutTimerButton.setText('stop stream sensor') ################################################################################ def slider1ValueChanged( value ): #label.setText( str( value ) global slider1Value slider1Value=value print('changed') ################################################################################ def slider2ValueChanged( value ): #label.setText( str( value ) global slider2Value slider2Value=value print('changed') ################################################################################ def bouton0(): global capteur0 capteur0=(capteur0+1)%2 print('capteur0: '+ str(capteur0) +" \n"); ################################################################################ def bouton1(): global capteur1 capteur1=(capteur1+1)%2 print('capteur1: '+ str(capteur1) +" \n"); ################################################################################ def bouton2(): global capteur2 capteur2=(capteur2+1)%2 print('capteur2: '+ str(capteur2) +" \n"); ################################################################################ def sendUDP(i): global capteur0 global capteur1 global capteur2 global udpSocket global destIP global portOut DestIP = QHostAddress(destIP); global slider1Value global slider2Value chaine=str(slider1Value)+ " " + str(slider2Value) chaine=chaine+chr(13)+chr(10) print("la chaine envoyée est: "+chaine) udpSocket.writeDatagram(chaine.encode('utf-8'),DestIP, portOut); ################################################################################ def timerUpdate(): sendUDP(0) ################################################################################ #destIP='192.168.1.50' #pc simulateur #destIP='192.168.0.112' #pc simulateur #destIP='192.168.1.49' #pc serveur rapid connecté en filaire à réseau AIP #destIP='127.0.0.1' #pc serveur sur la boucle locale destIP='172.16.6.59' #pc serveur rapid connecté en filaire à réseau IUT Gomette bleue portOut=10000 posx=10 posy=10 sizex=500 sizey=150 ################################################################################ app = QApplication(sys.argv) w=QWidget(None) #QDialog() statusLabel =QLabel('En attente de datagrammes UDP depuis le PIC32') commutTimerButton=QPushButton('start clignote LED0') quitButton = QPushButton('&Quit') led0Button = QPushButton('Led&0') led1Button = QPushButton('Led&1') led2Button = QPushButton('Led&2') udpSocket =QUdpSocket() udpSocket.bind(portOut, QUdpSocket.ShareAddress) quitButton.clicked.connect(close) commutTimerButton.clicked.connect(commutTimer) led0Button.clicked.connect(bouton0) led1Button.clicked.connect(bouton1) led2Button.clicked.connect(bouton2) ''' app.connect(quitButton,QtCore.SIGNAL('clicked()'), close) app.connect(commutTimerButton, QtCore.SIGNAL('clicked()'), commutTimer) app.connect(led0Button,QtCore.SIGNAL('clicked()'), bouton0) app.connect(led1Button,QtCore.SIGNAL('clicked()'), bouton1) app.connect(led2Button,QtCore.SIGNAL('clicked()'), bouton2) ''' buttonLayout =QHBoxLayout() buttonLayout.addStretch(1) buttonLayout.addWidget(quitButton) buttonLayout.addWidget(commutTimerButton) buttonLayout.addStretch(1) button1Layout =QHBoxLayout() button1Layout.addStretch(1) button1Layout.addWidget(led0Button) button1Layout.addStretch(1) button1Layout.addWidget(led1Button) button1Layout.addStretch(1) button1Layout.addWidget(led2Button) button1Layout.addStretch(1) #http://koor.fr/Python/CodeSamplesQt/PyQtSlider.wp slider1 = QSlider(Qt.Horizontal); slider1.setMinimum(-70) slider1.setMaximum(70) slider1.setGeometry( 10, 10, 600, 40 ) slider1.valueChanged.connect(slider1ValueChanged ) slider1.setValue( 0 ) #labelSlider1Value=QLabel( ) #labelSlider1Value.setGeometry(250, 50, 50, 35) #labelSlider1Value.setText( str( slider1.getValue() ) ) sliderLayout =QHBoxLayout() sliderLayout.addStretch(1) sliderLayout.addWidget(slider1) sliderLayout.addStretch(1) #sliderLayout.addWidget(labelSlider1Value) #sliderLayout.addStretch(1) slider2 = QSlider(Qt.Horizontal); slider2.setMinimum(-70) slider2.setMaximum(70) slider2.setGeometry( 10, 10, 600, 40 ) slider2.valueChanged.connect(slider2ValueChanged ) slider2.setValue( 0 ) sliderLayout.addWidget(slider2) sliderLayout.addStretch(1) mainLayout = QVBoxLayout() mainLayout.addLayout(buttonLayout) mainLayout.addLayout(button1Layout) mainLayout.addLayout(sliderLayout) mainLayout.addWidget(statusLabel) w.setLayout(mainLayout) chaine='@BVDP2019: Port Em '+str(portOut) +' vers IP: '+str(destIP) w.setWindowTitle(chaine) #timer adapted from example 1 of https://www.programcreek.com/python/example/52106/PyQt4.QtCore.QTimer timer = QtCore.QTimer() #app.connect(timer, QtCore.SIGNAL('timeout()'), timerUpdate) timer.timeout.connect(timerUpdate) timer.setInterval(100) timer.start() w.setGeometry(posx,posy,sizex,sizey) #donne le focus au bouton 1 led0Button.setDefault(True) w.show() app.exec_()
J'avais eu un Problème sur pc dev staubli, pip s'est cassé car fenêtre terminal fermée pendant l'upgrade de pip:
C:\Users\bertrand.vandeportae\Downloads>python simu_sensor_2_qt5.py Traceback (most recent call last): File "C:\Program Files\Python39\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Program Files\Python39\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "\\iut.iut-tlse3.fr\ponsan\profil\p-ge2i\bertrand.vandeportae\redirections_10\Appdata\Python\Python39\site-packages\pip\__main__.py", line 29, in <module> from pip._internal.cli.main import main as _main File "\\iut.iut-tlse3.fr\ponsan\profil\p-ge2i\bertrand.vandeportae\redirections_10\Appdata\Python\Python39\site-packages\pip\_internal\cli\main.py", line 9, in <module> from pip._internal.cli.autocompletion import autocomplete File "\\iut.iut-tlse3.fr\ponsan\profil\p-ge2i\bertrand.vandeportae\redirections_10\Appdata\Python\Python39\site-packages\pip\_internal\cli\autocompletion.py", line 10, in <module> from pip._internal.cli.main_parser import create_main_parser File "\\iut.iut-tlse3.fr\ponsan\profil\p-ge2i\bertrand.vandeportae\redirections_10\Appdata\Python\Python39\site-packages\pip\_internal\cli\main_parser.py", line 8, in <module> from pip._internal.cli import cmdoptions File "\\iut.iut-tlse3.fr\ponsan\profil\p-ge2i\bertrand.vandeportae\redirections_10\Appdata\Python\Python39\site-packages\pip\_internal\cli\cmdoptions.py", line 21, in <module> from pip._vendor.packaging.utils import canonicalize_name ModuleNotFoundError: No module named 'pip._vendor.packaging' Traceback (most recent call last): File "C:\Users\bertrand.vandeportae\Downloads\simu_sensor_2_qt5.py", line 14, in <module> reqs = subprocess.check_output([sys.executable, '-m', 'pip', 'freeze']) File "C:\Program Files\Python39\lib\subprocess.py", line 424, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "C:\Program Files\Python39\lib\subprocess.py", line 528, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['C:\\Program Files\\Python39\\python.exe', '-m', 'pip', 'freeze']' returned non-zero exit status 1. C:\Users\bertrand.vandeportae\Downloads>
explorateur Windows: Affichage , cocher “éléments masqués”
copier l'URL: C:\Users\bertrand.vandeportae\AppData
(il y a des correspondances bidons entre les noms affichés par explorateur et le vrai chemin…)
je ne trouve pas les dossiers python
doc sur: https://www.codegrepper.com/code-examples/python/install+pip+windows+10+python+3.9
télécharger le script de réparation: https://bootstrap.pypa.io/get-pip.py puis l'exécuter:
python get-pip.py
Defaulting to user installation because normal site-packages is not writeable Collecting pip Downloading pip-21.3.1-py3-none-any.whl (1.7 MB) |████████████████████████████████| 1.7 MB 3.2 MB/s Collecting wheel Downloading wheel-0.37.0-py2.py3-none-any.whl (35 kB) Installing collected packages: wheel, pip WARNING: The script wheel.exe is installed in '\\iut.iut-tlse3.fr\ponsan\profil\p-ge2i\bertrand.vandeportae\redirections_10\Appdata\Python\Python39\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. WARNING: The scripts pip.exe, pip3.9.exe and pip3.exe are installed in '\\iut.iut-tlse3.fr\ponsan\profil\p-ge2i\bertrand.vandeportae\redirections_10\Appdata\Python\Python39\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. Successfully installed pip-21.3.1 wheel-0.37.0 WARNING: You are using pip version 21.2.3; however, version 21.3.1 is available. You should consider upgrading via the 'C:\Program Files\Python39\python.exe -m pip install --upgrade pip' command.
SHIFT+WINDOWS+S
rapid connecté en ethernet à prise 41 ou 42 (gomettes rouges) 2: enp0s25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether a0:8c:fd:a7:a0:52 brd ff:ff:ff:ff:ff:ff inet 172.16.8.58/24 brd 172.16.8.255 scope global dynamic enp0s25 valid_lft 297sec preferred_lft 297sec inet6 fe80::90ba:7bbd:724c:1921/64 scope link valid_lft forever preferred_lft forever
est ce un bail dhcp static?
il faut mettre la version SRS 2022.6.1
dans S:\commun\BUT2\installeur_SRS2022\Installeur_Staubli2022.6.1\setup.exe
tout installer
dans S:\commun\BUT2\installeur_SRS2022\Installeur_Emulateur_s8.11Cs9BS2229\setup.exe
tout installer
s8.11Cs9BS2229
Fichier→Configuration
Fichier→Aide→Ouvrir l'outils de mise à jour en ligne (afficher les mises à jour Emulateur/robot)
(show online updater)
s8.11Cs9BS2229
et télécharger +installer
a mis l'installer dans:
C:\Users\bertrand.vandeportae\AppData\Local\Temp\0lpkbaib.iv1
installe dans
C:\Program Files (x86)\Staubli\CS8\s8.11cs9_BS2229\
redemarrer SRS 2022 pour qu'il prenne en compte la nouvelle version d'emulateur
tx2 60 Fixation sol Horizontal base cable outlet
H:\test_projet_staubli_2019_2022 H:\test_projet_staubli_2019_2022\CellStylo_vide\CellStylo_vide
pour repasser à 2019
CellStylo.cell:
<?xml version="1.0" encoding="utf-8"?> <Cell version="2019.10.1" xmlns="http://www.staubli.com/robotics/cell/1"> <File path="Controller1\Controller1.controller" /> </Cell>
Controller1/Controller1.controller
<?xml version="1.0" encoding="utf-8"?> <LocalController xmlns="http://www.staubli.com/robotics/controller/1"> <Version>s8.11Cs9_BS2229</Version> <Properties> <Property type="SRS.VAL3Studio.Services.RobotSkinControllerProperty"> <RobotSkin xmlns="http://www.staubli.com/robotics/robotskincontrollerproperty/1">TX2_60-HB-WS</RobotSkin> </Property> <Property type="SRS._3DView.Services.TcpControllerProperty"> <Tcp Name="Tool1.handler" xmlns="http://www.staubli.com/robotics/tcpcontrollerproperty/1" /> </Property> </Properties> <Target hostname="" name="Default(1)"> <Context type="RemoteConnection" port="5653" username="default" /> <Context type="WebRemoteMaintenance" port="80" username="default" /> <Context type="VncRemoteMaintenance" port="5900" username="default" /> </Target> </LocalController>
je vire du projet de mary: tous les
<ABSOLUTE_FILENAME>P:/s3aii/s3aii2/mari_elyamin/SAE_S4/CELL_IUT0/CAD/cellule_simplifiee_1.wrl</ABSOLUTE_FILENAME>
mais import cellule foire…
Importer les paramètres: Ignorer
ne trouve pas le robot dans
C:\Users\Public\Documents\Staubli.Public\3D\3.0\
tx2_60-v1_0.zip
dans message pour la vue 3D:
Une erreur s’est produite lors de l’actualisation du catalogue 'Default: System.ArgumentException: Le nom de répertoire C:\Users\Public\Documents\Staubli.Public\3D\3.0 n'est pas valide. à System.IO.FileSystemWatcher..ctor(String path, String filter) à ..(IObserver`1 ) à System.Reactive.Linq.QueryLanguage.CreateWithDisposableObservable`1.SubscribeCore(IObserver`1 observer) dans /_/Rx.NET/Source/src/System.Reactive/Linq/QueryLanguage.Creation.cs:ligne 35 à System.Reactive.ObservableBase`1.Subscribe(IObserver`1 observer) dans /_/Rx.NET/Source/src/System.Reactive/ObservableBase.cs:ligne 58' GPU utilisé : NVIDIA NVS 310 Composant introuvable : tx2_60 Aucun robot n’a été trouvé dans les catalogues pour : 'C:\Users\Public\Documents\Staubli.Public\3D\3.0\tx2_60-v1_0.zip'
je crée une nouvelle cellule a partir du controleur distant (penible car récupère toute l'arborescence) Cell2022
il y a les fichiers wrl etc de 2019 dans
C:\Users\Public\Documents\Staubli.Public\3D\2.0\Robots
dans lequel il y a un uninstaller pour “robots library for staubli robotic suite”
le zip apparait (non ce n'est pas le même) dans: S:\commun\BUT2\installeur_SRS2022\Installeur_Staubli2022.6.1\CAD\cs9
dans C:\Program Files\Staubli\SRS 2022\readme.pdf
il y a la procédure d'installation (y compris en mode silencieux)
bitdefender bloque certains executables Autoriser l'accés
je les trouve sur le pc e21 dans c:\Utilisateurs\Public\Documents publics\3D\3.0\
transfert par s3aii/bonat_alexis, je le dossier 3D/3.0 et la 3D fonctionne après redémarrage…
copier https://bvdp.inetdoc.net/files/srs2022/3.0
ou copier S:\commun\BUT2\installeur_SRS2022\3.0
pour avoir tx2_60-v1_0.zip dans C:\Users\Public\Documents\Staubli.Public\3D\3.0
CTRL+X sur fenêtre start.pgx
Onglet panneau de contrôle, cliquer sur play vert
dans le pendant, régler en mode manuel (en bas à droite)
dans le pendant, fenêtre val3, faire “stop” puis “oui” sur l'application pour pouvoir l’exécuter à nouveau sinon erreur 405 (Not Allowed)
H:\test_projet_staubli_2019_2022\CellStylo_vide_2022
zippé dans https://bvdp.inetdoc.net/files/srs2022/CellStylo_vide_2022.zip
dans S:\commun\BUT2\installeur_SRS2022\Installeur_Staubli2022.8.1\setup.exe
tout installer
dans S:\commun\BUT2\installeur_SRS2022\Installeur_Emulateur_s8.11Cs9BS2229\setup.exe
tout installer
copier le dossier S:\commun\BUT2\installeur_SRS2022\3.0 dans C:\Users\Public\Documents\Staubli.Public\3D\
pour avoir tx2_60-v1_0.zip dans C:\Users\Public\Documents\Staubli.Public\3D\3.0
demander à Jerome d'installer sur machine e04 en salle C04
S:\commun\BUT2\installeur_SRS2022\Installeur_Staubli2022.8.1\setup.exe /S S:\commun\BUT2\installeur_SRS2022\Installeur_Emulateur_s8.11Cs9BS2229\setup.exe /S mkdir C:\Users\Public\Documents\Staubli.Public\3D\3.0 xcopy /hievry S:\commun\BUT2\installeur_SRS2022\3.0 C:\Users\Public\Documents\Staubli.Public\3D\3.0