如何使python-ros2软件包含糊以隐藏源代码?
我有一个ROS2-Python(RCLPY)包,其中有多个子弹可以一起使用。我想使软件包含糊不清,以隐藏源代码,然后将可执行文件留下来完成工作。有什么想法如何使用软件包和启动文件的设置。
I have a ROS2-python (rclpy) package with multiple subpackages that work together. I would like to cythonize the package in order to hide the source code and just leave the executables to do the job. Any idea how could I do that with the setup.py of the package and the launch files ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
因此,如果有人面对同样的问题,我会回答自己的问题。为了使您的ROS2软件包用Python搅拌,最好的方法是将所需的Cython组件分别添加到每个软件包的 setup.py 中。我已经标记了Cython Parts(带有< - ),以进行更好的施工。
请注意,使用COLCON构建包装后,Python源代码的副本将存储在Colcon生成的安装目录下。您可以轻松地手动删除它们,并且该软件包应使用生成的C和共享对象文件运行。
So I would answer my own question in case someone faced the same issue. For cythonizing your ros2 package in python the best way is adding the required cython components to the setup.py of each package separately. I have marked the cython parts (with <--) for a better understranding.
Please note that after building the package using colcon, a copy of the python source codes would be stored under the install directory produced by colcon. You can easily delete them manually and the package should run with the generated c and shared object files.