How does "rosrun teleop_twist_keyboard" work?

First of all, I had no trouble running the command
rosrun teleop_twist_keyboard
and flying the drone around.

However, afrerwards I tried to check out the file.
I used the commands
roscd teleop_twist_keyboard
find .

The absolute path of the package was /opt/ros/kinetic/share/teleop_twist_keyboard
I didn’t find the anywhere in the package.

Instead the find command result was:

Running the command:
find / -name
I found out that the file exists in the location /opt/ros/kinetic/lib/teleop_twist_keyboard/

So, I am wondering how the rosrun command works.
What I had in mind was that rosrun would run an executable with the specified name inside the specified package. (as we did in previous units with script executables)

P.S. This is my first post, so hello to the community. I am really excited about the course. The content is excellent. Thank you.

Hi @NikosSoulounias,

Welcome to the community and thanks for your compliments!

roscd is obviously picking the first package, while rosrun is picking the second because it couldn’t find anything in the first, and the second one is also the package and has the python file we are looking for.

1 Like