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

Fix/ros2 jazzy #72

Draft
wants to merge 3 commits into
base: develop-ros2
Choose a base branch
from

Conversation

EricVoll
Copy link

@EricVoll EricVoll commented Jul 12, 2024

Public API Changes
None

Description
Get build to work on Ros2 Jazzy, Ubuntu 24.04.

There are some diffs applied to the cloned webrtc source code (first two bullet points below) I'm not sure how to best apply them in this PR. Maybe apply a patch after pulling the code or something...

Open problems:

  • 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
  • I could not find a proper replacement for the RTC_DISALLOW_COPY_AND_ASSIGN macro, so currently it's commented out. Edit: Found it and fixed.
  • Currently I cloned vision_opencv and checked out 7a47d35, and renamed a few .h to .hpp - I'm not sure if that's needed though, and I forgot where I read that this is required. Edit: yeah, seems to be needed.

#71

After launching:
The webserver launches fine and shows the available topics:
image

But when trying to establish a connection, it crashes.

[webrtc_ros_server_node-2] [INFO] [1720796065.255299670] [webrtc_server]: JSON: {"type":"configure","actions":[{"type":"add_stream","id":"webrtc_ros-stream-975963065"},{"type":"add_video_track","stream_id":"webrtc_ros-stream-975963065","id":"webrtc_ros-stream-975963065/subscribed_video","src":"ros_image:/optical_camera_rear/image_raw"}]}
[webrtc_ros_server_node-2] 
[webrtc_ros_server_node-2] 
[webrtc_ros_server_node-2] #
[webrtc_ros_server_node-2] # Fatal error in: ../../../src/webrtc_ros/webrtc/build/webrtc/src/pc/peer_connection.cc, line 816
[webrtc_ros_server_node-2] # last system error: 0
[webrtc_ros_server_node-2] # Check failed: !IsUnifiedPlan()
[ERROR] [webrtc_ros_server_node-2]: process has died [pid 382174, exit code -6, cmd '/home/er/ros2_ws/install/webrtc_ros/lib/webrtc_ros/webrtc_ros_server_node --ros-args -r __node:=webrtc_server --params-file /tmp/launch_params_y3ih5v_0'].
[webrtc_ros_server_node-2] # AddStream is not available with Unified Plan SdpSemantics. Please use AddTrack instead.

Looks like Unified Plan semantics deprecated a few of the older APIs and the webrtc client need to be rewritten...
https://webrtc.org/getting-started/unified-plan-transition-guide
There's a document on how to migrate native C++ applications to Unified Plan, but I can't access the doc...
I found this page that maybe (?) contains a copy of the document https://blog.csdn.net/dotphoenix/article/details/107480133 but no idea.

@EricVoll EricVoll changed the base branch from develop to develop-ros2 July 12, 2024 13:06
@EricVoll EricVoll marked this pull request as draft July 12, 2024 13:07
@EricVoll
Copy link
Author

Ah there it is. Found the commit that removed the macros...
https://webrtc.googlesource.com/src/+/de95329daa7175fa28a508681ab262596111cc57

@EricVoll
Copy link
Author

Ah there it is. Found the commit that removed the macros... https://webrtc.googlesource.com/src/+/de95329daa7175fa28a508681ab262596111cc57

Ah no... The macro that's being used isn't removed in that PR. Can't find the commit that removed the file.

@EricVoll
Copy link
Author

@PoommipatWat
Copy link

Is your repo(https://github.com/EricVoll/webrtc_ros/tree/fix/ros2_jazzy) works now?

@EricVoll
Copy link
Author

No, I got everything to build and it ran, but the repo is using a deprectated webrtc api which chrome doesn't support anymore. In the end I didn't have the time to update the implementation. I ended up writing a custom ros package based on aiortc in python that offers a REST endpoint for signaling and the local node publishes the streams to webrtc and ROS.

However, that code is proprietary (company) and I can't open source it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants