Standards for Mixing C++ and Python Nodes in same Package

asked 2017-03-22 15:29:05 -0600

nckswt gravatar image

updated 2017-03-22 15:38:04 -0600

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!

edit retag flag offensive close merge delete

Comments

5

Most of the ROS packages that I've seen use a directory structure like this.

ahendrix gravatar imageahendrix ( 2017-03-22 17:20:02 -0600 )edit