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

Humble tutorial creating a workspace [closed]

asked 2022-10-13 09:34:28 -0500

j-sohn gravatar image

Hi all,

I just started my journey to learn ROS2 and worked through the humble tutorial (I am using Ubuntu 22.04.). I tried to follow the instruction to create a workspace and everything worked fine until step 5 where this error occured.

[0.392s] WARNING:colcon.colcon_core.package_selection:Some selected packages are already built in one or more underlay workspaces:
        'turtlesim' is in: /opt/ros/humble
    If a package in a merged underlay workspace is overridden and it installs headers, then all packages in the overlay must sort their include directories by workspace order. Failure to do so may result in build failures or undefined behavior at run time.
    If the overridden package is used by another package in any underlay, then the overriding package in the overlay must be API and ABI compatible or undefined behavior at run time may occur.

    If you understand the risks and want to override a package anyways, add the following to the command line:
        --allow-overriding turtlesim

    This may be promoted to an error in a future release of colcon-override-check.
    Starting >>> turtlesim
    --- stderr: turtlesim                               
    Traceback (most recent call last):
      File "/opt/ros/humble/share/rosidl_generator_py/cmake/../../../lib/rosidl_generator_py/rosidl_generator_py", line 8, in <module>
        from rosidl_generator_py import generate_py
    ImportError: cannot import name 'generate_py' from 'rosidl_generator_py' (/opt/ros/humble/local/lib/python3.10/dist-packages/rosidl_generator_py/__init__.py)
    gmake[2]: *** [turtlesim__py/CMakeFiles/turtlesim__py.dir/build.make:121: rosidl_generator_py/turtlesim/_turtlesim_s.ep.rosidl_typesupport_fastrtps_c.c] Error 1
    gmake[1]: *** [CMakeFiles/Makefile2:706: turtlesim__py/CMakeFiles/turtlesim__py.dir/all] Error 2
    gmake[1]: *** Waiting for unfinished jobs....
    gmake: *** [Makefile:146: all] Error 2
    ---
    Failed   <<< turtlesim [25.5s, exited with code 2]

    Summary: 0 packages finished [25.7s]
      1 package failed: turtlesim
      1 package had stderr output: turtlesim

In one post I read, it was suggested not to source before creating a workspace, however this didn't help and I got this error. Where I noticed the issue with the "rosidl_generator_py" module.

Starting >>> turtlesim
--- stderr: turtlesim                             
Traceback (most recent call last):
  File "/opt/ros/humble/share/rosidl_generator_py/cmake/../../../lib/rosidl_generator_py/rosidl_generator_py", line 8, in <module>
    from rosidl_generator_py import generate_py
ModuleNotFoundError: No module named 'rosidl_generator_py'
gmake[2]: *** [turtlesim__py/CMakeFiles/turtlesim__py.dir/build.make:121: rosidl_generator_py/turtlesim/_turtlesim_s.ep.rosidl_typesupport_fastrtps_c.c] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:706: turtlesim__py/CMakeFiles/turtlesim__py.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
gmake: *** [Makefile:146: all] Error 2
---
Failed   <<< turtlesim [0.37s, exited with code 2]

Summary: 0 packages finished [0.47s]
  1 package failed: turtlesim
  1 package had stderr output: turtlesim

After reading another post, it was possible to create a workspace as I commented the required package "rosidl_default_generators" in the CMakeLists.txt file. However, I would like to know if there is a better way to fix this problem.

[0.358s] WARNING:colcon.colcon_core.package_selection:Some selected packages are already built in one or more underlay workspaces:
    'turtlesim' is in: /opt/ros/humble
If a package in a merged underlay workspace is overridden and it installs headers, then ...
(more)
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by j-sohn
close date 2022-10-19 05:21:39.678599

Comments

2

Are you using environments like conda etc? I followed the tutorial and face no issues. Can you please execute the following command and share the output: printenv | grep PYTHONPATH

ravijoshi gravatar image ravijoshi  ( 2022-10-14 03:13:51 -0500 )edit

Thanks for the hint! Yes, I use anaconda. I deactivated the environment through conda deactivate and it solved the problem. Everything works fine now! Thanks a lot!

j-sohn gravatar image j-sohn  ( 2022-10-14 10:03:48 -0500 )edit

Glad you made it work!

ravijoshi gravatar image ravijoshi  ( 2022-10-15 01:40:26 -0500 )edit
1

@ravijoshi You comment was a very nice intuition.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-10-15 09:12:29 -0500 )edit

I don't have conda so this solution didn't work for me. But commenting out rosidl_default_generators did work, and it's good enough for me

iwasinnam gravatar image iwasinnam  ( 2023-01-22 07:07:57 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-10-18 17:39:26 -0500

duck-development gravatar image

If the answer is solved with this

conda deactivate

Then close the question

edit flag offensive delete link more

Comments

@duck-development Normally we don't "close" questions on this site unless there is a problem with it, for example if it is off-topic or a duplicate.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-10-19 06:01:43 -0500 )edit

It was for @j-sohn. And I mean mark the question as answered. So other see how to sove this kind of question

duck-development gravatar image duck-development  ( 2022-10-19 15:41:17 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2022-10-13 09:34:28 -0500

Seen: 812 times

Last updated: Oct 18 '22