-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Enable generate_parameter_module through ament_cmake_python #161
Enable generate_parameter_module through ament_cmake_python #161
Conversation
OUTPUT_VARIABLE PYTHON_VERSION | ||
OUTPUT_STRIP_TRAILING_WHITESPACE) | ||
|
||
set(PARAM_HEADER_FILE ${CMAKE_INSTALL_PREFIX}/local/lib/${PYTHON_VERSION}/dist-packages/${PROJECT_NAME}/${LIB_NAME}.py) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This CMake function creates files in /usr/local/lib
? Why do we want to do that?
I also don't think ${CMAKE_INSTALL_PREFIX}/local/lib
is the right path if we do know for a fact that this is what we want to do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What we want to do is install the Python package to a place on the PYTHONPATH
. The way ROS 2 goes about this is to add an entry to the PYTHONPATH
for every Python package built from source in your workspace. In this context, CMAKE_INSTALL_PREFIX
refers to ros_ws/install/my_python_pkg
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit late perhaps, but I'm running into this.
All other modules of a package like msgs and srvs are without the /local
.
This is failing pre-commit. You might need to rebase it, it seems to be about python quotes. |
Signed-off-by: Paul Gesel <paul.gesel@picknik.ai>
Signed-off-by: Paul Gesel <paul.gesel@picknik.ai>
Co-authored-by: Chris Thrasher <chrisjthrasher@gmail.com>
Signed-off-by: Paul Gesel <paulgesel@gmail.com>
64eef19
to
98958c5
Compare
This PR adds the functionality to generate a Python parameter module in a Cmake project. See here for the feature request. I also added another Python example that uses this new feature.