Boson connected to jetson

7 visualizzazioni (ultimi 30 giorni)
TwistX
TwistX il 4 Set 2024
Hello,
I am trying to run some example scripts while my Jetson AGX Orin is connected to my computer. Two cameras are "normal" RGB cameras. One is a Boson LWIR 320. That one is giving me issues when I run this example:
The error I get is:
camlist = getCameraList(hwobj);
Index in position 1 exceeds array bounds. Index must not exceed 3.
Error in nvidiaio.internal.getCameraList (line 68)
'Resolutions', reshape(res(locIdx,:,:), [size(res,2) size(res,3)])); %#ok<AGROW>
Error in nvidiaboard/getCameraList
This happens in multiple versions of Matlab. I only get this error when I have the Boson connected, once I disconnect it, the other cameras come up fine. Is there a workaround? The code i'm running is:
hwobj = jetson;
camlist = getCameraList(hwobj);

Risposte (1)

Abhishek Kumar Singh
Abhishek Kumar Singh il 5 Set 2024
It seems that the error arises from the getCameraList function when it attempts to fetch the resolution and pixel format of the Boson LWIR camera. This issue likely occurs because the Boson camera provides its properties in a format that the function does not anticipate, leading to parsing and indexing errors.
Infrared (IR) cameras often output data in formats like radiometric JPEG (RJPEG), radiometric TIFF (RTIFF), or raw thermal data, which embed temperature information into the image frame. These formats might not be directly interpretable as standard image formats, and the function may not account for this since it's not a common workflow.
To circumvent this, only option as of now is to disable the camera using system commands. Here's how you can do it:
1) Identify the camera's USB path using lsusb to find the bus and device numbers for the Boson camera.
2) Use the following command to disable the camera, replacing 1-1.4 with the correct USB path:
echo '1-1.4' | sudo tee /sys/bus/usb/drivers/usb/bind
3) To re-enable the camera, use:
echo '1-1.4' | sudo tee /sys/bus/usb/drivers/usb/bind
These commands can be executed from MATLAB using the system command:
% Disable the camera
system('echo "1-1.4" | sudo tee /sys/bus/usb/drivers/usb/unbind');
% Run your MATLAB script
% ... your MATLAB code ...
% Re-enable the camera
system('echo "1-1.4" | sudo tee /sys/bus/usb/drivers/usb/bind');
This approach should allow you to run your scripts without interference from the Boson camera.
  2 Commenti
JCO
JCO il 5 Set 2024
thank you for the code. i will try this and report back. However I am interested in using the boson with my script. Does this mean this won't be possible?
Abhishek Kumar Singh
Abhishek Kumar Singh il 5 Set 2024
I believe the example you mentioned may not have been designed with IR sensors in mind. However, let's see if we can make it work.
I hope you've followed the recommended setup instructions from Teledyne's documentation or video tutorials.
First, ensure the camera is functioning correctly by following the guide: How to integrate FLIR BOSON Thermal Camera to NVIDIA® Jetson™ Modules?. If the camera works as expected, the problem likely lies with the MATLAB function responsible for extracting camera information.
In the article, you’ll find the following command:
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,height=256,format=GRAY16_LE ! videoconvert ! glimagesink
Make sure to replace /dev/video0 with the correct video device path on your system.
Applications like MATLAB can independently specify the format and resolution they require, often using frameworks like GStreamer. If an application doesn't specify a format, it might default to the camera's settings or negotiate a format.
Given that the driver supports altering pixel formats (RAW8, 16-bit UYVY, RAW14 to RGB or YUV), here are two suggestions:
Set Default Camera Format Using v4l2-ctl:
1-> Install v4l2-ctl as part of the v4l-utils package:
sudo apt-get install v4l-utils
2-> List available video devices and check current settings:
v4l2-ctl --list-devices
v4l2-ctl -d /dev/video0 --all
3-> Set the video format:
v4l2-ctl -d /dev/video0 --set-fmt-video=width=320,height=256,pixelformat=Y16
4-> Verify the changes:
v4l2-ctl -d /dev/video0 --get-fmt-video
5-> Run the example again.
Please note that changes made with v4l2-ctl are temporary and will revert after a reboot.
If these steps don't resolve the issue, consider contacting MATLAB Technical Support. File a ticket under the Product Usage Category at https://www.mathworks.com/support/contact_us.html and include this explanation and all the things you tried.
I hope this helps!

Accedi per commentare.

Prodotti


Release

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by