Gscam launch file for Jetson Nano and IMX219 Stereo Camera

Hi!

I’m working with a Jetson Nano Dev Kit B01 and two IMX219 cameras (in a stereo like configuration) connected to each of the CSI connectors of the board. I’m using Jetpack 4.6 and ROS melodic.

Now, I want to publish the cameras’ image into ROS topics, and for that I ended up using the gscam package. The problem is that I don’t think I fully understand how to configure its parameters, and the launch file I wrote doesn’t work. My guess is that I’m not setting up the gscam_config parameter properly, but I couldn’t find any solution.

This is the launch file I wrote so far:

<launch>
	<arg name="left_camera" default=0/>
	<arg name="right_camera" default=1/>
	<arg name="width" default="3280"/>
	<arg name="height" default="2464"/>
	<arg name="fps" default="20/1"/>
	<arg name="format" default="NV12"/>

	<arg name="config_format" dafault="video/x-raw(memory:NVMM), width=$(arg width), height=$(arg height), format=$(arg format), framerate=$(arg fps)"/>

	<group ns="left">
		<node pkg="gscam" type="gscam" name="gscam" output="screen">
			<param name="camera_name" value="default"/>
			<param name="gscam_config" value="nvarguscamerasrc sensor-id=$(arg left_camera) ! $(arg config_format) ! nvvidconv flip-method=6"/>
			<param name="camera_info_url" value="file://$(find my_stereo_camera)/config/calibration/uncalibrated_parameters.ini"/>
			<param name="frame_id" value="/left_frame"/>
			<param name="sync_sink" value="false"/>
			<remap from="left/camera/image_raw" to="left/image_raw"/>
			<remap from="left/camera/camera_info" to="left/camera_info"/>
		</node>
	</group>
	<group ns="right">
		<node pkg="gscam" type="gscam" name="gscam" output="screen">
			<param name="camera_name" value="default"/>
			<param name="gscam_config" value="nvarguscamerasrc sensor-id=$(arg right_camera) ! $(arg config_format) ! nvvidconv flip-method=6"/>
			<param name="camera_info_url" value="file://$(find my_stereo_camera)/config/calibration/uncalibrated_parameters.ini"/>
			<param name="frame_id" value="/right_frame"/>
			<param name="sync_sink" value="false"/>
			<remap from="right/camera/image_raw" to="right/image_raw"/>
			<remap from="right/camera/camera_info" to="right/camera_info"/>
		</node>
	</group>
</launch>

Any clue of what could I be missing?

Also, I tested both cameras with the following command in the terminal:

DISPLAY=:0.0 gst-launch-1.0 nvarguscamerasrc sensor-id=0 ! 'video/x-raw(memory:NVMM), width=3280, height=2464, format=(string)NV12, framerate=(fraction)20/1' ! nvoverlaysink -e

May below link help on you.

Shane, thanks for your reply. Though, I couldn’t find there what I was looking for.

But I did find a solution here.

So for those who might find it helpful in the future, the working launch file:

<launch>
	<arg name="left_camera" default="0"/>
	<arg name="right_camera" default="1"/>
	<arg name="width" default="3280"/>
	<arg name="height" default="2464"/>
	<arg name="fps" default="20/1"/>
	<arg name="format" default="NV12"/>

	<group ns="left">
		<node pkg="gscam" type="gscam" name="gscam">
			<param name="camera_name" value="default"/>
			<param name="gscam_config" value="nvarguscamerasrc sensor-id=$(arg left_camera) ! video/x-raw(memory:NVMM), width=(int)$(arg width), height=(int)$(arg height), format=(string)$(arg format), framerate=(fraction)$(arg fps) ! nvvidconv flip-method=6 ! video/x-raw, format=(string)BGRx ! videoconvert"/>
			<param name="camera_info_url" value="file://$(find my_stereo_camera)/config/calibration/uncalibrated_parameters.ini"/>
			<param name="frame_id" value="/left_frame"/>
			<param name="sync_sink" value="false"/>
			<remap from="camera/image_raw" to="image_raw"/>
			<remap from="camera/camera_info" to="camera_info"/>
		</node>
	</group>
	<group ns="right">
		<node pkg="gscam" type="gscam" name="gscam">
			<param name="camera_name" value="default"/>
			<param name="gscam_config" value="nvarguscamerasrc sensor-id=$(arg right_camera) ! video/x-raw(memory:NVMM), width=(int)$(arg width), height=(int)$(arg height), format=(string)$(arg format), framerate=(fraction)$(arg fps) ! nvvidconv flip-method=6 ! video/x-raw, format=(string)BGRx ! videoconvert"/>
			<param name="camera_info_url" value="file://$(find my_stereo_camera)/config/calibration/uncalibrated_parameters.ini"/>
			<param name="frame_id" value="/right_frame"/>
			<param name="sync_sink" value="false"/>
			<remap from="camera/image_raw" to="image_raw"/>
			<remap from="camera/camera_info" to="camera_info"/>
		</node>
	</group>
</launch>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.