All Projects → BrettRD → ros-gst-bridge

BrettRD / ros-gst-bridge

Licence: other
a bidirectional ros to gstreamer bridge and utilities for dynamic pipelines

Programming Languages

C++
36643 projects - #6 most used programming language
python
139335 projects - #7 most used programming language
CMake
9771 projects
c
50402 projects - #5 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to ros-gst-bridge

webrtcsink
All-batteries included GStreamer WebRTC producer
Stars: ✭ 18 (-60.87%)
Mutual labels:  gstreamer, webrtc
KRS
The Kria Robotics Stack (KRS) is a ROS 2 superset for industry, an integrated set of robot libraries and utilities to accelerate the development, maintenance and commercialization of industrial-grade robotic solutions while using adaptive computing.
Stars: ✭ 26 (-43.48%)
Mutual labels:  ros, ros2
Dockerfiles
Optimized media, analytics and graphics software stack images. Use the dockerfile(s) in your project or as a recipe book for bare metal installation.
Stars: ✭ 98 (+113.04%)
Mutual labels:  gstreamer, webrtc
Awesome Robotic Tooling
Tooling for professional robotic development in C++ and Python with a touch of ROS, autonomous driving and aerospace.
Stars: ✭ 1,876 (+3978.26%)
Mutual labels:  ros, ros2
scout ros
This repository ROS package is suit for scout 2 and scout mini
Stars: ✭ 30 (-34.78%)
Mutual labels:  ros, ros2
docker-nvidia-glx-desktop
MATE Desktop container designed for Kubernetes supporting OpenGL GLX and Vulkan for NVIDIA GPUs with WebRTC and HTML5, providing an open source remote cloud graphics or game streaming platform. Spawns its own fully isolated X Server instead of using the host X server, therefore not requiring /tmp/.X11-unix host sockets or host configuration.
Stars: ✭ 47 (+2.17%)
Mutual labels:  gstreamer, webrtc
Notes
let me know if my notes help you :D (it's a mess, I know)
Stars: ✭ 119 (+158.7%)
Mutual labels:  gstreamer, webrtc
ROS
ROS机器人操作系统 学习(写于2020年夏)
Stars: ✭ 102 (+121.74%)
Mutual labels:  ros, ros2
rclex
Rclex: ROS 2 Client Library for Elixir
Stars: ✭ 77 (+67.39%)
Mutual labels:  ros, ros2
drl grasping
Deep Reinforcement Learning for Robotic Grasping from Octrees
Stars: ✭ 160 (+247.83%)
Mutual labels:  ros, ros2
awesome-webots
Awesome Webots
Stars: ✭ 46 (+0%)
Mutual labels:  ros, ros2
aztarna
aztarna, a footprinting tool for robots.
Stars: ✭ 85 (+84.78%)
Mutual labels:  ros, ros2
astuff sensor msgs
A set of messages specific to each sensor supported by AutonomouStuff.
Stars: ✭ 37 (-19.57%)
Mutual labels:  ros, ros2
jetson csi cam
A ROS package making it simple to use CSI cameras on the Nvidia Jetson TK1, TX1, or TX2 with ROS.
Stars: ✭ 95 (+106.52%)
Mutual labels:  gstreamer, ros
isaac ros visual odometry
Visual odometry package based on hardware-accelerated NVIDIA Elbrus library with world class quality and performance.
Stars: ✭ 101 (+119.57%)
Mutual labels:  ros, ros2
Mediasoup3 Record Demo
Simple Record Demo using Mediasoup 3 and GStreamer
Stars: ✭ 84 (+82.61%)
Mutual labels:  gstreamer, webrtc
linorobot2
Autonomous mobile robots (2WD, 4WD, Mecanum Drive)
Stars: ✭ 97 (+110.87%)
Mutual labels:  ros, ros2
trac ik
ROS 2 port of `trac_ik`, an alternative Inverse Kinematics solver to the popular inverse Jacobian methods in KDL.
Stars: ✭ 14 (-69.57%)
Mutual labels:  ros, ros2
isaac ros apriltag
CUDA-accelerated Apriltag detection
Stars: ✭ 42 (-8.7%)
Mutual labels:  ros, ros2
aws-robomaker-robotics-curriculum
Introductory robotics curriculum
Stars: ✭ 78 (+69.57%)
Mutual labels:  ros, ros2

ros-gst-bridge

A bidirectional, ROS to GStreamer bridge

ROS is great for running exquisitely weird processes on data streams.
GStreamer is great for running complex pipelines with conversions between common formats.

It should be easy to pass data between GStreamer and ROS without loss of information.

Features

gst_bridge

A ROS2 package containing a GStreamer plugin, and simple format conversions (similar goal to cv-bridge). The GStreamer plugin has source and sink elements that appear on the ROS graph as independent ROS nodes. These nodes can be configured by passing parameters via the GStreamer pipeline, and can be assigned names, namespaces, and frame_ids. These nodes can also be launched using gst-launch-1.0, or instantiated in pipelines inside other applications.
Currently implemented are rosaudiosink, rosaudiosrc, rosimagesink, rosimagesrc, rostextsink, and rostextsrc Inspect them with gst-inspect-1.0 --gst-plugin-path=install/gst_bridge/lib/gst_bridge/ rosaudiosink

gst_pipeline

A ROS2 package with a collection of python scripts that handle gstreamer pipeline generation within a ROS node. Simplebin takes a gst-launch-1.0 style pipeline descriptor and assembles basic but extremely versatile pipelines. This collection includes a modular WebRTC signalling system and pipeline handler making it easier to get data to a browser. gst_pipeline exposes properties of gstreamer elements as parameters of the ROS2 node hosting the pipeline, allowing you to tune your pipeline on the fly.

audio_msgs

A message class for transporting raw audio data with metadata equivalent to sensor_msgs/image

Design goals:

  • ROS Messages and GStreamer caps should not lose metadata like timestamps.
  • ROS sim-time and pipeline clocks must be translatable. (accelerated simulations should drive accelerated pipelines)
  • A new message format for Audio messages permitting accurate time stamps, flexible formats, multiple channels, and flexible sample packing.
  • Bridge nodes should be gstreamer bins, not ROS nodes running appsink.
  • A ROS node should hold the pipeline and handle pipeline events, allowing use of ros launch and parameters.
  • The pipeline node should be extensible to allow complex event handling like WebRTC signalling.
  • ROS2 should be useable as an inter-process communication channel

Architecture:

GStreamer is able to run multiple streams in parallel and has an effective threading system. Managing pipeline events is not a resource intensive process, and can be comfortably handled by a Python script without significant loss of performance or generality. This pipeline manager could also be written in C, but the GLib C and ROS C++ conventions make it difficult to avoid memory leaks. A gstreamer pipeline can comfortably manage multiple independent streams, so only one pipeline node should be required on any given host.

The sources and sinks should be implemented as gstreamer elements for a couple of reasons.
GStreamer elements are intended to be compact and versatile, this encourages reduction of code complexity. Ros elements would allow any GStreamer capable application to interact directly with ROS. gst-launch-1.0 --gst-plugin-path=install/gst_bridge/lib/gst_bridge/ rosimagesrc ros-topic="image_raw" ! gamma gamma=2.0 ! rosimagesink ros-topic="image_gamma_corrected" executed from the command line would apply a gamma correction to an image topic.

It is possible to build this using the gstreamer appsrc/appsink API, but it requires re-implementation of the whole plugin architecture that GStreamer implements so well. audio-common and gs-cam have good examples of the gstreamer appsrc/appsink API.

Remaining work

  • Pipeline elements should optionally provide a clock source to GStreamer, to allow the use of ROS sim-time.
  • Pipeline elements should optionally provide a clock source to ROS, to allow the use of pipeline time generated from an external hardware clock.
  • exploration of allocator APIs so that gstreamer can preallocate buffers from the downstream DDS

Examples

  • render a ros std_msgs String message onto a ros sensor_msgs Image
    gst-launch-1.0 --gst-plugin-path=install/gst_bridge/lib/gst_bridge/ rostextsrc ! textrender ! videoconvert ! rosimagesink
  • apply a gamma correction to an image topic
    gst-launch-1.0 --gst-plugin-path=install/gst_bridge/lib/gst_bridge/ rosimagesrc ros-topic="image_raw" ! gamma gamma=2.0 ! rosimagesink ros-topic="image_gamma_corrected"
  • stream a raspberry pi camera over UDP and expose the H264 bitrate as an adjustable ROS2 param
raspicam_udp.config.yaml
/**:
  ros__parameters:
    simple_bins:
      - 'raspicam_udp'
    raspicam_udp:
      descr: 'rpicamsrc bitrate=10000000 preview=0 ! video/x-h264,width=640,height=480,framereate=10/1,profile=high ! h264parse ! rtph264pay config-interval=1 pt=96 ! udpsink host=host.local port=5000'
    gst_plugins_required:
      - 'rpicamsrc'
  • speech recognition as ros string messages gst-launch-1.0 --gst-plugin-path=install/gst_bridge/lib/gst_bridge/ autoaudiosrc ! audioconvert ! audioresample ! pocketsphinx ! queue ! rostextsink
  • your applications here!

Building

Install ROS 2 (instructions for Ubuntu)

Make sure you have the colcon toolchain installed

sudo rosdep init if it has not already been done on this host. (this is safe to do twice)

If you do not yet have a ROS2 workspace, create one ( e.g. mkdir ~/galactic_ws/src )

Clone this repo under the src/ folder of your ROS2 workspace ( git clone https://github.com/BrettRD/ros-gst-bridge.git ~/galactic_ws/src/ros-gst-bridge )

The ros tools colcon and rosdep need to know about your system version of ros, so make sure your environment is set up now: ( source /opt/ros/galactic/setup.bash )

This package requires software that might not already be installed on your host, so run the following in your ROS2 workspace. rosdep will look for package.xml files in your workspace and install dependencies as needed using apt.

rosdep update
rosdep install --from-paths ~/galactic_ws/src/ --ignore-src -r -y

Then you should be able to build the packages with colcon build.

This build step creates new objects that need to be added to your environment. Sourcing (not executing) the workspace setup.bash source ~/galactic_ws/install/setup.bash will add these new objects to your environment.

The gstreamer elements are all built into the same plugin under install/gst_bridge/lib/gst_bridge/librosgstbridge.so . If you still have your ROS2 environment active (from source ~/galactic_ws/install/setup.bash) you should be able to gst-inspect-1.0 install/gst_bridge/lib/gst_bridge/librosgstbridge.so to get a list of the elements provided by the library.

You can get details about a specific element using a command like source ~/galactic_ws/src/install/setup.bash; GST_PLUGIN_PATH=$COLCON_PREFIX_PATH/gst_bridge/lib/gst_bridge gst-inspect-1.0 rosimagesrc

If you inspect the plugin gst-inspect-1.0 without your environment set up, it will fail missing shared objects.

Licenses

  • gst_pipeline: LGPLv3, depends on gstreamer (LGPLv2.1+)
  • gst_bridge: LGPLv3, depends on gstreamer (LGPLv2.1+)
  • audio_msgs: Apache 2
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].