Package file hierarchy in kinetic
I've been reading the docs and some answers here, but I can't figure out the preferred way to organize the files of the package I'm writing. This thread is close to what I need, but it has no mention of the nodes directory, and I can't fully understand this other.
Particularly, I'm coding in python. I've read the tutorials and some write nodes as functions and others as classes; calling a function or an instance method in __main__
's body. I'm going for the class approach (I'll post another question about that). So, I have files for class definition, files for utility functions, files for messages (should these go on a different package?), and I understand there should be files for nodes.
I've read about code organization schemes and seen something like:
<package>/ |--- src/ | |--- <package>/ | | |--- classes.py | | |--- utilities.py | | | |--- nodes/ | | |--- node1_bin | | |--- node2_bin | | | |--- scripts/ | |--- some_script | |---/msg/
Is this correct? If not, how should I organize code?
That looks reasonable.
rosrun
androslaunch
will look for nodes and launch files in any subdirectory of your package, so there's some flexibility in the directory layout.