Ask Your Question

Error when Custom messages will be built

asked 2020-06-26 02:26:47 -0500

kentarou gravatar image

updated 2020-06-26 02:46:51 -0500

gvdhoorn gravatar image

Hi, I cannot build custom messages.

Target: ROS2 foxy

Created custom messages:

By refering, I made srv file and tried to build it.

Error messages:

I found error messages as follows:

$ colcon build --symlink-install
Starting >>> tutorial_interfaces
--- stderr: tutorial_interfaces                         
CMake Error at /opt/ros/foxy/share/rosidl_adapter/cmake/rosidl_adapt_interfaces.cmake:60 (message):
  execute_process(/home/kentarou/.pyenv/shims/python3 -m rosidl_adapter
  --package-name tutorial_interfaces --arguments-file
  returned error code 1:

  Traceback (most recent call last):

    File "/home/kentarou/.pyenv/versions/3.5.4/lib/python3.5/", line 183, in _run_module_as_main
      mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
    File "/home/kentarou/.pyenv/versions/3.5.4/lib/python3.5/", line 142, in _get_module_details
      return _get_module_details(pkg_main_name, error)
    File "/home/kentarou/.pyenv/versions/3.5.4/lib/python3.5/", line 109, in _get_module_details
    File "/opt/ros/foxy/lib/python3.8/site-packages/rosidl_adapter/", line 32
      assert False, f"Unsupported interface type '{interface_file.suffix}'"

  SyntaxError: invalid syntax

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

make: *** [Makefile:222: cmake_check_build_system] エラー 1 (<- sorry for japanese language, meaning error code 1)
Failed   <<< tutorial_interfaces [3.91s, exited with code 2]

Summary: 0 packages finished [4.06s]
  1 package failed: tutorial_interfaces
  1 package had stderr output: tutorial_interfaces


Does the way to build custom messages change? I could not build other project made on eloquent.

edit retag flag offensive close merge delete


I get the same issues now in a github action for rolling that did not have this issue before. See

Still not sure what to do, since the (python) environment is given by the ros-tooling actions and the github runners.

Arne Nordmann gravatar image Arne Nordmann  ( 2021-11-05 03:52:23 -0500 )edit

1 Answer

Sort by » oldest newest most voted

answered 2020-06-26 08:25:08 -0500

kentarou gravatar image


I fixed my problem. I installed pyenv and it caused the problem. ROS2 foxy system seems to use python 3.8.2. But pyenv in ubuntu can treat only 3.8-dev. And under 3.6.6 was installed in my system.

I uninstalled pyenv and I could build srv project in tutorial.

edit flag offensive delete link more


You can mark your answer as solution then :)

Karl gravatar image Karl  ( 2021-11-05 06:58:16 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2020-06-26 02:26:47 -0500

Seen: 348 times

Last updated: Nov 05 '21