jetson_csi_cam icon indicating copy to clipboard operation
jetson_csi_cam copied to clipboard

Gscam reports `gst_uri_is_valid (uri)` error on startup, but video still works.

Open peter-moran opened this issue 6 years ago • 16 comments

The gscam node reports a failure from GStreamer on startup for all launches. Specifically, if gives the following error.

GStreamer-CRITICAL **: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed

However, the lauch file remains fully functional and video still appears to work. It would be ideal to prevent this error even though everything seems functional.

peter-moran avatar Aug 23 '17 20:08 peter-moran

Encountered the same problem, there is no solution?

chalesguo avatar Feb 02 '18 04:02 chalesguo

Unfortunately I haven't looked into it since it does not impact performance.

Last I looked, it seemed like it might be a problem with the formatting of the pipeline string or a brief problem at initialization.

peter-moran avatar Feb 02 '18 05:02 peter-moran

I tried the jetson_csi_cam with the new xavier and e-consystems cuxvr130, but I also get the same error as mentioned above, and no rostopic is published. When running the gst-launch example:

$ gst-launch-1.0 v4l2src device=/dev/video ! "video/x-raw, format=(string)UYVY, width=(int)1920, height=(int)1080" ! nvvidconv ! "video/x-raw(memory:NVMM), format=(string)I420, width=(int)1920, height=(int)1080" ! nvoverlaysink overlay- w=1920 overlay-h=1080 sync=false

supplied from e-consystems, I can successfully view each of the 4 camera streams at /dev/video(0-3). Is there something I have missed in regards to setting up either the cscam parameters or jetson_csi_cam parameters that prevents it to work?

when running: $ roslaunch jetson_csi_cam jetson_csi_cam.launch I get: (gscam:20008): GStreamer-CRITICAL **: 10:42:12.564: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed

Any help would be much appreciated.

feteef avatar Mar 02 '19 10:03 feteef

I am running into this issue on a TX1 and from the logs it seems to be puking on a default calibration file.

[ INFO] [1556845282.545341291]: camera calibration URL: file:///root/.ros/camera_info/csi_cam_0.yaml
[ INFO] [1556845282.545543318]: Unable to open camera calibration file [/root/.ros/camera_info/csi_cam_0.yaml]
[ WARN] [1556845282.545596182]: Camera calibration file /root/.ros/camera_info/csi_cam_0.yaml not 
found.

I don't know where to find a default yaml file because I am trying to calibrate the camera right now :D

Neuromancer2701 avatar May 03 '19 01:05 Neuromancer2701

I faced the same problem on Jetson Nano with ROS Melodic and after getting this error, there were no other output in terminal and no topics were published!

Did anyone solve the problem?

Screenshot_1

matkovst avatar Aug 19 '19 08:08 matkovst

I also got this error and didn't see any image topic. I solved it by replacing the definition of GSCAM_CONFIG in jetson_csi_cam.launch with the following lines:

  <env name="GSCAM_CONFIG" value="nvarguscamerasrc sensor-id=$(arg sensor_id) ! video/x-raw(memory:NVMM),
    width=(int)$(arg width), height=(int)$(arg height), format=(string)I420, framerate=(fraction)$(arg fps)/1 ! 
    nvvidconv flip-method=2 ! video/x-raw, format=(string)BGRx ! videoconvert" />

It's basically nvarguscamerasrc instead of nvcamerasrc and removing the trailing video/x-raw, format=(string)BGR.

falkoschindler avatar Sep 11 '19 14:09 falkoschindler

Well, I cant really remember wether I found the reason for the error message or not. However I got a setup working in the end using some other gstreamer commands. I used jetson xavier, and 4 4k e-consystem cameras.

ons. 11. sep. 2019, 16:40 skrev Falko Schindler [email protected]:

I also got this error and didn't see any image topic. I solved it by replacing the definition of GSCAM_CONFIG in jetson_csi_cam.launch with the following lines:

It's basically nvarguscamerasrc instead of nvcamerasrc and removing the trailing video/x-raw, format=(string)BGR.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/peter-moran/jetson_csi_cam/issues/1?email_source=notifications&email_token=AK4MV57NCGWGZNJ5FXVIIBDQJD7NJA5CNFSM4DYCCBFKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6OXCVQ#issuecomment-530411862, or mute the thread https://github.com/notifications/unsubscribe-auth/AK4MV55HOWFPFSYIO5HTUJDQJD7NJANCNFSM4DYCCBFA .

feteef avatar Sep 11 '19 15:09 feteef

I had success with the Jetson Nano and the Raspi Cam V2 using the following: <env name="GSCAM_CONFIG" value="nvarguscamerasrc sensor-id=$(arg sensor_id) ! video/x-raw(memory:NVMM), width=(int)$(arg width), height=(int)$(arg height), format=(string)NV12, framerate=(fraction)$(arg fps)/1 ! nvvidconv flip-method=2 ! video/x-raw, format=(string)BGRx ! videoconvert" />

jscatena88 avatar Sep 25 '19 19:09 jscatena88

Well, I cant really remember wether I found the reason for the error message or not. However I got a setup working in the end using some other gstreamer commands. I used jetson xavier, and 4 4k e-consystem cameras. ons. 11. sep. 2019, 16:40 skrev Falko Schindler [email protected]: I also got this error and didn't see any image topic. I solved it by replacing the definition of GSCAM_CONFIG in jetson_csi_cam.launch with the following lines: It's basically nvarguscamerasrc instead of nvcamerasrc and removing the trailing video/x-raw, format=(string)BGR. — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#1?email_source=notifications&email_token=AK4MV57NCGWGZNJ5FXVIIBDQJD7NJA5CNFSM4DYCCBFKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6OXCVQ#issuecomment-530411862>, or mute the thread https://github.com/notifications/unsubscribe-auth/AK4MV55HOWFPFSYIO5HTUJDQJD7NJANCNFSM4DYCCBFA . Can you please tell me what gstreamer commands you followed becuase even i have the same hardware setup and the same error?

qwedaq avatar Jan 31 '20 15:01 qwedaq

You can Just make a standard yaml file for your camera. The yaml file is essentially Just telling how the video stream is being scaled.

fre. 3. mai 2019, 03:16 skrev Seth King [email protected]:

I am running into this issue on a TX1 and from the logs it seems to be puking on a default calibration file.

[ INFO] [1556845282.545341291]: camera calibration URL: file:///root/.ros/camera_info/csi_cam_0.yaml [ INFO] [1556845282.545543318]: Unable to open camera calibration file [/root/.ros/camera_info/csi_cam_0.yaml] [ WARN] [1556845282.545596182]: Camera calibration file /root/.ros/camera_info/csi_cam_0.yaml not found.

I don't know where to find a default yaml file because I am trying to calibrate the camera right now :D

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/peter-moran/jetson_csi_cam/issues/1#issuecomment-488885682, or mute the thread https://github.com/notifications/unsubscribe-auth/AK4MV56YOKVHXUJGN5MHBTDPTOHANANCNFSM4DYCCBFA .

feteef avatar Jan 31 '20 16:01 feteef

You can Just make a standard yaml file for your camera. The yaml file is essentially Just telling how the video stream is being scaled. fre. 3. mai 2019, 03:16 skrev Seth King [email protected]: I am running into this issue on a TX1 and from the logs it seems to be puking on a default calibration file. [ INFO] [1556845282.545341291]: camera calibration URL: file:///root/.ros/camera_info/csi_cam_0.yaml [ INFO] [1556845282.545543318]: Unable to open camera calibration file [/root/.ros/camera_info/csi_cam_0.yaml] [ WARN] [1556845282.545596182]: Camera calibration file /root/.ros/camera_info/csi_cam_0.yaml not found. I don't know where to find a default yaml file because I am trying to calibrate the camera right now :D — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#1 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/AK4MV56YOKVHXUJGN5MHBTDPTOHANANCNFSM4DYCCBFA .

I am new to yaml language. it would be very helpul if you could just share your yaml file for camera

qwedaq avatar Feb 03 '20 11:02 qwedaq

I will just leave a example from our project on how we got it working with the e-consystems cameras.

This code is based on the code from Peter Moran, and edited to work with our system.

    <launch/>
    <!-- Launchfile to publish 4 (In this case just 1) camera feeds to ros topics -->

<!-- Camera driver setup-->
    <node name="camerasetup" pkg="Nameofproject" type="camsetup.sh" />



   <!-- Run GStreamer 1.0-->
   <arg name="GST10" default="true"/>
   <arg name="width" default="(int)3840" />                        <!-- Image Width -->
   <arg name="height" default="(int)2160" />                       <!-- Image Height -->

   <!-- Arguments for camera north -->
   <arg name="Camera_North" default="/dev/video2"/>
   <!-- The GStreamer framerate needs to be an integral fraction -->
   <arg name="FPS_North" default="30/1"/>
   <arg name="PUBLISH_FRAME_North" default="true"/>

   <node ns="cn" 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/calibrated_parameters_north.ini"/>

   <param if="$(arg GST10)" name="gscam_config" value="v4l2src device=$(arg Camera_North) !   capsfilter caps=&quot;video/x-raw, width=$(arg width),height=$(arg height)&quot; ! videoconvert"/>
   <param name="frame_id" value="/v4l_frame"/>
   <param name="sync_sink" value="true"/>
   </node>

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

As you see it asks for a camera calibration .ini file in which where the calibration parameters for the camera sits.

Just make a ini file in one editor and paste the following( obviously you need to change so it fits your camera with regards to resolution, and the other parameters in the camera matrix) Ask me if you need explaination for the camera matrix The distortion, rectification, and projection is were you put the calibration parameters after you run the calibration routine.

Camera intrinsics

[image]

width 3840

height 2160

[default]

camera matrix 2244.457247 0.000000 1903.497244 0.000000 2244.457247 1039.243884 0.000000 0.000000 1.000000

distortion -0.246884 0.060722 -0.001016 -0.000845 0.000000

rectification 1.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 1.000000

projection 2244.457247 0.000000 1903.497244 0.000000 0.000000 2244.457247 1039.243884 0.000000 0.000000 0.000000 1.000000 0.000000

After you get the camera working, you can run a calibration routine and update the ini file to have a "calibrated" camera.

feteef avatar Feb 04 '20 17:02 feteef

For those working on ros melodic TX2, the correct command for the launch file is

<env name="GSCAM_CONFIG" value="nvarguscamerasrc sensor-id=$(arg sensor_id) ! video/x-raw(memory:NVMM), width=(int)$(arg width), height=(int)$(arg height), format=(string)NV12, framerate=(fraction)$(arg fps)/1 ! nvvidconv flip-method=0 ! video/x-raw, format=(string)BGRx ! videoconvert"/>

thariqkhalid avatar Feb 18 '20 12:02 thariqkhalid

@peter-moran hi , i have sovel this bug, because i use tx2 planform, so must use nvarguscamerasrc command. and change jetson_csi_cam.lanuch file , format = (string)NV12, like this

env name="GSCAM_CONFIG" value="nvarguscamerasrc sensor-id=$(arg sensor_id) ! video/x-raw(memory:NVMM), width=(int)$(arg width), height=(int)$(arg height), format=(string)NV12, framerate=(fraction)$(arg fps)/1 ! nvvidconv flip-method=0 ! video/x-raw, format=(string)BGRx ! videoconvert"

if you want add other functions you can read help file of gst-launch-1.0

mfj710 avatar Apr 07 '20 08:04 mfj710

mfj710 avatar Apr 07 '20 08:04 mfj710

I also got this error and didn't see any image topic. I solved it by replacing the definition of GSCAM_CONFIG in jetson_csi_cam.launch with the following lines:

  <env name="GSCAM_CONFIG" value="nvarguscamerasrc sensor-id=$(arg sensor_id) ! video/x-raw(memory:NVMM),
    width=(int)$(arg width), height=(int)$(arg height), format=(string)I420, framerate=(fraction)$(arg fps)/1 ! 
    nvvidconv flip-method=2 ! video/x-raw, format=(string)BGRx ! videoconvert" />

It's basically nvarguscamerasrc instead of nvcamerasrc and removing the trailing video/x-raw, format=(string)BGR.

This worked well! Thank you so much.

mfurkannargul avatar Mar 24 '21 07:03 mfurkannargul