Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any suggestion for jetson nano installation? #3759

Closed
dongxuanlb opened this issue Apr 15, 2019 · 20 comments
Closed

Any suggestion for jetson nano installation? #3759

dongxuanlb opened this issue Apr 15, 2019 · 20 comments

Comments

@dongxuanlb
Copy link

I notice that jetson nano with kernel-4.9 and jetpack3.3. And the cpu is a57 and no onboard emmc.

Has any one had installed the sdk successfully?

@christopherbate
Copy link

NVIDIA is using the camera (435 I believe) as a demonstrated supported part in their Isaac robotics program. In some youtube videos you can see their demonstrated robots with the camera and theJetson Nano.

With the Isaac build system, everything is cross compiled on an x86 host and shipped over the network to the Nano, and they are using Jetpack 4.2

I've been trying to get my camera (435i) to work with the nano, but so far no luck. It seems to show up as a USB2.0 device. Might be a power issue as the same thing happens with my laptop sometimes.

I've cross compiled their kernel with the suggested patches from Intel, should be able to test that later tonight.

@constructive-realities
Copy link

Hmm... yes it would be nice to use 400 series with jetpack 4.2 without a ton of kernel module hijinx.

@bys1123
Copy link

bys1123 commented Apr 19, 2019

@christopherbate Is that works?

@ChaseLewis
Copy link

ChaseLewis commented Apr 20, 2019

trying to compile the real sense library on the nano but when I run cmake I get 'xinerama headers were not found'. Any ideas?

-- Info: REALSENSE_VERSION_STRING=2.20.0
-- Setting Unix configurations
-- Checking internet connection...
-- Internet connection identified, enabling BUILD_WITH_TM2
-- pybind11 v2.2.1
-- Could NOT find Vulkan (missing: VULKAN_LIBRARY VULKAN_INCLUDE_DIR) 
-- Using X11 for window creation
CMake Error at third-party/glfw/CMakeLists.txt:235 (message):
  The Xinerama headers were not found


@christopherbate
Copy link

Hi, I would suggest following the directions on the Isaac robotics link I posted above. It avoid having to compile the library on the device. They also give instructions on some dependencies which need to be installed through APT. I believe they use 430/415, and my issues with 435i may be particular to the 435i model. I will try some more this weekend.

@christopherbate
Copy link

christopherbate commented Apr 21, 2019

@ChaseLewis You need the graphical libraries installed (glfw). Remove your cmake "build" folder and re-run CMake with the -DBUILD_GRAPHICAL_EXAMPLES=false flag. This will eliminate building the viewer and other tools that rely on GUI elements.

Here are the steps I followed for running RS435i on the Nano. We rebuilt the kernel on the device to make things simpler. I recommend starting with a fresh SD card just flashed with the latest JetPack release.

Package dependencies: libhidapi-libusb0 libturbojpeg libncurses5

  1. Go to the L4T download page and download the "BSP Sources" for the Nano.
  2. Untar the sources with untar -xf [name of downloaded file
  3. cd public_sources then untar -xf kernel_src.tbz2
  4. cd kernel/kernel4.9 and zcat /proc/config.gz > .config and cp /lib/firmware/tegra21x_xusb_firmware ./firmware/
  5. make menuconfig and enable HID_SENSOR_ACCEL_3D and HID_SENSOR_GYRO_3D under device drivers -> Industrial I/O (IIO) -> digital gyroscopes / accelerometers These are needed by 435i
  6. Apply HID patch patch -p1 < [librealsense cloned repo directory]/scripts/realsense-hid-ubuntu-xenial-Ubuntu-hwe-4.8.0-58.63_16.04.1.patch
  7. make -j(use a number 3-5). Recommend doing this from terminal over SSH as it will lock up GUI.
  8. sudo make_modules_install
  9. sudo mv /boot/Image /boot/Image-original and cp ./arch/arm64/boot/Image /boot/Image
  10. Do a reboot and verify system loads.
  11. Build realsense library and install. Verify device detected with rs-enumerate-devices then use rs-data-collect to collect some data. Library was built with options -DHWM_OVER_XU=true -DBUILD_GRAPHICAL_EXAMPLES=false

Hope this helps. Again, this is for the 435i, the only camera I have. There's also a workflow for cross-compiling the kernel on your x86 machine. Here are instructions from the offical NV source. Would be much faster to do that and then just copy the kernel over to the SD card.

@bys1123
Copy link

bys1123 commented Apr 21, 2019

Thanks, I'm also only have D435i, I want to install it to my TX2 runs Jetpack4.2(ubuntu18.04), This information really helpful.

@eric-schleicher
Copy link

eric-schleicher commented Apr 22, 2019

@christopherbate, can you elaborate on step 5. make menuconfig

following through the instructions successfully up until this point.

I get the following error

rosuser@jet-nano:~/Downloads/public_sources/kernel$ make menuconfig
make: *** No rule to make target 'menuconfig'.  Stop.

I'm inferring that the steps implies we should expect some UI in which we change the HID_SENSOR_ACCEL_3D and HID_SENSOR_GYRO_3D values? or did i read that wrong?

I opened the .config file and found the HID sensor_accell_3d entries, but the file state very clearly not to edit (at the top)

Any help appreciated.

@christopherbate
Copy link

christopherbate commented Apr 23, 2019 via email

@eric-schleicher
Copy link

ok... eagerly awaiting.

@ChaseLewis
Copy link

ChaseLewis commented Apr 24, 2019

So I got it to build, but now it says 'no module named pyrealsense2'. If I use rs-enumerate devices the camera is found so it has something to do with the python installation after building.

I set the executable to python3 and used sudo make install so I'm a bit confused what I'm doing wrong. I'm trying to run the script with python 3.6.7

chaserlewis@chaserlewis-desktop:/usr/local/lib$ ls
cmake                    pybackend2.cpython-36m-aarch64-linux-gnu.so
libfw.a                  pybackend2.cpython-36m-aarch64-linux-gnu.so.2
librealsense2.so         pybackend2.cpython-36m-aarch64-linux-gnu.so.2.20.0
librealsense2.so.2.20    pybackend2.cpython-36m-aarch64-linux-gnu.so.2.21.0
librealsense2.so.2.20.0  pyrealsense2.cpython-36m-aarch64-linux-gnu.so
librealsense2.so.2.21    pyrealsense2.cpython-36m-aarch64-linux-gnu.so.2.21
librealsense2.so.2.21.0  pyrealsense2.cpython-36m-aarch64-linux-gnu.so.2.21.0
librealsense-file.a      python2.7
libtm.a                  python3.6
pkgconfig

PythonPath

chaserlewis@chaserlewis-desktop:/usr/local/lib$ echo $PYTHONPATH
:/usr/local/lib

How I called CMAKE
chaserlewis@chaserlewis-desktop:/usr/local/lib$ sudo cmake ../ -DBUILD_PYTHON_BINDINGS=bool:true -DPYTHON_EXECUTABLE=/usr/bin/python3

Python Script


import cv2
import numpy as np
import pyrealsense2 as rs
try:
  
    pipeline = rs.pipeline()
    pipeline.start()

    while True:
        frames = pipeline.wait_for_frames()
        depth = frames.get_depth_frame()

        if not depth: 
            continue

        img = np.asanyarray(depth.as_frame().get_data())
        cv2.imshow('depth',img)
        cv2.waitKey(1)
except:
    print("Error!")

Any ideas?

@christopherbate
Copy link

@ChaseLewis Not sure as I don't use the python module. Generally for cmake, you call "cmake ../ (options)" then "make" then "sudo make install".

I have some more complete instructions for those interested on my github that includes an example .config file and a single .patch file for the R32.1 kernel. A few things had to be manually tweaked in the source for the patches to take, so I just wrapped it into one patch. Let me know if any issues and I can try to resolve. The instructions are for cross-compiling the kernel from a seperate computer, so it should be faster.

@kevkruemp
Copy link

@christopherbate I'm trying to follow your guide but I'm encountering an issue with step 4. I'm in a terminal in the ~/Downloads/public_sources/kernel/kernel-4.9 folder but when I try to do the command sudo zcat /proc/config.gz > .config I get the error: "bash: .config: Permission denied" How do I get permission? I thought sudo giving me admin access would be enough, but apparently it is not. Any help you can provide would be greatly appreciated. (I have no experience doing kernel patches) :(

@christopherbate
Copy link

christopherbate commented May 5, 2019

Ok, that command is for grabbing the configuration for the kernel for the computer you run that command on. So you need to be in your Nano's terminal for that command. Then maybe try this (on your Nano):
sudo zcat /proc/config.gz > ~/my-config

Then copy that file ~/my-config to your x86 computer and place it in the /mnt/tegra or whichever directory you specified as the output directory for the kernel build.

(and then rename it to .config)

@evovolker
Copy link

@christopherbate I am working through your kernel patch instructions. When I run the patches I get a message "patching file drivers/iio/accel/hid-sensor-accel-3d.c
Reversed (or previously applied) patch detected! Assume -R? [n]"
Any ideas?

@RealSenseCustomerSupport
Copy link
Collaborator


@dongxuanlb @evovolker Did you still have issue? Looking forward to your update. Thanks!

@evovolker
Copy link

@RealSenseCustomerSupport I got it to work by merging the patches provided by @JetsonHacksNano with an additional patch from @christopherbate,
Thanks

@RealSenseCustomerSupport
Copy link
Collaborator


@evovolker Great news!
@dongxuanlb Any good news from your side? Thanks!

@RealSenseCustomerSupport
Copy link
Collaborator


@dongxuanlb If no other questions for this ticket, will close it now. Please feel free to create new ticket if you still have questions/issues. Thanks!

@bigbellmercy
Copy link

bigbellmercy commented Oct 5, 2020

If a RealSense camera does not work after installation on Jetson Nano, see a solution here (Installation method only for Jetson Nano):
#7333 (comment)

In my case (Ubuntu 18.04 kernel 4.9.140-tegra) , 'No RealSense devices were found!' happened when I installed ros-melodic-realsense2-camera. And, librealsense2-dkms cannot be obtained when I use apt-get using the standard 'Linux Distribution' installation method. But, after I used the method of the link above, it worked well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants