User Tools

Site Tools


neurali:ros_publishers_and_subscribers

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
neurali:ros_publishers_and_subscribers [2016/07/09 21:31]
profpro [Compilazione]
neurali:ros_publishers_and_subscribers [2020/06/08 22:20] (current)
Line 1: Line 1:
 +< [[neurali:ros]]
 +
 +
 +
 +
 +======Esempio con istruzioni======
 +  * {{http://wiki.ros.org/roscpp/Overview/Publishers%20and%20Subscribers| doc c++}}
 +  * {{http://wiki.ros.org/rospy_tutorials/Tutorials/WritingPublisherSubscriber| doc python}}
 +
 +Il secondo, in python, provato e testato, seguendo queste istruzioni
 +==== Creare workspace====
 +
 +http://wiki.ros.org/catkin/Tutorials/create_a_workspace
 +
 +  source /opt/ros/indigo/setup.bash
 +  echo $ROS_PACKAGE_PATH
 +
 +  mkdir -p ~/catkin_ws/src
 +  cd ~/catkin_ws/src
 +  catkin_init_workspace
 +
 +
 +
 +==== Creare package====
 +
 +http://wiki.ros.org/ROS/Tutorials/CreatingPackage
 +
 +  cd ~/catkin_ws/src
 +  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
 +  <build_depend>python-numpy</build_depend>
 +    <run_depend>python-numpy</run_depend>
 +
 +
 +  source ~/catkin_ws/devel/setup.bash
 +  echo $ROS_PACKAGE_PATH
 +
 +====Codice====
 +
 +
 +http://wiki.ros.org/rospy_tutorials/Tutorials/WritingPublisherSubscriber
 +
 +
 +  cd ~/catkin_ws
 +  roscd beginner_tutorials
 +  mkdir scripts
 +  roscd beginner_tutorials/scripts/
 +
 +  wget https://raw.github.com/ros/ros_tutorials/kinetic-devel/rospy_tutorials/001_talker_listener/talker.py
 +  chmod +x talker.py
 +  wget https://raw.github.com/ros/ros_tutorials/kinetic-devel/rospy_tutorials/001_talker_listener/listener.py
 +  chmod +x listener.py
 +
 +
 +====Compilazione====
 +
 +  cd ~/catkin_ws
 +  catkin_make
 +
 +==== Installazione ====
 +
 +  catkin_make install
 +
 +==== Esecuzione ==== 
 +
 +(servono quattro terminali inizializzati)
 +
 +  source /opt/ros/indigo/setup.bash
 +  source ~/catkin_ws/devel/setup.bash
 +
 +(ogni comando va eseguito in un diverso terminale)
 +
 +  roscore
 +  rosrun beginner_tutorials talker.py
 +  rosrun beginner_tutorials listener.py
 +  rostopic echo chatter
 +
 +
 +
  
neurali/ros_publishers_and_subscribers.txt ยท Last modified: 2020/06/08 22:20 (external edit)