Skip to content

Commit 109b41a

Browse files
authored
added core content to concepts, renamed files to match (ros2#1010)
Signed-off-by: maryaB-osr <[email protected]>
1 parent e730d33 commit 109b41a

21 files changed

+520
-17
lines changed

global_substitutions.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.. |ament packages| replace:: :term:`ament packages <ament package>`
2+
3+
.. |API| replace:: :term:`API`
4+
.. |APIs| replace:: :term:`APIs <API>`
5+
6+
.. |client library| replace:: :term:`client library <client_library>`
7+
.. |client libraries| replace:: :term:`client libraries <client_library>`
8+
9+
.. |GitHub| replace:: GitHub
10+
.. _GitHub: https://github.com/
11+
12+
.. |package| replace:: :term:`package`
13+
.. |packages| replace:: :term:`packages <package>`
14+
15+
.. |REPs| replace:: :term:`REPs <REP>`
16+
17+
.. |rclcpp| replace:: :term:`rclcpp`

source/Concepts.rst

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,42 @@
33
Concepts
44
========
55

6-
The following "Concepts" pages provide an overview for key aspects of ROS 2.
7-
Concept overviews will help you understand the "big picture" idea of ROS 2 systems.
6+
Conceptual overviews provide general background information about key aspects of ROS 2:
87

98
.. toctree::
109
:maxdepth: 1
1110

12-
Concepts/DDS-and-ROS-middleware-implementations
11+
Concepts/About-Different-Middleware-Vendors
12+
Concepts/About-Logging
1313
Concepts/About-Quality-of-Service-Settings
14+
Concepts/About-ROS-2-Client-Libraries
1415
Concepts/About-ROS-Interfaces
15-
Concepts/About-Topic-Statistics
16-
Concepts/ROS-2-Client-Libraries
17-
Concepts/Logging
1816
Concepts/About-ROS-2-Parameters
17+
Concepts/About-Topic-Statistics
18+
19+
The Core Stack Developer Concepts are much more detailed conceptual articles intended for developers who plan modify or contribute to the ROS 2 core:
20+
21+
.. toctree::
22+
:maxdepth: 2
1923

20-
See https://docs.ros2.org/ for more high-level ROS 2 documentation.
24+
Concepts/About-Build-System
25+
Concepts/About-Internal-Interfaces
26+
Concepts/About-Middleware-Implementations
27+
Concepts/About-Client-Interfaces
2128

22-
Overview of ROS 2 Concepts
23-
--------------------------
29+
Quick overview of ROS 2 Concepts
30+
--------------------------------
2431

25-
.. contents:: Table of Contents
32+
.. contents::
2633
:local:
2734

2835
ROS 2 is a middleware based on an anonymous publish/subscribe mechanism that allows for message passing between different ROS processes.
2936

3037
At the heart of any ROS 2 system is the ROS graph.
3138
The ROS graph refers to the network of nodes in a ROS system and the connections between them by which they communicate.
3239

33-
Quick Overview of Graph Concepts
34-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
40+
Graph Concepts
41+
^^^^^^^^^^^^^^
3542

3643

3744
* Nodes: A node is an entity that uses ROS to communicate with other nodes.
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
About the build system
2+
======================
3+
4+
.. include:: ../../global_substitutions.txt
5+
6+
Under everything is the build system.
7+
Iterating on ``catkin`` from ROS 1 we have created a set of |packages| under the moniker ``ament``.
8+
Some of the reasons for changing the name to ``ament`` are that we wanted it to not collide with ``catkin`` (in case we want mix them at some point) and to prevent confusion with existing ``catkin`` documentation.
9+
``ament``'s primary responsibility is to make it easier to develop and maintain ROS 2 core |packages|.
10+
However, this responsibility extends to any user who is willing to make use of our build system conventions and tools.
11+
Additionally it should make |packages| conventional, such that developers should be able to pick up any ``ament`` based |package| and make some assumptions about how it works, how to introspect it, and how to build or use it.
12+
13+
``ament`` consists of a few important repositories which are all in the ``ament`` |GitHub|_ organization:
14+
15+
.. contents::
16+
:depth: 1
17+
:local:
18+
19+
The ``ament_package`` Package
20+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21+
22+
Located on |GitHub|_ at `ament/ament_package <https://github.com/ament/ament_package>`_, this repository contains a single :term:`ament Python package` that provides various utilities for |ament packages|, e.g. templates for environment hooks.
23+
24+
All |ament packages| must contain a single :term:`package.xml` file at the root of the package regardless of their underlying build system.
25+
The :term:`package.xml` "manifest" file contains information that is required in order to process and operate on a |package|.
26+
This |package| information includes things like the |package|'s name, which is globally unique, and the package's dependencies.
27+
The :term:`package.xml` file also serves as the marker file which indicates the location of the |package| on the file system.
28+
29+
Parsing of the :term:`package.xml` files is provided by ``catkin_pkg`` (as in ROS 1), while functionality to locate |packages| by searching the file system for these :term:`package.xml` files is provided by build tools such as ``colcon``.
30+
31+
.. glossary::
32+
33+
package.xml
34+
Package manifest file which marks the root of a :term:`package` and contains meta information about the :term:`package` including its name, version, description, maintainer, license, dependencies, and more.
35+
The contents of the manifest are in machine readable XML format and the contents are described in the |REPs| `127 <http://www.ros.org/reps/rep-0127.html>`_ and `140 <http://www.ros.org/reps/rep-0140.html>`_, with the possibility of further modifications in future |REPs|.
36+
37+
So anytime some |package| is referred to as an :term:`ament package`, it means that it is a single unit of software (source code, build files, tests, documentation, and other resources) which is described using a :term:`package.xml` manifest file.
38+
39+
.. glossary::
40+
41+
ament package
42+
Any |package| which contains a :term:`package.xml` and follows the packaging guidelines of ``ament``, regardless of the underlying build system.
43+
44+
Since the term :term:`ament package` is build system agnostic, there can be different kinds of |ament packages|, e.g. :term:`ament CMake package`, :term:`ament Python package`, etc.
45+
46+
Here is a list of common package types that you might run into in this software stack:
47+
48+
.. glossary::
49+
50+
CMake package
51+
Any |package| containing a plain CMake project and a :term:`package.xml` manifest file.
52+
53+
ament CMake package
54+
A :term:`CMake package` that also follows the ``ament`` packaging guidelines.
55+
56+
Python package
57+
Any |package| containing a `setuptools <http://pythonhosted.org/setuptools/>`_ based Python project and a :term:`package.xml` manifest file.
58+
59+
ament Python package
60+
A :term:`Python package` that also follows the ``ament`` packaging guidelines.
61+
62+
The ``ament_cmake`` Repository
63+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
64+
65+
Located on |GitHub|_ at `ament/ament_cmake <https://github.com/ament/ament_cmake>`_, this repository contains many "ament CMake" and pure CMake packages which provide the infrastructure in CMake that is required to create "ament CMake" packages.
66+
In this context "ament CMake" packages means: ``ament`` packages that are built using CMake.
67+
So the |packages| in this repository provide the necessary CMake functions/macros and CMake Modules to facilitate creating more "ament CMake" (or ``ament_cmake``) packages.
68+
Packages of this type are identified with the ``<build_type>ament_cmake</build_type>`` tag in the ``<export>`` tag of the :term:`package.xml` file.
69+
70+
The |packages| in this repository are extremely modular, but there is a single "bottleneck" |package| called ``ament_cmake``.
71+
Anyone can depend on the ``ament_cmake`` |package| to get all of the aggregate functionality of the |packages| in this repository.
72+
Here a list of the |packages| in the repository along with a short description:
73+
74+
- ``ament_cmake``
75+
76+
- aggregates all other |packages| in this repository, users need only to depend on this.
77+
78+
- ``ament_cmake_auto``
79+
80+
- provides convenience CMake functions which automatically handle a lot of the tedious parts of writing a |package|'s ``CMakeLists.txt`` file
81+
82+
- ``ament_cmake_core``
83+
84+
- provides all built-in core concepts for ``ament``, e.g. environment hooks, resource indexing, symbolic linking install and others
85+
86+
- ``ament_cmake_gmock``
87+
88+
- adds convenience functions for making gmock based unit tests
89+
90+
- ``ament_cmake_gtest``
91+
92+
- adds convenience functions for making gtest based automated tests
93+
94+
- ``ament_cmake_nose``
95+
96+
- adds convenience functions for making nosetests based python automated tests
97+
98+
- ``ament_cmake_python``
99+
100+
- provides CMake functions for |packages| that contain Python code
101+
102+
- ``ament_cmake_test``
103+
104+
- aggregates different kinds of tests, e.g. gtest and nosetests, under a single target using `CTest <https://cmake.org/Wiki/CMake/Testing_With_CTest>`_
105+
106+
The ``ament_cmake_core`` |package| contains a lot of the CMake infrastructure that makes it possible to cleanly pass information between |packages| using conventional interfaces.
107+
This makes the |packages| have more decoupled build interfaces with other |packages|, promoting their reuse and encouraging conventions in the build systems of different |packages|.
108+
For instance it provides a standard way to pass include directories, libraries, definitions, and dependencies between |packages| so that consumers of this information can access this information in a conventional way.
109+
110+
The ``ament_cmake_core`` |package| also provides features of the ``ament`` build system like symbolic link installation, which allows you to symbolically link files from either the source space or the build space into the install space rather than copying them.
111+
This allows you to install once and then edit non-generated resources like Python code and configuration files without having to rerun the install step for them to take effect.
112+
This feature essentially replaces the "devel space" from ``catkin`` because it has most of the advantages with few of the complications or drawbacks.
113+
114+
Another feature provided by ``ament_cmake_core`` is the |package| resource indexing which is a way for |packages| to indicate that they contain a resource of some type.
115+
The design of this feature makes it much more efficient to answer simple questions like what |packages| are in this prefix (e.g. ``/usr/local``) because it only requires that you list the files in a single possible location under that prefix.
116+
You can read more about this feature in the `design docs <https://github.com/ament/ament_cmake/blob/master/ament_cmake_core/doc/resource_index.md>`_ for the resource index.
117+
118+
Like ``catkin``, ``ament_cmake_core`` also provides environment setup files and |package| specific environment hooks.
119+
The environment setup files, often named something like ``setup.bash``, are a place for |package| developers to define changes to the environment that are needed to utilize their |package|.
120+
The developers are able to do this using an "environment hook" which is basically an arbitrary bit of shell code that can set or modify environment variables, define shell functions, setup auto-completion rules, etc...
121+
This feature is how, for example, ROS 1 set the ``ROS_DISTRO`` environment variable without ``catkin`` knowing anything about the ROS distribution.
122+
123+
The ``ament_lint`` Repository
124+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
125+
126+
Located on |GitHub|_ at `ament/ament_lint <https://github.com/ament/ament_lint>`_, this repository provides several |packages| which provide linting and testing services in a convenient and consistent manner.
127+
Currently there are |packages| to support C++ style linting using ``uncrustify``, static C++ code checks using ``cppcheck``, checking for copyright in source code, Python style linting using ``pep8``, and other things.
128+
The list of helper packages will likely grow in the future.
129+
130+
Build tools
131+
~~~~~~~~~~~
132+
133+
A build tool performs the task of building a workspace of packages together at once with a single invocation.
134+
For ROS 2 releases up to Ardent, the build tool providing this functionality is called ``ament_tools``.
135+
As of ROS 2 Bouncy, ``ament_tools`` has been superseded by ``colcon``, as described in `the universal build tool article <http://design.ros2.org/articles/build_tool.html>`_.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
ROS 2 Client Interfaces (Client Libraries)
2+
==========================================
3+
4+
.. include:: ../../global_substitutions.txt
5+
6+
ROS Client Interfaces, a.k.a. |client libraries|, are user facing interfaces which provide the high level functionality and are built on top of the ``rcl`` and ``rosidl`` |APIs|.
7+
8+
.. rclc is not up-to-date
9+
The ``rclc`` Package
10+
~~~~~~~~~~~~~~~~~~~~
11+
12+
The ROS Client Library for C (``rclc``) is the user facing C idiomatic interface which provides all of the ROS client functionality like creating nodes, publisher, and subscribers.
13+
This |API| uses the ``rcl`` |API| and the ``rosidl`` |API| to implement its functions.
14+
Because both ``rcl`` and ``rclc`` are written in C, you might wonder what the difference is between the two |APIs|.
15+
The ``rcl`` |API| provides functions for things like creating nodes, publishers, and subscribers, which are exposed through to the ``rclc`` |API|, but the ``rclc`` |API| additionally handles things like the threading model, configuration, and other components of the client library which are solved differently in different languages.
16+
Since ``rcl`` and ``rclc`` are so similar to each other, ``rclc`` essential can be described as ``rcl`` plus execution (threading).
17+
However, the distinction becomes clearer when you consider client libraries in different languages.
18+
19+
The ``rclc`` repository is located on |GitHub|_ at `ros2/rclc <https://github.com/ros2/rclc>`_ and contains the |package| ``rclc`` which contains the development resources, interface and reference implementation that is required at runtime.
20+
21+
.. warning::
22+
23+
TODO: Link to the ``rclc`` |API| docs
24+
25+
The ``rclcpp`` Package
26+
~~~~~~~~~~~~~~~~~~~~~~
27+
28+
The ROS Client Library for C++ (``rclcpp``) is the user facing, C++ idiomatic interface which provides all of the ROS client functionality like creating nodes, publisher, and subscribers.
29+
``rclcpp`` builds on top of ``rcl`` and the ``rosidl`` |API|, and it is designed to be used with the C++ messages generated by ``rosidl_generator_cpp``.
30+
31+
``rclcpp`` makes use of all the features of C++ and C++11 to make the interface as easy to use as possible, but since it reuses the implementation in ``rcl`` it is able maintain a consistent behavior with the other client libraries that use the ``rcl`` |API|.
32+
33+
The ``rclcpp`` repository is located on |GitHub|_ at `ros2/rclcpp <https://github.com/ros2/rclcpp>`_ and contains the |package| ``rclcpp``.
34+
The generated |API| documentation is here:
35+
36+
`api/rclcpp/index.html <http://docs.ros2.org/foxy/api/rclcpp/index.html>`_
37+
38+
The ``rclpy`` Package
39+
~~~~~~~~~~~~~~~~~~~~~
40+
41+
The ROS Client Library for Python (``rclpy``) is the Python counterpart to the C++ client library.
42+
Like the C++ client library, ``rclpy`` also builds on top of the ``rcl`` C API for its implementation.
43+
The interface provides an idiomatic Python experience which uses native Python types and patterns like lists and context objects, but by using the ``rcl`` |API| in the implementation it stays consistent with the other client libraries in terms of feature parity and behavior.
44+
In addition to providing Python idiomatic bindings around the ``rcl`` |API| and Python classes for each message, the Python client library takes care of the execution model, using ``threading.Thread`` or similar to run the functions in the ``rcl`` |API|.
45+
46+
Like C++ it generates custom Python code for each ROS message that the user interacts with, but unlike C++ it eventually converts the native Python message object into the C version of the message.
47+
All operations happen on the Python version of the messages until they need to be passed into the ``rcl`` layer, at which point they are converted into the plain C version of the message so it can be passed into the ``rcl`` C |API|.
48+
This is avoided if possible when communicating between publishers and subscribers in the same process to cut down on the conversion into and out of Python.
49+
50+
The ``rclpy`` repository is located on |GitHub|_ at `ros2/rclpy <https://github.com/ros2/rclpy>`_ and contains the |package| ``rclpy``.
51+
The generated |API| documentation is here:
52+
53+
54+
`api/rclpy/index.html <http://docs.ros2.org/foxy/api/rclpy/index.html>`_
File renamed without changes.

0 commit comments

Comments
 (0)