ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

What does rosrun do internally?

asked 2019-12-08 22:06:05 -0500

Raghuram Krishnaswami gravatar image

I was following this tutorial -

Out of curiosity, I ran the listener using rosrun beginner_tutorials but ran the talker manually. That is, I changed directory to beginner tutorials, and ran, python

I didn't expect it to work, but it did. The nodes are communicating with each other.

Is that a fluke, or will this always work? Is rosrun's job only to find the correct node based on the ROS_PACKAGE_PATH, or does it do something else as well?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2019-12-09 03:31:15 -0500

updated 2019-12-09 03:32:59 -0500

This will always work. Rosrun's only job is exactly what you said: It searches a couple of directories for the correct node and run it, nothing more. You can get more info on what directories it's searching, and what executable it ends up running, by specifying the --debug flag:

$ source ~/ros-kinetic/devel/setup.bash
$ rosrun --debug imu_filter_madgwick imu_filter_node
[rosrun] Looking in catkin libexec dirs: 
[rosrun] Looking in rospack dir: /home/martin/ros-kinetic/src/imu_tools/imu_filter_madgwick
[rosrun] Searching for imu_filter_node with permissions /111
[rosrun] Running  /home/martin/ros-kinetic/devel/lib/imu_filter_madgwick/imu_filter_node

If you want to dig deeper, here's the full source code of rosrun (just about 100 lines of bash code):

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2019-12-08 22:06:05 -0500

Seen: 652 times

Last updated: Dec 09 '19