Humble creating a workspace tutorial
Hi all,
I just started my journey to learn ROS2 and worked me through the humble tutorial. 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 "rosidlgeneratorpy" 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 "rosidldefaultgenerators" 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 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
Finished <<< turtlesim [1.62s]
Summary: 1 package finished [1.77s]
Asked by j-sohn on 2022-10-12 13:06:01 UTC
Comments