ros_gz icon indicating copy to clipboard operation
ros_gz copied to clipboard

Unable to Source-Bug Report-install ros_gz Branch ros2 on Ubuntu 22.04 arm64 ros2 humble Gazebo Harmonic (ver8)

Open ARLunan opened this issue 6 months ago • 11 comments

Environment

  • OS Version: Ubuntu 22.04 installed in Parallels 18.1 virtual machine on Host MAC M1 arm64 *Branch ros2 branch
  • All Harmonic Gazebo ver8 gz_sim arm64 libraries required for ros_gz libraries installed from Binary. Command $ gz sim —version correctly displays 8.0.0 and running gui correctly displays shapes.sdf.

Description

  • Expected behavior: Finish compile ros_gz Actual behavior: Colcon build compile of ros_gz ros_gz_sim failed , due rosidl_pycommon doesn't exist in Humble
"/home/ubuntutbc/rosgz_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/ubuntutbc/rosgz_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'

This is a Bug Report against ros_gz_bridge since that is the code that needs to be updated to handle building on Humble to replace the missing ros2 /rosidl_pycommon .

Also need to revise the README to list humble harmonic “install from source”

And more importantly release availability of Binary install for Native Ubuntu 22.04 x86-64 and Native or VM arm64 machines, as are all the over 1300 ROS 2 Humble packages in the repos.ros.org/status_page/ros+humble_default list .

ARLunan avatar Dec 24 '23 22:12 ARLunan

For building humble from source, you'll need to use the humble branch of ros_gz. Can you give that a try?

azeey avatar Jan 02 '24 18:01 azeey

OK tnx: Here goes on my UB22.04/arm64 VM on a MAC M1 with ROS 2 humble & gz_sim harmonic installed. Here's a copy of the relevant transcription of the colcon build. While compile did not complete, it seems the previously reported rosicl-pycommon error dod not occur.

ubuntutbc@macvm-ub22h-bv:~/rosgz_ws$ gz sim --version
Gazebo Sim, version 8.0.0
Copyright (C) 2018 Open Source Robotics Foundation.
Released under the Apache 2.0 License.

ubuntutbc@macvm-ub22h-bv:~/rosgz_ws
$ ubuntutbc@macvm-ub22h-bv:~/rosgz_ws/src/ros_gz/ros_gz$ git branch
* humble
  ros2
ubuntutbc@macvm-ub22h-bv:~/rosgz_ws/src/ros_gz/ros_gz$
ubuntutbc@macvm-ub22h-bv:~/rosgz_ws$ rosdep install -r --from-paths src -i -y --rosdistro humble
ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
ros_gz_image: Cannot locate rosdep definition for [gz-transport13]
ros_gz_bridge: Cannot locate rosdep definition for [gz-transport13]
ros_gz_sim: Cannot locate rosdep definition for [gz-transport13]
Continuing to install resolvable dependencies...
......
#All required rosdeps installed successfully
ubuntutbc@macvm-ub22h-bv:~/rosgz_ws$ gz sim --version
Gazebo Sim, version 8.0.0
Copyright (C) 2018 Open Source Robotics Foundation.
Released under the Apache 2.0 License.

ubuntutbc@macvm-ub22h-bv:~/rosgz_ws$ ros2 pkg list|grep sim
nav2_simple_commander
rviz_assimp_vendor
ubuntutbc@macvm-ub22h-bv:~/rosgz_ws$ ros2 pkg list|grep gz
ubuntutbc@macvm-ub22h-bv:~/rosgz_ws$ ros2 pkg list|grep gazebo
ubuntutbc@macvm-ub22h-bv:~/rosgz_ws$ colcon build
Starting >>> ros_gz_interfaces
Starting >>> ros_gz_sim
Finished <<< ros_gz_interfaces [2.21s]                                      
Starting >>> ros_gz_bridge
Finished <<< ros_gz_sim [11.4s]                                        
Starting >>> ros_ign_gazebo
Finished <<< ros_ign_gazebo [5.29s]                                      
Starting >>> ros_ign_interfaces
[Processing: ros_gz_bridge, ros_ign_interfaces]                          
Finished <<< ros_ign_interfaces [38.3s]                                  
[Processing: ros_gz_bridge]                                        
[Processing: ros_gz_bridge]                                        
[Processing: ros_gz_bridge]                                        
[Processing: ros_gz_bridge]                                        
[Processing: ros_gz_bridge]                                        
[Processing: ros_gz_bridge]                                        
[Processing: ros_gz_bridge]                                        
[Processing: ros_gz_bridge]                                        
[Processing: ros_gz_bridge]                                        
[Processing: ros_gz_bridge]                                        
[Processing: ros_gz_bridge]] [ros_gz_bridge:build 43% - 6min 25.1s]
[Processing: ros_gz_bridge]                                        
[Processing: ros_gz_bridge]                                        
[Processing: ros_gz_bridge]                                        
[Processing: ros_gz_bridge]                                        
[Processing: ros_gz_bridge]                                        
[Processing: ros_gz_bridge]                                        
[Processing: ros_gz_bridge]                                        
[Processing: ros_gz_bridge]                                          
[Processing: ros_gz_bridge]                                          
[Processing: ros_gz_bridge]                                          
[Processing: ros_gz_bridge]                                          
[Processing: ros_gz_bridge]                                          
[Processing: ros_gz_bridge]                                          
[Processing: ros_gz_bridge]e] [ros_gz_bridge:build 43% - 13min 29.4s]
[Processing: ros_gz_bridge]                                          
[Processing: ros_gz_bridge]e] [ros_gz_bridge:build 43% - 14min 29.0s]
[Processing: ros_gz_bridge]                                          
[Processing: ros_gz_bridge]                                                                     
[Processing: ros_gz_bridge]                                          
[Processing: ros_gz_bridge]                                          
[Processing: ros_gz_bridge]                                          
[Processing: ros_gz_bridge]                                          
[Processing: ros_gz_bridge]                                          
[Processing: ros_gz_bridge]                                          
[Processing: ros_gz_bridge]                                          
[Processing: ros_gz_bridge]                                          
[Processing: ros_gz_bridge]                                          
[Processing: ros_gz_bridge]                                          
[Processing: ros_gz_bridge]                                          
[Processing: ros_gz_bridge][21min 36.6s] [4/12 complete] [ros_gz_bridge:build 43% - 21min 33.8s]
[Processing: ros_gz_bridge]                                          
[Processing: ros_gz_bridge]                                          
[Processing: ros_gz_bridge]                                          
[Processing: ros_gz_bridge]                                          
[Processing: ros_gz_bridge]                                          
[Processing: ros_gz_bridge]                                          
[Processing: ros_gz_bridge]                                          
[Processing: ros_gz_bridge]                                          
[Processing: ros_gz_bridge]                                          
[Processing: ros_gz_bridge]                                          
[Processing: ros_gz_bridge]                                          
[Processing: ros_gz_bridge]                                          
[Processing: ros_gz_bridge]                                          
[Processing: ros_gz_bridge]                                          
[Processing: ros_gz_bridge]                                          
--- stderr: ros_gz_bridge                                            
c++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
gmake[2]: *** [CMakeFiles/ros_gz_bridge_lib.dir/build.make:497: CMakeFiles/ros_gz_bridge_lib.dir/generated/factories/geometry_msgs.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:183: CMakeFiles/ros_gz_bridge_lib.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
---
Failed   <<< ros_gz_bridge [29min 36s, exited with code 2]

Summary: 4 packages finished [29min 39s]
  1 package failed: ros_gz_bridge
  1 package had stderr output: ros_gz_bridge
  7 packages not processed
ubuntutbc@macvm-ub22h-bv:~/rosgz_ws$ 

ARLunan avatar Jan 02 '24 22:01 ARLunan

Okay, that looks like you're running out of memory. Others have run into that before as well (https://github.com/gazebosim/ros_gz/issues/401#issuecomment-1568882258). Try adding --parallel-workers=1 --executor sequential to your colcon command.

azeey avatar Jan 02 '24 22:01 azeey

OK here is that trial: ubuntutbc@macvm-ub22h-bv:~/rosgz_ws$ colcon build --parallel-workers=1 --executor sequential Starting >>> ros_gz_interfaces Finished <<< ros_gz_interfaces [0.88s]
Starting >>> ros_gz_sim Finished <<< ros_gz_sim [0.28s]
Starting >>> ros_gz_bridge --- stderr: ros_gz_bridge
c++: fatal error: Killed signal terminated program cc1plus compilation terminated. gmake[2]: *** [CMakeFiles/ros_gz_bridge_lib.dir/build.make:497: CMakeFiles/ros_gz_bridge_lib.dir/generated/factories/geometry_msgs.cpp.o] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:183: CMakeFiles/ros_gz_bridge_lib.dir/all] Error 2 gmake[1]: *** Waiting for unfinished jobs.... gmake: *** [Makefile:146: all] Error 2

Failed <<< ros_gz_bridge [1min 51s, exited with code 2]

Summary: 2 packages finished [1min 53s] 1 package failed: ros_gz_bridge 1 package had stderr output: ros_gz_bridge 9 packages not processed ubuntutbc@macvm-ub22h-bv:~/rosgz_ws$

ARLunan avatar Jan 02 '24 23:01 ARLunan

I still think you're running out of memory. Can you monitor the memory usage during the build with a tool like htop?

azeey avatar Jan 03 '24 00:01 azeey

Here is htop display during the compile - Yes it appears memory capacity is a problem. There are 4 cores and all are 85 -100% image

Since my Ubuntu system is virtual I will attempt to allocate more to VM/less to host.

ARLunan avatar Jan 03 '24 01:01 ARLunan

I allocated 6 GB Memory/ 3 of 4 Cores -STill maxes out the memory & Cores & crashes. Any tricks to calm the compiler?

ARLunan avatar Jan 03 '24 01:01 ARLunan

From this answer, it seems like colcon will use all available cores to build a single package, so you'll also need to do export MAKEFLAGS="-j 1" before running colcon build.

azeey avatar Jan 03 '24 17:01 azeey

azeey Success compiling ros_gz from Source : Summary: 12 packages finished [37 secs] with the allocating 4 Cores CPU /8 GB Memory and export MAKEFLAGS="-j 1". Thank you. I ran ROS Integration > ros_gz_bridge demo > Bidirectional Communication Demo . I ran the Visualize in RViz which opened but generated an error that I will troubleshoot as the file vehicle.sdf "missing" is located in the necessary Share directory . ubuntutbc@macvm-ub22h-bv:~/rosgz_ws/install/ros_gz_sim_demos/share/ros_gz_sim_demos/worlds$ ls vehicle.sdf

ruby $(which gz) sim-1] [Err] [Server.cc:198] Error Code 14: [/sdf/world[@name="demo"]/model[@name="vehicle"]/include[0]/uri:/home/ubuntutbc/rosgz_ws/install/ros_gz_sim_demos/share/ros_gz_sim_demos/worlds/vehicle.sdf:L64]: Msg: Unable to find uri[package://ros_gz_sim_demos/models/vehicle]

So the ros_gz Harmonic (Humble branch) Install on a ROS 2 Humble from Source on a suitably powerful arm64 machine works . Thank you for your assistance.

ARLunan avatar Jan 03 '24 22:01 ARLunan

Glad to hear it worked. For the issue with finding the file, make sure you've sourced your colcon workspace.

https://github.com/gazebosim/ros_gz/blob/ros2/ros_gz_sim_demos%2Fhooks%2Fros_gz_sim_demos.dsv.in contains IGN_GAZEBO_RESOURCE_PATH. It might need to be updated to GZ_SIM_RESOURCE_PATH.

azeey avatar Jan 03 '24 23:01 azeey

Implementing your indicated change and following https://gazebosim.org/docs/harmonic/ros2_integration ,Visualize in RViz, the RViz & Gz Windows open displaying the vehicle. After enabling Key Publisher in the 2 GUI examples, the vehicle image moved. However, when I tried to run teleop_twist_keyboard there was no response

ARLunan avatar Jan 04 '24 02:01 ARLunan