ros2 python run time dependencies
Hi
I am using Ubuntu 18.04 and trying to determine run time dependencies for the python demo talker node. previously for cpp demo node after sourcing the work space i just ran
ldd ./install/demo_nodes_cpp/lib/demo_nodes_cpp/talker
It gave me all the shared libraries (.so) ..I just copied and pasted in another Ubuntu 18.04 system and its working as expected.
I would like to reproduce the same with the python demo talker node..except for that its a text file in the install directory..
Any suggestions on how to proceed ?
Thanks
Asked by BhanuKiran.Chaluvadi on 2019-12-12 03:12:11 UTC
Answers
I am not sure if this is the correct process..
$ rosinstall_generator examples_rclpy_minimal_publisher examples_rclpy_minimal_subscriber --rosdistro dashing --deps > minimal_rclpy.repos
$ vcs-import src < minimal_rclpy.repos
$ colcon build --symlink-install
// Then i wrote a small python script to **copy all the site-packages** to desired folder.
$ cp -r ./install/<pkg-name>/lib/python3.6/site-packages/<pkg-name> dst_folder/python3.6/site-packages
// extended PYTHONPATH & LD_LIBRARY_PATH to include the things
$ export PYTHONPATH="<dst_folder>/python3.6/site-package:$PYTHONPATH"
$ export LD_LIBRARY_PATH="<dst_folder>"
// copy demo_node_py into dest_folder
$ cp -r demo_nodes_py <dst_folder>
// try running python script
$ python3 talker.py
As expected it will through "xxx.so" file missing while trying to execute. Again i wrote a small python script to copy the xxx.so file to dst_folder and also run $ ldd xxx.so and copy them as well to dst_folder that are present only in install directory.
$ cp xxxx.so <dst_folder>
$ldd xxxx.so
and repeat. Finally $ python3 talker.py should start executing.
Asked by BhanuKiran.Chaluvadi on 2019-12-13 03:06:17 UTC
Comments