Using Intel RealSense Depth Camera D435i

In this guide, we will step-by-step guide you to use video camera D435i on SP7350 platforms.

Table of Contents

1. D435i Specification

2. Setup

2.1 Enable D435i Gyroscope and Accelerometer in Linux Kernel Configuration

  1. Enter the kernel configuration by running the following command in the top directory of project

make kconfig
  1. Selects sub-menus:

Device Drivers>HID support>User-space I/O support for HID subsystem

螢幕擷取畫面 2024-06-18 110837.png

Device Drivers>HID support>Special HID drivers>HID Sensors framework support

> HID Sensors hub custom sensor support

螢幕擷取畫面 2024-06-18 111019.png

Device Drivers>HID support>USB HID drivers>PID device support

Device Drivers>Industrial I/O support>HID Sensor IIO Common>Common modules for all HID Sensor IIO drivers

Device Drivers>Industrial I/O support>HID Sensor IIO Common>Common module (trigger) for all HID Sensor IIO drivers

Device Drivers>Industrial I/O support>Digital gyroscope sensors>HID Gyroscope 3D

Device Drivers>Industrial I/O support>Digital Accelerometers>HID Accelerometers 3D

2.2 Apply uvc, metadata, hid and powerlinefrequency-fix patch for kernel

Patch file :

Patch process is below:

cp uvc_realsense.patch Q654_code_path/linux/kernel cd Q654_code_path/linux/kernel patch -p1 < uvc_realsense.patch

2.3 Compile and Burn

Downloading and Compiling Code | 7. Build code

Because it needs to build realsense SDK tool to use, please choose Ubuntu XFCE or Ubuntu MATE as rootfs when doing “make config”.

2.4 Connect Sensor Module

Using C3V-W board USB3 TYPE C to connect Intel Realsense D435i.

2.5 Check

After the burning is completed, start the board. The system should print the following information through the serial port.

[ 138.864182] uvcvideo: Found UVC 1.50 device Intel(R) RealSense(TM) Depth Camera 435i (8086:0b3a) [ 138.866850] input: Intel(R) RealSense(TM) Depth Ca as /devices/platform/usb3drd0/f80a1000.dwc3/xhci-hcd.1.auto/usb4/4-1/4-1:1.0/input/input6 [ 138.868558] uvcvideo: Found UVC 1.50 device Intel(R) RealSense(TM) Depth Camera 435i (8086:0b3a) [ 139.222833] hid-sensor-hub 0003:8086:0B3A.0004: No report with id 0xffffffff found [ 143.179993] hid-sensor-hub 0003:8086:0B3A.0004: No report with id 0xffffffff found

After the system startup is completed, the video device can be viewed.

Device video0~5 are for Realsense D435i

The iio device can be viewed.

iio:device1 is the device for Accelerometer of realsense D435i. The device sysfs content is below:

You can read sensor data by cat command.

iio:device2 is the device for Gyroscope of realsense D435i. The device sysfs content is below:

You can read sensor data by cat command.

3. Build and Install Intel Realsense SDK tool

3.1 Install dependencies

  1. Make Ubuntu up-to-date

  1. Install the core packages required to build librealsense2 binaries and the affected kernel modules

  1. Install build tools

  1. Prepare Linux Backend and the Dev. Environment

Unplug any connected Intel RealSense camera and run:

3.2 Clone the librealsense2 repo and check out v2.55.1

3.3 Run Intel Realsense permissions script from librealsense2 root directory:

Notice: You can always remove permissions by running: ./scripts/setup_udev_rules.sh --uninstall

3.4 Modify the path by adding the following line to the .bashrc file:

Apply the change:

3.5 Build and Install librealsense2 SDK

  1. Navigate to librealsense2 root directory and run:

  1. Run cmake configure step:

Linux build configuration is presently configured to use the V4L2 backend by default.

Note: Don’t use “-DFORCE_RSUSB_BACKEND=true” or “-DFORCE_LIBUVC=true” build option, or you can’t get gyroscope and accelerometer sensor data by using realsense API.

  1. Recompile and install librealsense2 binaries:

3.6 Install RealSense SDK pyrealsense2 Python bindings for librealsense:

Modify the path by adding the following line to the .bashrc file:

Apply the change:

3.7 Intel Realsense2 SDK binary release files download

Here is Realsense2 SDK v2.55.1 binary release files.

You can download it for using camera directly.

4. Test

It needs to set user sunplus to get permission of video device with below command. Change will be effective after system reboot.

Next you need to update camera FW version to be 5.16.0.1. This version of FW is suit for SDK v2.55.1.

FW can be download from Realsense D400 series FW. The update flow is in below link.

Realsense camera FW update.

4.1 rs-data-capture: catpure video amd imu streams data

rs-data-capature using method

  1. Create config file d435i.cfg with below content.

  1. Use below command to get data and save data as d435i.csv file.

  1. Check content of d435i.csv

4.2 rs-capture: capture video amd imu streams data with GUI interface