ROS is a framework that is implemented in several languages such as C++, Python and Lisp. There are experimental libraries for Java and Lua among others as well (source)
ROS messages are defined using a simple description language .
To use these messages in a ROS implementation (such as the C++ implementation roscpp), these messages need to be converted into a language specific data structure (C++ class / struct). With generate_message
, system will build language specific files (for roscpp, it creates .h header files for each message, which is why when we define a custom_msg.msg, to use it with roscpp we #inclde <custom_msg.h>
).
To support multiple languages, the simple description language restricts field names to start with an alphabetic character followed by alphanumeric and underscore characters ( i.e. [a-zA-Z][a-zA-Z1-9_]*]). Using keywords in common languages is discouraged to avoid confusion, however they are legal.
Currently, C++, Python and Lisp are among the supported languages. The corresponding target names are bar_gencpp
, bar_genpy
and bar_genlisp
for project bar
that contains the dependent messages.