You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Clarify distinction between examples, demos, tutorials #406
demonstrations of capabilities (often used early on to prove to ourselves that something new was working), not a copy-paste ready example and not for education
was built and tested on every change of the core and had comprehensive automated tests
ros2/examples:
a cookbook of ready to copy-paste examples that are a good starting point for a variety of things but do not have lots of comments (because they're bad for copy-paste) and little-to-no extra material with them that explains them, they would be somewhat self-evident
was built on every change, but lacked automated tests in most cases to keep things simple for copy-paste
ros2/tutorials:
code that is heavily commented (with tags to make the snippets of the tutorial extractable, like we had in ROS 1 tutorials) and was integrated into step by step guides (tutorials), equivalent of ROS 1's ros/ros_tutorials repo
these would be built and tested, with comprehensive automated tests like the demos as it was very important that the tutorials kept working as expected
I think ros2/tutorials was abandoned because we didn't have anyone working on the official tutorials at the time, and despite the rationale above, when we got around to the tutorials no one wanted to add more code and maintain ros2/tutorial (my recollection, but I could be misremembering). Which I think is a shame personally, because I think the above rationale for each repo makes sense.
Ideally, in my opinion, we'd start to get rid of demos and either just have examples with a few of the examples purpose built to be used in tutorials, or resurrect ros2/tutorials and use that as the place where tutorial code lives and keep the examples/cookbook separate. Maybe also rename it to ros2/cookbook as I think that implies better what its purpose is. But those are just my thoughts on what we should do if we were starting from scratch, and I don't know if it would be worth the disruption at this point.
More to your specific question, demos (specifically demo_nodes_cpp and _py) became what we used for tutorials, and examples was meant to stay as a cookbook and not be used in tutorials, but then people started doing that anyways. And so now both contain some stuff used in tutorials, but neither is used for tutorials exclusively.
I agree with @wjwwood 's distinctions laid out above, reiterating in my words as:
examples: small self-contained snippets demonstrating correct usage of end-user APIs and features from the core libraries.
should not have much if any commenting, instead aiming to be self-explanatory
should aim to cover the "core API" as much as possible.
conform to best practices to encourage their spread
demos: more in-depth explorations of complex features, edge cases, and integration cases
2. not for education - these are better compared to integration tests
tutorials: Archive this repository in favor of containing tutorials within ros2_documentation
ros2_documentation: Entrypoint to the documentation, contains
3. Installation instructions
4. Information about the ROS 2 project as a whole
5. High level concepts that are independent of a specific language
6. Guided tutorials with code
To reach that goal, I identify these action items:
Add a clear blurb in each repository's README.md, mentioning what code belongs and does not belong, in that repository, pointing to the others to extend that
Migrate most of demo_nodes_cpp and demo_nodes_py from demos to examples, cleaning up where necessary, to get much of the desired API snipped coverage
Officially archive tutorials with a note that the content is being maintained at ros2_documentation
Add a "tutorials source" space to ros2_documentation repository, with lint & build & test to keep the code generally working
Pull most if not all source snippets out of rst into files in this space, with literalinclude
I think it better to keep tutorial text and code in same repo, so less "PR ballet"
Reacted by Shane Loretz, David Morilla Cabello and Christophe Bedard
Should the best practices be explained somehow in ros2_documentation?
Yes, I think so 100 percent! First and foremost the concept documentation and tutorials should always demonstrate good practices, as long as it doesn't complicate the code more than necessary for the point being illustrated at the moment.
Then, for more in depth discussion of those best practices, dedicated page(s) makes sense to me.
Activity
wjwwood commentedon Mar 27, 2025
Well, we also had ros2/tutorials (https://github.com/ros2/tutorials) at one point, which was supposed to be for tutorials, but we've sort of abandoned that for now.
The original logic (as I remember it) was this:
ros/ros_tutorialsrepo// %Tagsyntax) https://raw.githubusercontent.com/ros/ros_tutorials/kinetic-devel/roscpp_tutorials/talker/talker.cppI think ros2/tutorials was abandoned because we didn't have anyone working on the official tutorials at the time, and despite the rationale above, when we got around to the tutorials no one wanted to add more code and maintain ros2/tutorial (my recollection, but I could be misremembering). Which I think is a shame personally, because I think the above rationale for each repo makes sense.
Ideally, in my opinion, we'd start to get rid of demos and either just have examples with a few of the examples purpose built to be used in tutorials, or resurrect ros2/tutorials and use that as the place where tutorial code lives and keep the examples/cookbook separate. Maybe also rename it to ros2/cookbook as I think that implies better what its purpose is. But those are just my thoughts on what we should do if we were starting from scratch, and I don't know if it would be worth the disruption at this point.
More to your specific question, demos (specifically
demo_nodes_cppand_py) became what we used for tutorials, and examples was meant to stay as a cookbook and not be used in tutorials, but then people started doing that anyways. And so now both contain some stuff used in tutorials, but neither is used for tutorials exclusively.fujitatomoya commentedon Apr 3, 2025
@wjwwood @emersonknapp in waffle meeting, we decided to take this to next PMC meeting agenda.
ros-discourse commentedon Apr 9, 2025
This issue has been mentioned on ROS Discourse. There might be relevant details there:
https://discourse.ros.org/t/ros-pmc-minutes-for-april-8-2025/43138/1
emersonknapp commentedon Apr 14, 2025
I have an action item from the PMC meeting to write a concrete proposal for what to change, so that we can discuss here and agree on actions.
I will try to get that proposal here before tomorrow's PMC but if I can't, we can discuss it at the following one.
emersonknapp commentedon Apr 15, 2025
My proposal is in regard to the following repositories, which are the existing designated locations for educational materials and sample code:
I agree with @wjwwood 's distinctions laid out above, reiterating in my words as:
examples: small self-contained snippets demonstrating correct usage of end-user APIs and features from the core libraries.demos: more in-depth explorations of complex features, edge cases, and integration cases2. not for education - these are better compared to integration tests
tutorials: Archive this repository in favor of containing tutorials withinros2_documentationros2_documentation: Entrypoint to the documentation, contains3. Installation instructions
4. Information about the ROS 2 project as a whole
5. High level concepts that are independent of a specific language
6. Guided tutorials with code
To reach that goal, I identify these action items:
README.md, mentioning what code belongs and does not belong, in that repository, pointing to the others to extend thatdemo_nodes_cppanddemo_nodes_pyfromdemostoexamples, cleaning up where necessary, to get much of the desired API snipped coveragetutorialswith a note that the content is being maintained atros2_documentationros2_documentationrepository, with lint & build & test to keep the code generally workingrstinto files in this space, withliteralincludedvdmc commentedon Apr 17, 2025
Great action @emersonknapp! I will keep this in mind for future ROS Tutorials issues.
templatesis a keyword forexamplesthat aligns with its objective.ros2_documentation?emersonknapp commentedon Apr 18, 2025
Yes, I think so 100 percent! First and foremost the concept documentation and tutorials should always demonstrate good practices, as long as it doesn't complicate the code more than necessary for the point being illustrated at the moment.
Then, for more in depth discussion of those best practices, dedicated page(s) makes sense to me.
dvdmc commentedon Apr 18, 2025
Noted. I also agree that dedicated pages would avoid information overload at early tutorials.
[-]How does this repository differ from ros2/demos?[/-][+]Clarify distinction between examples, demos, tutorials[/+]emersonknapp commentedon Apr 29, 2025
With no major pushback on the action items proposed - I have renamed this issue to track taking those actions