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

webrtc_ros failing to compile on Ubuntu 22.04, ROS 2 Humble #71

Open
GTeref opened this issue Apr 12, 2024 · 4 comments
Open

webrtc_ros failing to compile on Ubuntu 22.04, ROS 2 Humble #71

GTeref opened this issue Apr 12, 2024 · 4 comments
Labels

Comments

@GTeref
Copy link

GTeref commented Apr 12, 2024

Description
Hello,
I am trying to compile this package with ROS2 and I get the following error:

CMake Error at CMakeLists.txt:41 (message):
  cannot fetch GN build tool
  • Library Version: develop-ros2
  • ROS Version: ROS 2 Humble
  • Platform / OS: Ubuntu 22.04

Steps To Reproduce

  1. Clone the repo
  2. Run colcon build
  3. Wait 0.8 seconds
  4. CMake Error appears regarding "cannot fetch GN build tool"

Expected Behavior
Builds successfully

Actual Behavior
CMake error

Starting >>> webrtc  
Starting >>> webrtc_ros_msgs
--- stderr: webrtc                                                                    
build/get_gn: line 17: cd: /home/gteref/webrtc_ros/webrtc/build/webrtc/src: No such file or directory
CMake Error at CMakeLists.txt:41 (message):
  cannot fetch GN build tool


---
Failed   <<< webrtc [1.76s, exited with code 1]
Aborted  <<< webrtc_ros_msgs [4.28s]                           

Summary: 0 packages finished [4.59s]
  1 package failed: webrtc
  1 package aborted: webrtc_ros_msgs
  1 package had stderr output: webrtc
  1 package not processed

Note
I have tried updating the commit hashes to the latest commits in the build/webrtc folder, in get_gn and get_webrtc_ros, but that didn't work. From past issues/pull requests, it seems that updating to a newer version of WebRTC is not as trivial as this.

@GTeref GTeref added the bug label Apr 12, 2024
@IliasElabbassi
Copy link

Hello, I'm facing the same issue to compile on Ubuntu 22.04 and ROS 2 Humble ! Were you able to solve this ?

@IliasElabbassi
Copy link

CMake Error at CMakeLists.txt:41 (message):
  cannot fetch GN build tool

Try adding execute privilege to the scripts within ~/webrtc_ws/src/webrtc/build

chmod +x ~/webrtc_ws/src/webrtc/build/get_*
chmod +x ~/webrtc_ws/src/webrtc/build/prepare_webrtc_build

This might solve this problem, but it will not solve all the errors that might occur when building the package.

@EricVoll
Copy link

EricVoll commented Jul 12, 2024

I made some progress on this:

in webrtc_ros/webrtc/build/get_gn you have to remove python in L3 and replace python with python3 on L29.
Additionally I downloaded gn and ninja manually and added it to the path. Then deleted the webrtc and depot_tools folders and now it has been building for about 5 minutes...

(ROS 2 Jazzy though)

Additional changes:

  • webrtc/build/webrtc/src/rtc_base/third_party/base64/base64.h: add #include <cstdint>
  • webrtc/build/webrtc/src/build/util/lastchange.py: replace utcfromtimestamp with fromtimestamp on L318
  • webrtc_ros/CMakeLists.txt: add ament_index_cpp::ament_index_cpp in L70
  • cv_bridge/cv_bridge.h -> .hpp
  • RTC_DISALLOW_COPY_AND_ASSIGN doesn't exist anymore -> use =delete now.
  • webrtc_client.cpp and webrtc_ros_server.cpp: Invoke was renamed to BlockingCall and signature changed a lot.
  • bind.h doesn't exist anymore: replace calls with lambda e.g. [t = (WebrtcRosServer*)_this, channel]{t->handle_new_signaling_channel(channel);} See commit in webrtc repo.

At this point the webrtc build succeeds, but now there are tons of errors in webrtc_ros (e.g., webrtc/rtc_base/bind.h doesn't exist anymore etc.)

@EricVoll
Copy link

I got it to build now

@EricVoll EricVoll mentioned this issue Jul 12, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants