Our goal was to setup a Jetson AGX Xavier to run a vision-based grasping application. To control the robot, we needed a preemptive realtime kernel and for object detection we used a Intel Realsense D435i camera. To get both running we took the following steps:
- We started with having a look at https://github.com/kozyilmaz/nvidia-jetson-rt which does not support Xavier.
- There are discussions on this topic in the forum (https://devtalk.nvidia.com/default/topic/1042378jetson-agx-xavier/preempt-rt-patch-on-jetson-kernel/)
- Inside the kernel source a script can be found which applies the rt patch. But there is no official documentation or support about it, so it might be an experimental setup.
- Based on these sources we applied the rt patch to L4T. We did not manage to patch the running system, instead we patched the kernel before flashing it to the board.
- Follow the instructions in the section "Kernel Customization" of the L4T documentation but before "Building the NVIDIA Kernel" the RT patch was applied: 1. modify /kernel/source/scripts/rt-patch.sh to use tegra_defconfig instead of tegra_gnu_linux_defconfig 2. apply the patch by running /kernel/source$ ./scripts/rt-patch.sh apply-patches
- Continue with "Building the NVIDIA Kernel"
- There is an unofficial hack for using Intel Realsense Cameras on Jetson devices at https://www.jetsonhacks.com/2019/01/21/intel-realsense-d435i-on-nvidia-jetson-agx-xavier/ which we used. The provided scripts needed to be adapted to the rt-patched kernel and the package sources had some issues, so the sources files had to be downloaded manually to be sure to get the right ones. We patched the install scripts from https://github.com/jetsonhacks/buildLibrealsense2Xavier to get things running.
- With the described setup, we still had to reduce the cameras frame-rate to about 6Hz to avoid occasional loss of connection to the device. This might be a problem of the USB-bus rather than the kernel setup though..