From 491526741c5ae1cbea0d45d9abdf1adf504b778f Mon Sep 17 00:00:00 2001 From: Ryan Friedman Date: Mon, 18 Jul 2022 11:05:44 -0600 Subject: [PATCH] Add warning as recommended in https://github.com/ros2/rosidl_python/issues/141 * Also link out to combined C++/Python in the "Developing a ROS2 Package" as it's a valid third option Signed-off-by: Ryan Friedman --- source/How-To-Guides/Ament-CMake-Python-Documentation.rst | 7 +++++++ source/How-To-Guides/Developing-a-ROS-2-Package.rst | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/source/How-To-Guides/Ament-CMake-Python-Documentation.rst b/source/How-To-Guides/Ament-CMake-Python-Documentation.rst index f7c70a8acaa..d42113abf90 100644 --- a/source/How-To-Guides/Ament-CMake-Python-Documentation.rst +++ b/source/How-To-Guides/Ament-CMake-Python-Documentation.rst @@ -14,6 +14,13 @@ 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. + +.. 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. + .. contents:: Table of Contents :depth: 2 :local: diff --git a/source/How-To-Guides/Developing-a-ROS-2-Package.rst b/source/How-To-Guides/Developing-a-ROS-2-Package.rst index 3b8a812c0b2..c169776458c 100644 --- a/source/How-To-Guides/Developing-a-ROS-2-Package.rst +++ b/source/How-To-Guides/Developing-a-ROS-2-Package.rst @@ -145,3 +145,11 @@ and a ``setup.py`` file that looks like: ], }, ) + + +Combined C++ and Python Packages +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +When writing a package with both C++ and Python code, the +``setup.py`` file and ``setup.cfg`` file are not used. +Instead, use :doc:`ament_cmake_python <./Ament-CMake-Python-Documentation>`. \ No newline at end of file