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 1. D435i Specification
- 2 2. Setup
- 3 3. Build and Install Intel Realsense SDK tool
- 3.1 3.1 Install dependencies
- 3.2 3.2 Clone the librealsense2 repo and check out v2.55.1
- 3.3 3.3 Run Intel Realsense permissions script from librealsense2 root directory:
- 3.4 3.4 Modify the path by adding the following line to the .bashrc file:
- 3.5 3.5 Build and Install librealsense2 SDK
- 3.6 3.6 Install RealSense SDK pyrealsense2 Python bindings for librealsense:
- 3.7 3.7 Intel Realsense2 SDK binary release files download
- 4 4. Test
1. D435i Specification
2. Setup
2.1 Enable D435i Gyroscope and Accelerometer in Linux Kernel Configuration
Enter the kernel configuration by running the following command in the top directory of project
make kconfig
Selects sub-menus:
Device Drivers>HID support>User-space I/O support for HID subsystem
Device Drivers>HID support>Special HID drivers>HID Sensors framework support
> HID Sensors hub custom sensor support
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
Make Ubuntu up-to-date
Install the core packages required to build librealsense2 binaries and the affected kernel modules
Install build tools
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
Navigate to librealsense2 root directory and run:
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.
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.
4.1 rs-data-capture: catpure video amd imu streams data
Create config file d435i.cfg with below content.
Use below command to get data and save data as d435i.csv file.
Check content of d435i.csv
4.2 rs-capture: capture video amd imu streams data with GUI interface