ros-drivers / gscam

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

Assertion Failed. Unable to publish camera feed in ROS using gscam.cpp #44

Open aishwaryyasarkar opened 6 years ago

aishwaryyasarkar commented 6 years ago

We are trying to work on the camera node of Redtail (https://github.com/NVIDIA-Jetson/redtail/wiki/Launch-Sequence-and-Flying). We have the ZED SDK already set up including the zed-ros-wrapper ROS package.

Although we are able to open the ZED camera by using,

roslaunch zed_wrapper display.launch

and also separately by using GStreamer -

gst-launch-1.0 -v v4l2src device=/dev/video1 ! video/x-raw,framerate=30/1,width=3840,height=1080 ! xvimagesink

but we are unable to publish camera feed in ROS, by running the gscam node -

rosrun gscam gscam _gscam_config:="v4l2src device=/dev/video1 ! video/x-raw,framerate=30/1,width=3840,height=1080 ! xvimagesink"

We get the following error.

nvidia@tegra-ubuntu:~/ws$ rosrun gscam gscam _gscam_config:="v4l2src device=/dev/video1 ! video/x-raw,framerate=30/1,width=3840,height=1080 ! xvimagesink" [ INFO] [1530639947.492156689]: Using gstreamer config from rosparam: "v4l2src device=/dev/video1 ! video/x-raw,framerate=30/1,width=3840,height=1080 ! xvimagesink" [ INFO] [1530639947.499267966]: using default calibration URL [ INFO] [1530639947.499362430]: camera calibration URL: file:///home/nvidia/.ros/camera_info/camera.yaml [ INFO] [1530639947.501065754]: Loaded camera calibration from ** ERROR:/home/nvidia/ws/src/gscam/src/gscam.cpp:167:bool gscam::GSCam::init_stream(): assertion failed: (outpad) Aborted (core dumped)

Tdoe4321 commented 4 years ago

Did you ever find a solution to this? I'm currently having a similar problem with a pi camera on a Jetson Nano.

alexchua0108 commented 3 years ago

Instead of putting 'xvimagesink', should put 'videoconvert' for gst-launch-1.0

As xvimagesink renders video frames to a drawable (XWindow) on a local display using the XVideo extension, so the error message: "ERROR:/home/nvidia/ws/src/gscam/src/gscam.cpp:167:bool gscam::GSCam::init_stream(): assertion failed: (outpad)" is actually complain about "Hey!you are linking the video4linx2 source to your local display instead of linking to the gscam ros driver"

Refer to xvimagesink - https://gstreamer.freedesktop.org/documentation/xvimagesink/index.html?gi-language=c gstreamer source and sink elements - https://gstreamer.freedesktop.org/documentation/application-development/basics/elements.html?gi-language=c