ROS Tutorials
Practicing writing a wiki page- all information below is incomplete until otherwise noted.
Aside to editor, to improve:
This tutorial assumes that you will be working in ROS-hydro on Ubuntu 12.04. This wiki is based on the tutorials given here.
Contents
- 1 Beginner Level
- 1.1 Writing a Simple Publisher and Subscriber (C++)
- 1.2 Writing a Simple Publisher and Subscriber (Python)
- 1.3 Examining the Simple Publisher and Subscriber
- 1.4 Writing a Simpler Service and Client (C++)
- 1.5 Writing a Simpler Service and Client (Python)
- 1.6 Examining the Simpler Service and Client
- 1.7 Recording and Playing Back Data
- 1.8 Getting Started with roswtf
- 1.9 Navigating the ROS wiki
- 1.10 Where Next?
- 2 Intermediate Level
Beginner Level
Open the terminal. To complete each step, type in the following commands in the order shown.
- Installing and configuring your ROS environment
- Navigating the ROS Filesystem
- Creating a ROS Package
- Building a ROS Package
- Understanding ROS Nodes
- Understanding ROS Topics
- Understanding ROS Services and Parameters
- Using rqt_consol and roslaunch
Writing a Simple Publisher and Subscriber (C++)
Writing the Publisher Node
1) In a terminal, move to your beginner_tutorials folder:
cd ~/catkin_ws/src/beginner_tutorials
2) Create the file talker.cpp:
gedit src/talker.cpp
3) In the gedit editor, paste all from this link. Save the file and close the editor. For information on what is inside this file, see this link. In a nutshell, it initializes the ROS system, advertise what we are doing, and finally loop what we are doing.
Writing the Subscriber Node
1) In a terminal, move to your beginner_tutorials folder:
cd ~/catkin_ws/src/beginner_tutorials
2) Create the file listener.cpp:
gedit src/listener.cpp
3) In the gedit editor, paste all from this link. Save the file and close the editor. For information on what is inside this file, see this link. In a nutshell, it initializes the ROS system, subscribes to the topic 'chatter', spin (wait for messages), when message arrives call the chatterCallback() function.
Building Nodes