[ros-users] [Discourse.ros.org] [Next Generation ROS] Mixed …

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Sidd via ros-users
Date:  
To: ros-users
Subject: [ros-users] [Discourse.ros.org] [Next Generation ROS] Mixed python/cpp Ament package



Okay, this is what I have right now. My package has the following structure -

    - my_pkg
        - CMakeLists.txt
        - package.xml
        - src
            - talker.cpp
        - my_pkg
            - __init__.py
            - listener.py
        - setup.py


My CMakeLists.txt looks like this -

    cmake_minimum_required(VERSION 3.5)


    project(my_pkg)


    if(NOT WIN32)
      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wall -Wextra -Wpedantic")
    endif()


    find_package(ament_cmake REQUIRED)
    find_package(ament_cmake_python REQUIRED)
    find_package(rclcpp REQUIRED)
    find_package(std_msgs REQUIRED)
    find_package(python_cmake_module REQUIRED)
    find_package(PythonExtra MODULE)


    ament_python_install_package(${PROJECT_NAME})


    add_executable(${PROJECT_NAME}_talker src/talker.cpp)
    ament_target_dependencies(${PROJECT_NAME}_talker rclcpp std_msgs)


    install(TARGETS
      ${PROJECT_NAME}_talker
      DESTINATION bin
    )


    ament_package()


My `setup.py` looks like this -
from setuptools import setup, Extension

    setup(
        name='my_pkg',
        version='0.0.0',
        packages=[],
        py_modules=[
            'my_pkg.listener',],
        install_requires=['setuptools'],
        author='user',
        author_email='',
        maintainer='user
        maintainer_email='',
        keywords=['ROS'],
        classifiers=[
            'Intended Audience :: Developers',
            'License :: OSI Approved :: Apache Software License',
            'Programming Language :: Python',
            'Topic :: Software Development',
        ],
        description='Mixed Ament package  for python and cpp files.',
        license='Apache License, Version 2.0',
        test_suite='test',
        entry_points={
            'console_scripts': [
                'my_pkg_listener = my_pkg.listener:main',
            ],
        },
    )


I am able to compile the package, and generate an executable for `my_pkg_talker`.
However `ament` fails to recognize the `setup.py` and install a target for the python node. Is there something else I need to do specifically for ament to recognize the existence of a `setup.py` and run it?






---
[Visit Topic](https://discourse.ros.org/t/mixed-python-cpp-ament-package/1452/9) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list

http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>