Difference between revisions of "Examining the Simple Publisher and Subscriber"

From Lofaro Lab Wiki
Jump to: navigation, search
(Created page with "1) In a new terminal run roscore: <nowiki>roscore</nowiki> 2) '''In a new terminal''' (terminal 2) go to your workspace and source your devel file(if you used catkin like...")
 
m
 
Line 6: Line 6:
 
source ./devel/setup.bash</nowiki>
 
source ./devel/setup.bash</nowiki>
  
3) In terminal 2, run the talker:
+
3) In terminal 2, run the talker.
  <nowiki>rosrun beginner_tutorials talker</nowiki>
+
 
 +
For C++:
 +
<nowiki>rosrun beginner_tutorials talker</nowiki>
 +
For Python:
 +
<nowiki>rosrun beginner_tutorials talker.py</nowiki>
 
This terminal should begin to print "hello world" messages.
 
This terminal should begin to print "hello world" messages.
  
Line 15: Line 19:
  
 
5) In terminal 3, run the listener:
 
5) In terminal 3, run the listener:
  <nowiki>rosrun beginner_tutorials listener</nowiki>
+
 
 +
For C++:
 +
<nowiki>rosrun beginner_tutorials listener</nowiki>
 +
For Python:
 +
<nowiki>rosrun beginner_tutorials listener.py</nowiki>
 
This terminal should begin to print "I heard hello world" messages.
 
This terminal should begin to print "I heard hello world" messages.

Latest revision as of 14:02, 23 October 2014

1) In a new terminal run roscore:

  roscore

2) In a new terminal (terminal 2) go to your workspace and source your devel file(if you used catkin like this series of tutorials):

  cd ~/catkin_ws
source ./devel/setup.bash

3) In terminal 2, run the talker.

For C++:

rosrun beginner_tutorials talker

For Python:

rosrun beginner_tutorials talker.py

This terminal should begin to print "hello world" messages.

4) In a new terminal (terminal 3) go to your workspace and source your devel file(if you used catkin like this series of tutorials):

  cd ~/catkin_ws
source ./devel/setup.bash

5) In terminal 3, run the listener:

For C++:

rosrun beginner_tutorials listener

For Python:

rosrun beginner_tutorials listener.py

This terminal should begin to print "I heard hello world" messages.