Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rosidl python incompatability (backport #2882) #2971

Merged
merged 1 commit into from
Aug 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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