Zajęcia rozpoczęliśmy od zapoznania się z instrukcją do PLNXT. Ściągnęliśmy plik z modułem PLNXT M3.1 (w późniejszym okresie laboratorium PLNXT M0) oraz przystąpiliśmy do jego konfiguracji. Na wstępie podpięliśmy bluetooth do komputera oraz wykryliśmy Franka. Udało nam się sparować urządzenia za pierwszym razem. Edytowaliśmy plik plnxt.pl tak aby znalazła się w nim linijka
nxt_robot_definition(franek,'/dev/rfcomm6',bt,off,on_demand,17.5,11,'C','B','A',false,'S1','S2','S3','S4').
Po wstępnej konfiguracji wykonaliśmy w powłoce prologa swipl predykat nxt_open. Niestety predykat nie zakończył swego działania (nie zwracał komunikatów po bardzo długim czasie). W tym momencie straciliśmy połączenie z Frankiem, którego już nie odzyskaliśmy do końca zajęć mimo naszego uporu, pomysłów i wielokrotnych prób resetowania urządzeń.
student@robo2:~$ rfcomm rfcomm1: 00:16:53:05:85:E2 channel 1 clean rfcomm2: 00:16:53:07:AC:D5 channel 1 clean rfcomm3: 00:16:53:07:A3:9F channel 1 clean rfcomm4: 00:16:53:07:A1:38 channel 1 clean rfcomm5: 00:16:53:07:15:CD channel 1 clean rfcomm6: 00:16:53:07:15:6F channel 1 closed rfcomm7: 00:16:53:09:B4:BA channel 1 clean rfcomm8: 00:16:53:09:B4:11 channel 1 clean rfcomm9: 00:16:53:09:AD:B1 channel 1 clean rfcomm10: 00:16:53:09:B0:B8 channel 1 clean student@robo2:~$ cd Pulpit/plnxt-M0/ student@robo2:~/Pulpit/plnxt-M0$ pl Welcome to SWI-Prolog (Multi-threaded, Version 5.4.7) Copyright (c) 1990-2003 University of Amsterdam. SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. Please visit http://www.swi-prolog.org for details. For help, use ?- help(Topic). or ?- apropos(Word). ?- [plnxt]. % threads compiled into threads 0.00 sec, 8,252 bytes % nxt_sensomoto compiled into nxt_sensomoto 0.00 sec, 21,816 bytes % lib/nxt_movement compiled into nxt_movement 0.00 sec, 37,020 bytes % lib/nxt_actions_serial compiled into nxt_actions_serial 0.01 sec, 33,492 bytes % plnxt compiled 0.02 sec, 72,644 bytes Yes ?- nxt_open. [1]+ Stopped pl student@robo2:~/Pulpit/plnxt-M0$ pl Welcome to SWI-Prolog (Multi-threaded, Version 5.4.7) Copyright (c) 1990-2003 University of Amsterdam. SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. Please visit http://www.swi-prolog.org for details. For help, use ?- help(Topic). or ?- apropos(Word). ?- [plnxt]. % threads compiled into threads 0.01 sec, 8,252 bytes % nxt_sensomoto compiled into nxt_sensomoto 0.01 sec, 21,816 bytes % lib/nxt_movement compiled into nxt_movement 0.01 sec, 37,020 bytes % lib/nxt_actions_serial compiled into nxt_actions_serial 0.01 sec, 33,492 bytes % plnxt compiled 0.02 sec, 72,644 bytes Yes ?- nxt_open.
Brak…