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

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 https://index.ros.org/doc/ros2/Tutori..., 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
  /home/kentarou/program/ros2/tmp/build/tutorial_interfaces/rosidl_adapter__arguments__tutorial_interfaces.json
  --output-dir
  /home/kentarou/program/ros2/tmp/build/tutorial_interfaces/rosidl_adapter/tutorial_interfaces
  --output-file
  /home/kentarou/program/ros2/tmp/build/tutorial_interfaces/rosidl_adapter/tutorial_interfaces.idls)
  returned error code 1:

  Traceback (most recent call last):

    File "/home/kentarou/.pyenv/versions/3.5.4/lib/python3.5/runpy.py", 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/runpy.py", 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/runpy.py", line 109, in _get_module_details
      __import__(pkg_name)
    File "/opt/ros/foxy/lib/python3.8/site-packages/rosidl_adapter/__init__.py", 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
---

Question:

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

edit retag flag offensive close merge delete

Comments

I get the same issues now in a github action for rolling that did not have this issue before. See https://github.com/micro-ROS/system_m...

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
0

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

kentarou gravatar image

Hi,

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

Comments

You can mark your answer as solution then :)

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

Question Tools

2 followers

Stats

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

Seen: 689 times

Last updated: Nov 05 '21