Closed 130s closed 1 year ago
Removing this installed the resource that is specified in CMakeLists.txt
using install
macro.
<export>
<build_type>ament_python</build_type>
</export>
Set both:
<export>
<build_type>ament_cmake</build_type>
<build_type>ament_python</build_type>
</export>
Then build failed.
# colcon build --install-base $PATH_INSTALL_BASE --parallel-workers 3
[0.155s] ERROR:colcon.colcon_core.package_identification:Exception in package identification extension 'ros' in 'src/130s/hut_utakata/hut_utakata_startup': 'path'
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/colcon_ros/package_identification/ros.py", line 170, in _get_build_type
return pkg.get_build_type()
File "/usr/lib/python3/dist-packages/catkin_pkg/package.py", line 167, in get_build_type
raise InvalidPackage('Only one <build_type> element is permitted.', self.filename)
catkin_pkg.package.InvalidPackage: Error(s) in package 'src/130s/hut_utakata/hut_utakata_startup/package.xml':
Only one <build_type> element is permitted.
What I wanted was to:
setup.py
is the way to go.
With this req, I guess using cmake
(similar/same as ros1/Catkin) is a way to go for now.
ament_python
may be useful for the pkg that I know for sure pure Python.
Issue
The file in question did get installed but now I don't see it installed.
Configuration
CMakeLists.txt
``` cmake_minimum_required(VERSION 3.8) project(pkg_foo) find_package(ament_cmake REQUIRED COMPONENTS) ament_package() install(DIRECTORY config DESTINATION share/${PROJECT_NAME}/ ) ``` `setup.py` ``` from setuptools import setup package_name = "pkg_foo" setup( name=package_name, version='0.1.0', packages=[package_name], data_files=[ # Unsure what this is for. https://answers.ros.org/question/367328/ # ('share/ament_index/resource_index/packages', # ['resource/' + package_name]), ('share/' + package_name, ['package.xml']), ], install_requires=['setuptools'], zip_safe=True, maintainer='Isaac Saito', maintainer_email='iisaito@kinugarage.com', description='Colcon package for COMPROJECT challenge application.', license='Apache License 2.0', tests_require=['pytest'], entry_points={ 'console_scripts': [ 'setup_comproject_app = pkg_foo.sim_client:main', ], }, ) ```