ros-drivers / gscam

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

assertion failed #37

Open makabe0510 opened 7 years ago

makabe0510 commented 7 years ago

I'm trying to use DFKJ003 cam via gstreamer. But , I always get following error. Please tell me how to run this .launch file.

[gscam2.launch]

[error message] $ roslaunch gscam2.launch



ERROR:/home/leus/catkin_ws/src/ros-drivers/gscam/src/gscam.cpp:167:bool gscam::GSCam::init_stream(): assertion failed: (outpad)
[narrow_stereo-1] process has died [pid 5098, exit code -6, cmd /home/leus/catkin_ws/devel/lib/gscam/gscam __name:=narrow_stereo __log:=/home/leus/.ros/log/06b854ea-5c99-11e7-ab90-f44d306d75dc/narrow_stereo-1.log].
log file: /home/leus/.ros/log/06b854ea-5c99-11e7-ab90-f44d306d75dc/narrow_stereo-1*.log
^X^C[creative_view_rect-4] killing on exit
[creative_view-3] killing on exit
[narrow_stereo/creative_image_proc-2] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
done
k-okada commented 7 years ago
  1. what is the content of gscam2.launch
  2. did you try other camera driver? https://github.com/bosch-ros-pkg/usb_cam/ https://github.com/ktossell/libuvc_ros/ https://github.com/ktossell/camera_umd/ https://github.com/ros-drivers/video_stream_opencv/ https://github.com/OTL/cv_camera
k-okada commented 7 years ago

I want to use gstreamer pipeline for using my camera

which function of gstreamer are you using?

makabe0510 commented 7 years ago

I don't want to use gstreamer if there is other way to use my camera.

To read this tiscamera README.md , I could use camera to type following command

"gst-launch-1.0 tcambin serial=12710001! video/x-raw,format=RGBx,width=640,height=480,framerate=30/1 ! videoconvert ! autovideosink".

URL: https://github.com/TheImagingSource/tiscamera

I don't know gstreamer well.

So if there is other way to use tiscamera, I do that.

makabe0510 commented 6 years ago

After researching , I found that the problem may be occured by differerence of gstreamer version. Pipeline I want to use contains elements like "videoconvert ! autovideosink" those used in gstreamer ver 1.0. But , in sample code like v4l.launch, there is element like "ffmpegcolorspace" that used in gstreamer ver 0.10.

I have to use camera via gstreamer 1.0 since developper of the camera only provides pipelines using gstreamer 1.0 elements. So I want to know whether there is way to use gscam using gstreamer 1.0.

k-okada commented 6 years ago

It seems 1.0 version of gscam is only released on lunar -> https://github.com/ros-drivers-gbp/gscam-release, so what you can do right now is

  1. download latest source code from https://github.com/ros-drivers/gscam and compile in your workspace. this should link to gstreamer 1.0
  2. create deb package from release repository for indigo
    git clone https://github.com/ros-drivers-gbp/gscam-release -b debian/lunar/xenial/gscam
    cd gscam-release/
    apt-get install libgstreamer1.0-dev
    apt-get install libgstreamer-plugins-base1.0-dev
    sed -i 's@lunar@indigo@g' debian/compat  debian/control debian/rules  debian/changelog
    dpkg-buildpackage -rfakeroot -uc -b

To use your camera from released deb package, we can choose a. release gscam 1.0 for indigo/kinetic.... if gstremaer 1.0 does support all gstremer 0.1 functions, then its ok, but if some function do not work, this is dangerous for users who already using gstrem b. release latest gscam package with different name to avoid the above problem.

makabe0510 commented 6 years ago

After doing that, launched below .launch file. But there was same error before installing new gscam. Is there something to do after building package?

<launch>
  <!-- This launchfile should bring up a node that broadcasts a ros image                                                                       
       transport on /webcam/image_raw -->

  <arg name="DEVICE" default="/dev/video0"/>
  <!-- The GStreamer framerate needs to be an integral fraction -->
  <arg name="FPS" default="30/1"/>
  <arg name="PUBLISH_FRAME" default="false"/>
  <arg name="GST10" default="True"/>

  <node ns="v4l" name="gscam_driver_v4l" pkg="gscam" type="gscam" output="screen">
    <param name="camera_name" value="default"/>
    <param name="camera_info_url" value="package://gscam/examples/uncalibrated_parameters.ini"/>
    <param unless="$(arg GST10)" name="gscam_config" value="v4l2src device=$(arg DEVICE) ! video/x-raw,framerate=$(arg FPS) ! ffmpegcolorspace"\
/>
    <param if="$(arg GST10)" name="gscam_config" value="v4l2src device=$(arg DEVICE) ! video/x-raw,framerate=$(arg FPS) ! videoconvert ! autovi\
deosink"/>
    <param name="frame_id" value="/v4l_frame"/>
    <param name="sync_sink" value="true"/>
  </node>

  <node if="$(arg PUBLISH_FRAME)" name="v4l_transform" pkg="tf" type="static_transform_publisher" args="1 2 3 0 -3.141 0 /world /v4l_frame 10"/\
>
</launch>

$ roslaunch test.launch ... logging to /home/leus/.ros/log/e0153e24-a429-11e7-90d7-f44d306d75dc/roslaunch-taurus-27777.log Checking log directory for disk usage. This may take awhile. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://133.11.216.199:40200/

SUMMARY

PARAMETERS

NODES /v4l/ gscam_driver_v4l (gscam/gscam)

auto-starting new master process[master]: started with pid [27789] ROS_MASTER_URI=http://localhost:11311

setting /run_id to e0153e24-a429-11e7-90d7-f44d306d75dc process[rosout-1]: started with pid [27802] started core service [/rosout] process[v4l/gscam_driver_v4l-2]: started with pid [27819] [ INFO] [1506588542.449827643]: Using gstreamer config from rosparam: "v4l2src device=/dev/video0 ! video/x-raw,framerate=30/1 ! videoconvert ! autovideosink" [ INFO] [1506588542.452468444]: camera calibration URL: package://gscam/examples/uncalibrated_parameters.ini [ INFO] [1506588542.452698841]: Loaded camera calibration from package://gscam/examples/uncalibrated_parameters.ini * ERROR:/home/leus/catkin_ws/src/ros-drivers-gbp/gscam-release/src/gscam.cpp:167:bool gscam::GSCam::init_stream(): assertion failed: (outpad) [v4l/gscam_driver_v4l-2] process has died [pid 27819, exit code -6, cmd /home/leus/catkin_ws/devel/lib/gscam/gscam name:=gscam_driver_v4l log:=/home/leus/.ros/log/e0153e24-a429-11e7-90d7-f44d306d75dc/v4l-gscam_driver_v4l-2.log]. log file: /home/leus/.ros/log/e0153e24-a429-11e7-90d7-f44d306d75dc/v4l-gscam_driver_v4l-2.log