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

Building Custom Message on Dashing Fails

asked 2019-09-13 01:24:11 -0600

Tim Craig gravatar image

updated 2019-09-13 17:51:19 -0600

When I run colcon build to generate a custom message on Dashing, I get the following error:

Starting >>> druai_msg
--- stderr: druai_msg                         
CMake Error at /opt/ros/dashing/share/rosidl_adapter/cmake/rosidl_adapt_interfaces.cmake:60 (message):
  execute_process(/usr/bin/python3 -m rosidl_adapter --package-name druai_msg
  returned error code 1:

  Traceback (most recent call last):

    File "/usr/lib/python3.6/", line 193, in _run_module_as_main
      "__main__", mod_spec)
    File "/usr/lib/python3.6/", line 85, in _run_code
      exec(code, run_globals)
    File "/opt/ros/dashing/lib/python3.6/site-packages/rosidl_adapter/", line 19, in <module>
    File "/opt/ros/dashing/lib/python3.6/site-packages/rosidl_adapter/", line 55, in main
      pathlib.Path(relative_path), output_dir)
    File "/opt/ros/dashing/lib/python3.6/site-packages/rosidl_adapter/", line 20, in convert_to_idl
      package_dir, package_name, interface_file, output_dir / 'msg')
    File "/opt/ros/dashing/lib/python3.6/site-packages/rosidl_adapter/msg/", line 28, in convert_msg_to_idl
      msg = parse_message_string(package_name, input_file.stem, content)
    File "/opt/ros/dashing/lib/python3.6/site-packages/rosidl_adapter/", line 522, in parse_message_string
      msg = MessageSpecification(pkg_name, msg_name, fields, constants)
    File "/opt/ros/dashing/lib/python3.6/site-packages/rosidl_adapter/", line 373, in __init__
      pkg_name + PACKAGE_NAME_MESSAGE_TYPE_SEPARATOR + msg_name)
    File "/opt/ros/dashing/lib/python3.6/site-packages/rosidl_adapter/", line 196, in __init__
      raise InvalidResourceName(self.type)

  rosidl_adapter.parser.InvalidResourceName: druai

Call Stack (most recent call first):
  /opt/ros/dashing/share/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake:130 (rosidl_adapt_interfaces)
  CMakeLists.txt:24 (rosidl_generate_interfaces)

Failed   <<< druai_msg  [ Exited with code 1 ]


<package format="3">
  <description>Examples of custom message handling</description>
  <maintainer email="">Tim Craig</maintainer>
  <license>Apache License 2.0</license>
  <author>Tim Craig</author>






cmake_minimum_required(VERSION 3.5)

# Default to C++14

  add_compile_options(-Wall -Wextra -Wpedantic)

find_package(ament_cmake REQUIRED)
#find_package(rclcpp REQUIRED)
#find_package(std_msgs REQUIRED)

#Needed to handle custom messages
find_package(builtin_interfaces REQUIRED)
find_package(rosidl_default_generators REQUIRED)

#set(FastRTPS_INCLUDE_DIR:PATH /opt/ros/dashing/include)

#Generate the include file and other support for the custom message
  DEPENDENCIES builtin_interfaces)


Message file druai.msg, not that it seems to get that far.

string banner
int32 count

I shifted my focus to ROS2 when Dashing was released. Seems to have installed correctly. I successfully built the standard examples. Successfully built and ran my own publisher-subscriber pair for standard messages. However, when I tried to do a custom message following this tutorial which is for Crystal, it failed. It appears that the FastRTPS include files and libraries are there in /opt/ros/dashing/.....

[Tutorial video](

When I searched, I found something ... (more)

edit retag flag offensive close merge delete


Can you provide more information? CMakeList, package.xml and so on

LeoE gravatar image LeoE  ( 2019-09-13 07:40:53 -0600 )edit

Please edit your question to add this content instead of stringing it out in comments. You can integrate it for easier reading with new viewers for future reference.

tfoote gravatar image tfoote  ( 2019-09-13 15:16:31 -0600 )edit

First of all, don't know, if it is a copy paste mistake, but there is a < missing in your package.xml at member_of_group. Now have you tried deleting your build (and install) folder and rebuilding? Is Our ros2 path sourced? And why do you have a dependency on "builtin_interfaces"? This is not a necessary package for your example, if I'm not mistaken.

LeoE gravatar image LeoE  ( 2019-09-13 16:14:31 -0600 )edit

Ok, the missing < in the package.xml was in the original. I moved the package to a pristine workspace and tried again. The error changed. I've updated the original question with the current error message and data. Appears to cause an error in the interface generation python code.

Tim Craig gravatar image Tim Craig  ( 2019-09-13 17:55:16 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-09-14 19:49:32 -0600

Tim Craig gravatar image

updated 2019-09-14 19:56:27 -0600

The problem stemmed from my .msg file beginning with a lower case letter. Change it to a capital and everything worked. I've searched and can't find where the file name for a .msg file must begin with a capital. This did not seem to be a requirement in ROS1 although a lot of examples did it.

In any event, it would be nice if this was made clearer and the response to a lower case beginning letter wasn't the message generator python program crashing and a simple error message indicating that was generated instead.

edit flag offensive delete link more



In any event, it would be nice if this was made clearer and the response to a lower case beginning letter wasn't the message generator python program crashing and a simple error message indicating that was generated instead.

I sympathise with you in that it took time to figure this out, and that it was unexpected, but the best way to make sure this either gets fixed (so case of filename doesn't matter any more), it gets documented better or the code dealing with this gets fixed (if this was actually more of a bug) would be for you to report this as an issue on the appropriate repository.

ROS Answers is not an issue tracker, and answers like this have very little visibility -- when used for reporting these sort of things.

gvdhoorn gravatar image gvdhoorn  ( 2019-09-15 04:37:36 -0600 )edit

Looks like it was ticketed :)

130s gravatar image 130s  ( 2023-05-01 04:48:54 -0600 )edit

Question Tools



Asked: 2019-09-13 01:24:11 -0600

Seen: 2,245 times

Last updated: Sep 14 '19