neurali:ros_publishers_and_subscribers
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
neurali:ros_publishers_and_subscribers [2016/07/09 15:12] – [Creare package] profpro | neurali:ros_publishers_and_subscribers [2020/06/08 22:20] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | < [[neurali: | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ======Esempio con istruzioni====== | ||
+ | * {{http:// | ||
+ | * {{http:// | ||
+ | |||
+ | Il secondo, in python, provato e testato, seguendo queste istruzioni | ||
+ | ==== Creare workspace==== | ||
+ | |||
+ | http:// | ||
+ | |||
+ | source / | ||
+ | echo $ROS_PACKAGE_PATH | ||
+ | |||
+ | mkdir -p ~/ | ||
+ | cd ~/ | ||
+ | catkin_init_workspace | ||
+ | |||
+ | |||
+ | |||
+ | ==== Creare package==== | ||
+ | |||
+ | http:// | ||
+ | |||
+ | cd ~/ | ||
+ | catkin_create_pkg beginner_tutorials std_msgs rospy.... | ||
+ | |||
+ | cd ~/catkin_ws | ||
+ | catkin_make | ||
+ | |||
+ | |||
+ | >> in futuro aggiungere altre dipendenze come: husky pylab nunmpy ANNarchy ma dentro al file package.xml | ||
+ | < | ||
+ | < | ||
+ | |||
+ | |||
+ | source ~/ | ||
+ | echo $ROS_PACKAGE_PATH | ||
+ | |||
+ | ====Codice==== | ||
+ | |||
+ | |||
+ | http:// | ||
+ | |||
+ | |||
+ | cd ~/catkin_ws | ||
+ | roscd beginner_tutorials | ||
+ | mkdir scripts | ||
+ | roscd beginner_tutorials/ | ||
+ | |||
+ | wget https:// | ||
+ | chmod +x talker.py | ||
+ | wget https:// | ||
+ | chmod +x listener.py | ||
+ | |||
+ | |||
+ | ====Compilazione==== | ||
+ | |||
+ | cd ~/catkin_ws | ||
+ | catkin_make | ||
+ | |||
+ | ==== Installazione ==== | ||
+ | |||
+ | catkin_make install | ||
+ | |||
+ | ==== Esecuzione ==== | ||
+ | |||
+ | (servono quattro terminali inizializzati) | ||
+ | |||
+ | source / | ||
+ | source ~/ | ||
+ | |||
+ | (ogni comando va eseguito in un diverso terminale) | ||
+ | |||
+ | roscore | ||
+ | rosrun beginner_tutorials talker.py | ||
+ | rosrun beginner_tutorials listener.py | ||
+ | rostopic echo chatter | ||
+ | |||
+ | |||
+ | |||