ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The command line tool "rosmsg" provides the information you seem to need. "rosmsg package PKGNAME" outputs a list of messages for a specific package. "rosmsg show MSGNAME" than outputs the message definition.

From withing CMake only the path of the directories where the message files are location can be accessed. A package does not expose a list of actual messages. To access these information you would need to include a specific CMake file generated and only used inside of genmsg. (But be aware that globbing the files might catch messages files which are never getting installed.)

find_package(catkin REQUIRED COMPONENTS std_msgs)
include("${std_msgs_DIR}/std_msgs-msg-paths.cmake"})
# std_msgs_MSG_INCLUDE_DIRS lists all folders from where messages (and services) of that package are located

Probably it is not desired to make the typekit generator a normal message generator since that would generate and embed the generated code into each and every message package and requires the message_generation package to depend on the typekit generator.

Probably the best way would be if every message package (after find_package()-ing) exposes a variable pointing to all available message files. That should be pretty easy to generate in genmsg using a CMake config extra files.

The command line tool "rosmsg" provides the information you seem to need. "rosmsg package PKGNAME" outputs a list of messages for a specific package. "rosmsg show MSGNAME" than outputs the message definition.definition. But the console tools might actually not be what you want to invoke from within CMake.

From withing CMake only the path of the directories where the message files are location can be accessed. A package does not expose a list of actual messages. To access these information you would need to include a specific CMake file generated and only used inside of genmsg. (But be aware that globbing the files might catch messages files which are never getting installed.)

find_package(catkin REQUIRED COMPONENTS std_msgs)
include("${std_msgs_DIR}/std_msgs-msg-paths.cmake"})
# std_msgs_MSG_INCLUDE_DIRS lists all folders from where messages (and services) of that package are located

Probably it is not desired to make the typekit generator a normal message generator since that would generate and embed the generated code into each and every message package and requires the message_generation package to depend on the typekit generator.

Probably the best way would be if every message package (after find_package()-ing) exposes a variable pointing to all available message files. files. That should be pretty easy to generate in genmsg using a CMake config extra files.