diff --git a/source/How-To-Guides/Ament-CMake-Python-Documentation.rst b/source/How-To-Guides/Ament-CMake-Python-Documentation.rst index f7c70a8aca..d5faa14c00 100644 --- a/source/How-To-Guides/Ament-CMake-Python-Documentation.rst +++ b/source/How-To-Guides/Ament-CMake-Python-Documentation.rst @@ -14,6 +14,7 @@ See the :doc:`ament_cmake user 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: @@ -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 `_ 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