ros-drivers / gscam

ROS Camera driver for GStreamer-based video streams.
136 stars 172 forks source link

Shutdown node when pipeline thread finishes #86

Closed jeremyroy closed 1 year ago

jeremyroy commented 1 year ago

The node currently hangs if the pipeline thread finishes. This prevents the use of ROS launch configurations such as setting the node to "required" or respawning the node on exit. Respawning is particularily usefull when using gstreamer with rtsp if for whatever reason the network is unstable or if the rtsp server crashes - the entire system can be more robust to failure.

This PR makes sure the ROS2 node shuts down when the pipeline thread finishes.

clydemcqueen commented 1 year ago

Sorry for the delay. Nice catch.

I tested this on Humble and it works as advertised:

export GSCAM_CONFIG="videotestsrc num-buffers=300 ! video/x-raw ! videoconvert"
ros2 run gscam gscam_node

@wep21 @jbohren Can we merge this?