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

ros2 python run time dependencies

asked 2019-12-12 02:12:11 -0600

BhanuKiran.Chaluvadi gravatar image


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 ?


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

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

BhanuKiran.Chaluvadi gravatar image

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

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

As expected it will through "" file missing while trying to execute. Again i wrote a small python script to copy the file to dst_folder and also run $ ldd and copy them as well to dst_folder that are present only in install directory.

$ cp <dst_folder>

and repeat. Finally $ python3 should start executing.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2019-12-12 02:12:11 -0600

Seen: 222 times

Last updated: Dec 13 '19