With the current approach (which is the same in ROS 1 C++) the header files of messages, services, derived service messages (request and response) all share the same namespace with the package code.
Pros:
- No naming collisions between package code and generated code for messages / services, the subnamespaces
msg and srv are reserved.
- No collisions between message and service names.
- No collision between service names and their derived request / response types.
- The change locations keep user code and generated message / service code nicely separated.
Cons:
- User land code has to include messages / services from a subfolder and use them with a subnamespace:
#include <my_interfaces/msg/Foo.hpp
my_interfaces::msg::Foo foo;
Theire are two more aspects I would like to address in the process of this refactoring:
@esteve @tfoote @wjwwood Please provide feedback before I start working on the necessary PRs.
With the current approach (which is the same in
ROS 1 C++) the header files of messages, services, derived service messages (request and response) all share the same namespace with the package code.msgandsrv) avoids collisions between them. It allows to have anEmpty.msgas well as anEmpty.srv. This is closer to theROS 1 Pythonnaming scheme.msgsubfolder)._(e.g.Foo_Request.h) which is not a valid message / service name.Pros:
msgandsrvare reserved.Cons:
Theire are two more aspects I would like to address in the process of this refactoring:
_Requestsuffix that would imply e.g. using a double underscore as a separator (to keep avoiding collisions)..h. I would propose to change them to.hppto be consistent with our guidelines.@esteve @tfoote @wjwwood Please provide feedback before I start working on the necessary PRs.
-csuffix and apply the same naming rules as for C++ and only differentiate based on the extension.