February 2020
Intermediate to advanced
432 pages
10h 50m
English
Can a node talk and listen at the same time as a real human does? Well, if ROS is a framework for robotics, it should be possible. Let's explore this:
T1 $ roscoreT2 $ rosrun ros_basics doubler.py
/doubler is a node that subscribes to the /number topic, as specified in these two lines of the doubler.py script:
rospy.init_node('doubler')...sub = rospy.Subscriber('number', Int32, callback)...
Additionally, /doubler publishes its result in the /doubled topic:
...pub = rospy.Publisher('doubled', Int32, queue_size=10)
You will notice that nothing happens, because it needs to be fed with a number ...