Gazebo ROS2 template build fail

asked 2023-06-23 13:25:58 -0600

Simple Simpson gravatar image

updated 2023-06-23 13:27:47 -0600

I have followed the recipe from https://github.com/gazebosim/ros_gz_p..., in order to start from scratch. I deleted Gazebo classic, and installed Garden + "necessary tools" from recipe.

Building throws this error, would be nice to get some hints to what I can do. Sorry for the messy error message.

colcon build --cmake-args -DBUILD_TESTING=ON
[0.334s] WARNING:colcon.colcon_core.package_selection:Some selected packages are already built in one or more underlay workspaces:
    'ros_gz_bridge' 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 ros_gz_bridge

This may be promoted to an error in a future release of colcon-override-check.
Starting >>> ros_gz_interfaces
Starting >>> ros_gz_sim
Starting >>> sdformat_test_files
Starting >>> ros_gz_example_application
Starting >>> ros_gz_example_bringup
Starting >>> ros_gz_example_description
Starting >>> ros_gz_example_gazebo
Finished <<< sdformat_test_files [0.14s]                                                                  
Starting >>> sdformat_urdf
Finished <<< ros_gz_example_description [0.14s]
Finished <<< ros_gz_example_application [0.16s]
Finished <<< ros_gz_example_bringup [0.16s]
Finished <<< ros_gz_example_gazebo [0.19s]                                                              
Finished <<< ros_gz_sim [0.21s]
Finished <<< sdformat_urdf [0.17s]                                                                     
Finished <<< ros_gz_interfaces [1.08s]                      
Starting >>> ros_gz_bridge
--- stderr: ros_gz_bridge                              
Traceback (most recent call last):
  File "/home/USERNAME/template_ws/src/ros_gz/ros_gz_bridge/bin/ros_gz_bridge_generate_factories", line 25, in <module>
    from ros_gz_bridge import generate_cpp
  File "/home/USERNAME/template_ws/src/ros_gz/ros_gz_bridge/ros_gz_bridge/__init__.py", line 21, in <module>
    from rosidl_pycommon import expand_template
ModuleNotFoundError: No module named 'rosidl_pycommon'
gmake[2]: *** [CMakeFiles/ros_gz_bridge_lib.dir/build.make:80: generated/get_facUSERNAMEy.cpp] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:182: CMakeFiles/ros_gz_bridge_lib.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
Traceback (most recent call last):
Traceback (most recent call last):
Traceback (most recent call last):
  File "/home/USERNAME/template_ws/src/ros_gz/ros_gz_bridge/bin/ros_gz_bridge_generate_tests", line 25, in <module>
  File "/home/USERNAME/template_ws/src/ros_gz/ros_gz_bridge/bin/ros_gz_bridge_generate_tests", line 25, in <module>
  File "/home/USERNAME/template_ws/src/ros_gz/ros_gz_bridge/bin/ros_gz_bridge_generate_tests", line 25, in <module>
    from ros_gz_bridge import generate_test_cpp
    from ros_gz_bridge import generate_test_cpp
    from ros_gz_bridge import generate_test_cpp
  File "/home/USERNAME/template_ws/src/ros_gz/ros_gz_bridge/ros_gz_bridge/__init__.py", line 21, in <module>
  File "/home/USERNAME/template_ws/src/ros_gz/ros_gz_bridge/ros_gz_bridge/__init__.py", line 21, in <module>
  File "/home/USERNAME/template_ws/src/ros_gz/ros_gz_bridge/ros_gz_bridge/__init__.py", line 21, in <module>
    from rosidl_pycommon import expand_template
    from rosidl_pycommon import expand_template
    from rosidl_pycommon import expand_template
ModuleNotFoundError: No module named 'rosidl_pycommon'
ModuleNotFoundError: No module named 'rosidl_pycommon'
ModuleNotFoundError: No module named 'rosidl_pycommon'
Traceback (most recent call last):
  File "/home/USERNAME/template_ws/src/ros_gz/ros_gz_bridge/bin/ros_gz_bridge_generate_tests", line 25, in <module>
    from ros_gz_bridge import generate_test_cpp
  File "/home/USERNAME/template_ws/src/ros_gz/ros_gz_bridge/ros_gz_bridge/__init__.py", line 21, in <module>
    from rosidl_pycommon import expand_template
ModuleNotFoundError: No module named 'rosidl_pycommon'
gmake[2]: *** [CMakeFiles/test_ros_publisher ...
(more)
edit retag flag offensive close merge delete

Comments

1

Did you see my suggestion here (in the comments)?

jrtg gravatar imagejrtg ( 2023-06-23 14:34:39 -0600 )edit

Yes, I think that is spot on, thanks. However, since I am installing ros_gz` via the template, I need to find an indirect way to build the correct branch. Perhaps adding the branch link in the template YAML?

https://github.com/gazebosim/ros_gz_p...

Simple Simpson gravatar imageSimple Simpson ( 2023-06-24 01:37:45 -0600 )edit
Simple Simpson gravatar imageSimple Simpson ( 2023-06-24 01:41:28 -0600 )edit
1

In step 2, before the vcs import < template_workspace.yaml, edit the yaml file and change version: ros2 to version: humble for the ros_gz.git entry.

jrtg gravatar imagejrtg ( 2023-06-25 02:53:24 -0600 )edit

thanks! Sorry for the late reply, I was away from Gazebo. If you make your comment an answer, I would be happy to mark it as the answer.

Simple Simpson gravatar imageSimple Simpson ( 2023-07-02 10:46:13 -0600 )edit