I would like to see the files (the source code) where they are being published from (or where they have been created). Is this possible somehow?
In general (and with "a single command")? No, I would say you can't. Not with any of the command line tools that are provided "as part of a standard ROS install".
If however you know which nodes are publishing or subscribing to those topics (note: topics are not "created", in fact, in some sense they do not really even "exist"), you could:
- figure out the package that hosts the/those node(s)
- retrieve the source code of the package
- use something like
grep
to find occurences of the topic name in the code
But note though: due to remapping and dynamic topic name creation, there is no guarantee at all that you will be able to find the publishers this way. Especially with Python nodes, as Python is so flexible that many "crazy" things can be done at runtime making this sort of sleuthing rather difficult.
I see certain topics which I can't find anywhere inside the ROS package which is supposed to have created them.
nitpick: nodes can be publishers. Packages can't.
Also note that rostopic list
shows you a topic name in three cases:
- topic is published to
- topic is subscribed to
- topic is both published and subscribed to
So it could be that a subscriber causes a topic to appear in rostopic list
, and that subscriber could be "anywhere".
Edit:
I'm trying to use this ROS package. After having launched the Pioneer 3AT, if I type rostopic list
, I see a bunch of topics related to the Pioneer, but I can't find the place where they are being published from.
Looking at the repository you linked, two things stand out:
- this is not a package, but an entire workspace with one package (
pioneer3at_simulation
) and two git submodules pointing to other repositories (with even more packages) - the main package
pioneer3at_simulation
provides a collection of .launch
files (here) that together start (among other things): gazebo
and something called teleop_joy
.
Gazebo then is configured to load various .world
files, urdf_spawner
is then used to inject a model of a 3-AT, that loads multiple Gazebo plugins, etc, etc. I haven't checked the two repositories linked in via the git submodules, but I expect those to also either provide additional nodes and/or plugins.
Gazebo, the teleop nodes and all of the Gazebo plugins will both publish and subscribe to topics, and those will appear in rostopic list
.
So in order to find "the file where a specific topic was created", you'd have to check the sources of all those packages.
Edit2: I haven't checked, but there is a small chance that you could actually figure out where a topic is published or subscribed to without grep
ping through source code: the ROS log(s). It might be possible to print out the source line nr (when configured ... (more)