Where can I find the actual source code for the tf2 demo?
At the bottom of the page of the tutorial you link, there is this:
Now that we have examined the turtle_tf2_demo, let's look at how to write the broadcaster (Python) (C++) for this demo.
Following that link, we come to the Writing a tf2 broadcaster (Python) page and the Create a learning_tf2 package section states (emphasis mine):
First we will create a catkin package that will be used for this tutorial and the following ones. This package called learning_tf2 will depend on tf2, tf2_ros, roscpp, rospy and turtlesim. Code for this tutorial is stored here.
I'm not entirely sure which "tf2 demo" you refer to, but it would seem there is at least a link to the turtle_tf2
package.
Note that both the Python and the C++ sources are hosted by that same package.
I have done roscd for all the packages that are named (around five of them as I follow the trail) and none of them have any source code. They have .launch, .msg, .xml files but no .cpp or .py files.
Packages you install using apt
or apt-get
(as instructed by the Installing the Demo section) never include source code -- or at least: it'd be rarely the case.
roscd
takes you to the package directory, which is the directory which contains the manifest (ie: package.xml
). For packages installed using apt
, that is the directory in /opt/ros/$distro/share
. Only resources are installed there, no binaries, libraries, headers or source code.
(I write "never", but in reality a package author can do whatever he wants, including installing source code in locations where you'd normally only find binaries. It would be highly irregular and undesirable though)