ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

ros2 python run time dependencies

asked 2019-12-12 02:12:11 -0500

BhanuKiran.Chaluvadi gravatar image

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

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-12-13 02:06:17 -0500

BhanuKiran.Chaluvadi gravatar image

updated 2019-12-13 02:08:01 -0500

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.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-12-12 02:12:11 -0500

Seen: 255 times

Last updated: Dec 13 '19