neurali:ros_configurazione_network
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
neurali:ros_configurazione_network [2016/07/04 19:18] – profpro | neurali:ros_configurazione_network [2020/06/08 22:20] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | < [[neurali: | ||
+ | ====== Configurazione network ====== | ||
+ | |||
+ | |||
+ | http:// | ||
+ | |||
+ | Un sistema ROS può essere composto da centinaia di nodi, sparsi su diversi calcolatori. | ||
+ | I nodi potrebbero aver bisogno di comunicare tra loro. | ||
+ | |||
+ | Esempio con due computer, su rete locale, ma vale ovunque: | ||
+ | * marvin.example.com : 192.168.1.1 | ||
+ | * hal.example.com : 192.168.1.2 | ||
+ | |||
+ | NOTA: ;;;; Solo uno dei due esegue ros core;;;; | ||
+ | |||
+ | =====Testare la rete===== | ||
+ | Pingare se stesso e gli altri (tutte le macchine reciprocamente) | ||
+ | |||
+ | mario@hal ~ $ hostname | ||
+ | mario@hal ~ $ ping hal | ||
+ | mario@hal ~ $ ping 192.168.1.2 | ||
+ | mario@hal ~ $ ping marvin | ||
+ | |||
+ | In certi casi si può modificare il file /etc/hosts, oppure usare una variabile di ambiente che specifica dove si trova il server ros core | ||
+ | |||
+ | export ROS_IP=10.0.0.1 | ||
+ | |||
+ | Nel caso di test locali, prima di avviare ROS CORE impostare | ||
+ | |||
+ | export ROS_HOSTNAME=localhost | ||
+ | export ROS_MASTER_URI=http:// | ||
+ | |||
+ | =====Avviare ROS===== | ||
+ | |||
+ | http:// | ||
+ | |||
+ | * Tutti i node devono essere configurati per usare lo stesso master, tramite ROS_MASTER_URI. | ||
+ | * < | ||
+ | * **Avviare master**: //roscore// va avviato sulla macchina hal | ||
+ | * avviare un // | ||
+ | * < | ||
+ | * avviare un //talker//: | ||
+ | * < | ||
+ | |||
+ | Ora per magia, grazie all' | ||
+ | |||
+ | ;;Non devo scrivere applicazioni che usano il protocollo TCP o UDP.;; Basta che sull' | ||
+ | |||
+ | Provare: | ||
+ | |||
+ | rostopic list | ||
+ | |||
+ | Esempio di talker e Subscriber | ||
+ | |||
+ | http:// | ||
+ | ---- | ||
+ | |||
+ | Nel mio computer, quando avvio ;; | ||
+ | |||
+ | < | ||
+ | started roslaunch server http:// | ||
+ | ros_comm version 1.11.13 | ||
+ | |||
+ | SUMMARY | ||
+ | ======== | ||
+ | PARAMETERS | ||
+ | * /rosdistro: indigo | ||
+ | * / | ||
+ | |||
+ | NODES | ||
+ | auto-starting new master | ||
+ | process[master]: | ||
+ | ROS_MASTER_URI=http:// | ||
+ | </ | ||
+ | |||
+ | Elenco nodi (hostname, nel mio caso vale pcmobile) | ||
+ | |||
+ | rosnode machine pcmobile | ||
+ | |||
+ | < | ||
+ | / | ||
+ | / | ||
+ | /gazebo | ||
+ | / | ||
+ | /rosout | ||
+ | / | ||
+ | /twist_mux | ||
+ | </ |
neurali/ros_configurazione_network.txt · Last modified: 2020/06/08 22:20 by 127.0.0.1