Realsense-ros In tx2 devkit jetpack4.2

Hi everyone:
I used roslaunch realsense2_camera rs_camera.launch filters:=pointcloud and used rostopic hz /camera/depth/color/points to get below log:
nvidia@nvidia-desktop:~$ rostopic hz /camera/depth/color/points
subscribed to [/camera/depth/color/points]
no new messages
average rate: 10.975
min: 0.081s max: 0.112s std dev: 0.00971s window: 11
average rate: 10.815
min: 0.077s max: 0.123s std dev: 0.01304s window: 15
no new messages
average rate: 5.388
min: 0.077s max: 2.076s std dev: 0.42275s window: 22
average rate: 6.217
min: 0.077s max: 2.076s std dev: 0.36203s window: 30
no new messages
average rate: 4.620
min: 0.077s max: 2.092s std dev: 0.48230s window: 33
average rate: 5.395
min: 0.077s max: 2.092s std dev: 0.41947s window: 44
average rate: 5.461
min: 0.077s max: 2.092s std dev: 0.41494s window: 45
no new messages
average rate: 4.920
min: 0.077s max: 2.101s std dev: 0.45767s window: 55
average rate: 5.149
min: 0.077s max: 2.101s std dev: 0.43890s window: 60
no new messages
average rate: 4.648
min: 0.077s max: 2.101s std dev: 0.48032s window: 66
average rate is low and unstable output. we need average rate stable output and can be 30.
Does anybody has an idea what to do?
Thanks to everybody!

hello jz_leetop,

may I know which JetPack release you’re working with?
could you please also check Maximizing Jetson TX2 Performance session to boost the frequency , please also evaluate the results.
thanks

Hi Jerrychang:
JetPack realease I work is jetpack4.2:cat /etc/nv_tegra_release

R32 (release), REVISION: 1.0, GCID: 14531094, BOARD: t186ref, EABI: aarch64, DATE: Wed Mar 13 07:41:08 UTC 2019

when is used sudo jetson_clocks and nvpmodel -m 0:
the output is as below:
nvidia@nvidia-desktop:~$ rostopic hz /camera/depth/color/points
subscribed to [/camera/depth/color/points]
average rate: 16.060
min: 0.038s max: 0.109s std dev: 0.02027s window: 15
average rate: 16.428
min: 0.038s max: 0.109s std dev: 0.02084s window: 31
average rate: 16.225
min: 0.038s max: 0.111s std dev: 0.02024s window: 47
average rate: 16.076
min: 0.038s max: 0.111s std dev: 0.02011s window: 62
average rate: 15.807
min: 0.038s max: 0.149s std dev: 0.02216s window: 78
average rate: 15.655
min: 0.038s max: 0.149s std dev: 0.02382s window: 93
average rate: 15.689
min: 0.038s max: 0.149s std dev: 0.02438s window: 108
average rate: 15.731
min: 0.038s max: 0.149s std dev: 0.02414s window: 124
average rate: 15.662
min: 0.038s max: 0.149s std dev: 0.02385s window: 140
average rate: 15.702
min: 0.038s max: 0.149s std dev: 0.02374s window: 156
average rate: 15.747
min: 0.038s max: 0.149s std dev: 0.02377s window: 171
average rate: 15.648
min: 0.038s max: 0.149s std dev: 0.02436s window: 187
average rate: 15.621
min: 0.038s max: 0.149s std dev: 0.02426s window: 202

hello jz_leetop,

since you got frame-rate improvements to 15~16-fps after switching to performance mode.
may I know what’s the sensor resolution, could you please have a try to reduce it for verifcation.
could you please also check RealSense camera capability, may I also know which camera model you’re working with.
thanks

Hi JerryChang
I don’t know what do it to reduce sensor resolution,beacuse i use cmd,could you give some tips for it. The camera model i usd is D415 and D435,now i test is D415

please check the documentation, Camera Software Development Solution for the sample commands.
you may enable camera streaming with gstreamer commands, or accessing via v4l2-ctl to check the sensor capability.

Hi JerryChang ,
The sensor capability can be 1920x1080

hello jz_leetop,

according to Camera Architecture Stack,
there’s an alternative way to access camera sensor stream without post-processing.

you should also check the frame-rate capability,
you may execute below command to list all available sensor modes.

nvidia@nvidia-desktop:~$ v4l2-ctl -d /dev/video0 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
        Index       : 0
        Type        : Video Capture
        Pixel Format: 'BG10'
        Name        : 10-bit Bayer BGBG/GRGR
                Size: Discrete 2592x1944
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 2592x1458
                        Interval: Discrete 0.033s (30.000 fps)
                Size: Discrete 1280x720
                        Interval: Discrete 0.008s (120.000 fps)

please also have access with v4l2-ctl to fetch sensor streaming, it’ll also report sensor frame rate in average.
for example,

nvidia@nvidia-desktop:~$ v4l2-ctl -d /dev/video0 --set-fmt-video=width=2592,height=1944,pixelformat=BG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=100
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.09 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.04 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.03 fps

Hi JerryChang;
used v4l2-ctl show as blow:

nvidia@nvidia-desktop:~$ v4l2-ctl -d /dev/video0 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: ‘BG10’
Name : 10-bit Bayer BGBG/GRGR
Size: Discrete 2592x1944
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 2592x1458
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 1280x720
Interval: Discrete 0.008s (120.000 fps)

nvidia@nvidia-desktop:~$ v4l2-ctl -d /dev/video0 --set-fmt-video=width=2592,height=1944,pixelformat=BG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=100
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.09 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.04 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.03 fps
<<<<<<<<
nvidia@nvidia-desktop:~$ v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=BG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=100
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.09 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.04 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.03 fps
<<<<<<<<
nvidia@nvidia-desktop:~$ v4l2-ctl -d /dev/video0 --set-fmt-video=width=1280,height=720,pixelformat=BG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=100
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
nvidia@nvidia-desktop:~$

hello jz_leetop,

since the report shows streaming were able to reach 30-fps.
it usually an application issue caused frame drops, should be a post-processing of realsense2_camera.
thanks

Hi Jerrychang,
If switching to performance mode, the output of rostopic hz /camera/depth/color/points is improvement, so it could be influce by AI performanc or others ?

hello jz_leetop,

it should be more samples being calculated to generate more accurate results.

Hi @Leetop_z,

The resolutions you got from the command v4l2-ctl -d /dev/video0 --list-formats-ext seems to be the default for the Jetson Camera Module.

Just to be sure please run the following command:

ls /dev/video*

If you get multiple results, /dev/video0 , /dev/video1 and others, then you must be seeing the incorrect resolution.

To get the default resolutions from ROS you can use the following command:

rs-enumerate-devices

Also please refer to the following ROS guide, you might find useful information there.

Regards,
Fabian
www.ridgerun.com

Hi [fabian.solano.
Thanks for you tips

rs-enumerate-devices.log (22.2 KB)
Hi JerryChang.
I used rs-enumerate-devices to get resolution as attachment

hello jz_leetop,

FYI,
we had Intel RealSense D430 and D435 for verification, camera software stack works normally with those sensors.
due to you already confirm preview streaming were able to reach 30-fps; please contact with your sensor vendor for further questions.
thanks