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

src and node difference!

asked 2015-08-25 16:11:49 -0500

Fi gravatar image

updated 2015-08-25 17:34:26 -0500

Hi all; In some package the main codes are written in two sections: nodes and src! I did not understand what is the difference between them. In other words, I do not understand when we have written our codes in nodes and when we have written them in src? What is their difference in their application? Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-08-26 02:14:26 -0500

mgruhler gravatar image

Well, as I'm not sure what you are refering to, there might be several correct answers.

  1. the node is a minimal file, basically just containing the main function. Then, this is just a way of having the code split up into several files. There is ROS code in e.g. a class that has it's own file (src) which actually implements the functionality, and this is used and instantiated in the main (node).

  2. The possibility is that there is non-ROS code in the src and the respective ROS code (the wrapper) in the node. So you can use same code in ROS and non-ROS systems, if you want to. You don't have dependencies from src to all the ROS stuff.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2015-08-25 16:11:49 -0500

Seen: 254 times

Last updated: Aug 26 '15