Standards for Mixing C++ and Python Nodes in same Package
I'm looking for best practices for using both Python and C++ in a ROS package. Both Packages documentation and the PyStyleGuide provide a basis for directory structures, but not within the context of both C++ and Python simultaneously.
For example, imagine I have a package foo
with a C++ node bar
and a python-based node baz
. Let's say both nodes are complex enough to require separate library source files. I'd put together a directory structure like this:
foo
├── include
│ └── bar.h
├── launch
│ ├── bar.launch
│ ├── baz.launch
│ └── foo.launch
├── msg
│ └── bar.msg
├── nodes
│ └── baz_node.py
├── src
│ ├── foo
│ │ ├── __init__.py
│ │ └── baz.py
│ ├── bar_node.cpp
│ └── bar.cpp
├── srv
│ └── baz.msg
├── CMakeLists.txt
├── package.xml
└── setup.py
I'm not a fan of mixing both C++ and python code under src
, but not sure whether there are any standards/examples associated with this kind of code layout. Can anyone point me towards better solutions? Thanks!
Most of the ROS packages that I've seen use a directory structure like this.
I've seen lots of packages like this, and not a fan of this too. I usually create a
scripts
folder beside thesrc
folder for.py
files.