Viewing the Code
roscpp_tutorials contains a number of tutorial applications for programming with roscpp.
You can browse these tutorials by roscd-ing to the roscpp_tutorials package, i.e.
roscd roscpp_tutorials
There are also several Wiki-based tutorials, listed below.
Beginner Tutorials
- Writing a Simple Publisher and Subscriber
This tutorial covers how to write a publisher and subscriber node in C++.
- Writing a Simple Service and Client
This tutorial covers how to write a service and client node in C++.
- Using Parameters in roscpp
This tutorial will show you the NodeHandle parameter API, allowing you to manipulate parameters from the Parameter Server.
- Accessing Private Names from a NodeHandle
This tutorial will show you how to access private Names with roscpp's NodeHandle API.
- Using Class Methods as Callbacks
Most of the tutorials use functions in their examples, rather than class methods. This is because using functions is simpler, not because class methods are unsupported. This tutorial will show you how to use class methods for subscription and service callbacks.
Intermediate Tutorials
- Understanding Timers
This tutorial explains roscpp Timers, which allow you to schedule a callback to happen periodically.