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

Question about nodes

asked 2015-10-27 09:13:22 -0500

TheDude35 gravatar image

Hi all,

I have a question about how nodes are implemented in ROS. From what I understand the "type=" definition refers to an executable file that ROS runs. Consider this example:

<node name="robot_state" pkg="robot_state_publisher" type="robot_state_publisher"/>

Now when I go into the robot_state package I don't find an executable called robot_state_publisher. Would anyone care to explain why that is?

Regards, Devin

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
3

answered 2015-10-27 09:44:36 -0500

mgruhler gravatar image

You are right, type="<EXECUTABLE>".

The robot_state_publisher is defined in the robot_state_publisher package (not robot_state, this is just a name for the node). However, if you install executables from apt-get (or build them yourself), they don't end up in the package, but in /opt/ros/<DISTRO>/lib/<PACKAGE>/<EXECUTABLE> (or <CATKIN_WS>/../devel/lib/<PACKAGE>/<EXECUTABLE> if you compile it yourself).

However, nodes need to be implemented in a special way. Check out this tutorial for a simple example. Make sure to read the in-source comments.

edit flag offensive delete link more

Comments

Makes sense now thanks gentlemen

TheDude35 gravatar image TheDude35  ( 2015-10-27 11:01:26 -0500 )edit
1

answered 2015-10-27 09:43:02 -0500

sterlingm gravatar image

The executables are not stored directly in the package directories. They are stored in a "lib" directory. Try "ls /opt/ros/$ROS_DISTRO/lib/robot_state_publisher" and the executable "robot_state_publisher" should be in there.

This is also the case in your catkin workspace. When you do "catkin_make", it doesn't place each executable in its corresponding package's directory. It places them in the "devel/lib/" folders of your catkin workspace.

edit flag offensive delete link more

Comments

whoops. almost simultaneously ;-)

mgruhler gravatar image mgruhler  ( 2015-10-27 09:45:17 -0500 )edit

I didn't refresh before submitting my answer, whoops! So close.

sterlingm gravatar image sterlingm  ( 2015-10-27 10:02:19 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2015-10-27 09:13:22 -0500

Seen: 165 times

Last updated: Oct 27 '15