Skip to content

Commit

Permalink
Add warning about installing rosidl interfaces and Python packages in…
Browse files Browse the repository at this point in the history
… the same project (#2882)

* Add warning as recommended in ros2/rosidl_python#141

Signed-off-by: Ryan Friedman <[email protected]>

* Move warning to after ament_python_install_package instructions

Signed-off-by: Ryan Friedman <[email protected]>
(cherry picked from commit 030bc61)
  • Loading branch information
RFRIEDM-Trimble authored and mergify[bot] committed Aug 18, 2022
1 parent 85503e8 commit 0b8be8a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions source/How-To-Guides/Ament-CMake-Python-Documentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ See the :doc:`ament_cmake user documentation <Ament-CMake-Documentation>` for mo
To create an ``ament_python`` package, see :doc:`Creating your first ROS 2 package <../Tutorials/Beginner-Client-Libraries/Creating-Your-First-ROS2-Package>`.
``ament_cmake_python`` should only be used in cases where that is not possible, like when mixing C/C++ and Python code.


.. contents:: Table of Contents
:depth: 2
:local:
Expand Down Expand Up @@ -59,6 +60,12 @@ The ``CMakeLists.txt`` should contain:
The argument to ``ament_python_install_package()`` is the name of the directory alongside the ``CMakeLists.txt`` that contains the Python file.
In this case, it is ``my_project``, or ``${PROJECT_NAME}``.

.. warning::

Calling ``rosidl_generate_interfaces`` and ``ament_python_install_package`` in the same CMake project does not work.
See this `Github issue <https://github.com/ros2/rosidl_python/issues/141>`_ for more info. It is best practice to instead
separate out the message generation into a separate package.

Then, another Python package that correctly depends on ``my_project`` can use it as a normal Python module:

.. code-block:: python
Expand Down

0 comments on commit 0b8be8a

Please sign in to comment.