Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ARLunan opened this issue Dec 24, 2023 · 11 comments
Labels
bug Something isn't working

Comments

@ARLunan
Copy link

ARLunan commented Dec 24, 2023

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 ARLunan added the bug Something isn't working label Dec 24, 2023
@ARLunan ARLunan changed the title Unable to Source install ros-gz Branch ros2 on Ubuntu 22.04 ros2 humble Gazebo Harmonic (ver8) Unable to Source-Bug Report- install ros-gz Branch ros2 on Ubuntu 22.04 ros2 humble Gazebo Harmonic (ver8) Dec 26, 2023
@ARLunan ARLunan changed the title Unable to Source-Bug Report- install ros-gz Branch ros2 on Ubuntu 22.04 ros2 humble Gazebo Harmonic (ver8) Unable to Source-Bug Report-install ros_gz Branch ros2 on Ubuntu 22.04 arm64 ros2 humble Gazebo Harmonic (ver8) Dec 28, 2023
@azeey
Copy link
Contributor

azeey commented Jan 2, 2024

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

@azeey azeey moved this from Inbox to In progress in Core development Jan 2, 2024
@ARLunan
Copy link
Author

ARLunan commented Jan 2, 2024

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$ 

@azeey
Copy link
Contributor

azeey commented Jan 2, 2024

Okay, that looks like you're running out of memory. Others have run into that before as well (#401 (comment)). Try adding --parallel-workers=1 --executor sequential to your colcon command.

@ARLunan
Copy link
Author

ARLunan commented Jan 2, 2024

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$

@azeey
Copy link
Contributor

azeey commented Jan 3, 2024

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

@ARLunan
Copy link
Author

ARLunan commented Jan 3, 2024

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
Copy link
Author

ARLunan commented Jan 3, 2024

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

@azeey
Copy link
Contributor

azeey commented Jan 3, 2024

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.

@ARLunan
Copy link
Author

ARLunan commented Jan 3, 2024

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.

@azeey
Copy link
Contributor

azeey commented Jan 3, 2024

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.

@ARLunan
Copy link
Author

ARLunan commented Jan 4, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: In progress
Development

No branches or pull requests

2 participants