View my account

How to install ROS Wrapper for Intel RealSense Device D435i for Jetson Nano run Ubuntu 20.04.6 arm64

Comments

16 comments

  • MartyG

    Hi Dothanhnguyen1403  There are not Arm64 librealsense packages available for Ubuntu 20.04 unfortunately, so librealsense must be built from source code on Arm devices that are using 20.04.  A set of instructions for building from source code on Nano can be found at the link below.

    https://github.com/IntelRealSense/librealsense/issues/6964#issuecomment-707501049

     

    Once librealsense has been successfully installed then the RealSense ROS wrapper can be built from source code.

     

    ROS1

    https://github.com/IntelRealSense/realsense-ros/tree/ros1-legacy

    ROS2

    https://github.com/IntelRealSense/realsense-ros

    0
    Comment actions Permalink
  • Dothanhnguyen1403

    Hi MartyG, I followed your tutorial link, but to step 5,

    After I execute the command:
    cmake ../ -DFORCE_RSUSB_BACKEND=ON -DBUILD_PYTHON_BINDINGS:bool=true - DPYTHON_EXECUTABLE=/usr/bin/python3.8.10 -DCMAKE_BUILD_TYPE=release -DBUILD_EXAMPLES=true -DBUILD_GRAPHICAL_EXAMPLES=true -DBUILD_WITH_CUDA:bool=true

    Then, I got the following error:
    CMake Error: The source directory "/media/amr/amr/catkin_ws/src/librealsense-2.53.1/build/DPYTHON_EXECUTABLE=/usr/bin/python3.8.10" does not exist. Specify --help for usage, or press the help button on the CMake GUI. CMake Error: The source directory "/media/amr/amr/catkin_ws/src/librealsense-2.53.1/build/DPYTHON_EXECUTABLE=/usr/bin/python3.6" does not exist. Specify --help for usage, or press the help button on the CMake GUI.
    (My python version is 3.8.10)
    Can you help me to solve this problem?
    Thank you!


    0
    Comment actions Permalink
  • MartyG

    You could try - DPYTHON_EXECUTABLE=/usr/bin/python3.8 instead of 3.8.10

     

    I note that you appear to be attempting to install librealsense inside the catkin_ws directory.  This directory is only for installing the RealSense ROS wrapper in, and librealsense should not be installed in it when building it from source code.

     

    After having downloaded and extracted the librealsense source code file, you should navigate to the librealsense folder containing a list of files.  This is typically the second folder down (librealsense-2.53.1 > librealsense-2.53.1).

     

     

     

    If you are planning to use the RealSense ROS wrapper then you should download the source code for librealsense 2.51.1 as there is not a ROS wrapper designed specially for 2.53.1 at the time of writing this.

    https://github.com/IntelRealSense/librealsense/releases/tag/v2.51.1

     

    Once in the librealsense folder with the list of folders and files, use the command mkdir build && cd build to create a folder called 'build' and change directory so that you are in it.  Then input your CMake build instruction to build librealsense within the 'build' folder.

    0
    Comment actions Permalink
  • Dothanhnguyen1403

    Hi MartyG!
    Thanks for your replies, i want to to get IMU data from camera D435i on jetson run Ubuntu, can you help me to solve this problem.
    Thank you!

    0
    Comment actions Permalink
  • MartyG

    If you are using the RealSense ROS wrapper then you can publish the IMU topics using the launch instructions below.

     

    ROS1

    roslaunch realsense2_camera rs_camera.launch enable_gyro:=true enable_accel:=true unite_imu_method:=linear_interpolation

    ROS2

    ros2 launch realsense2_camera rs_launch.py enable_gyro:=true enable_accel:=true unite_imu_method:=2

     

    If you are using the librealsense SDK instead of ROS and are writing a script, below are some C++ and Python examples of programs that make use of the IMU.

     

    C++

    https://github.com/IntelRealSense/librealsense/tree/master/examples/motion

    Python

    https://github.com/IntelRealSense/librealsense/issues/8492

    0
    Comment actions Permalink
  • Dothanhnguyen1403

    Hi MartyG!
    I'm using RealSense ROS wrapper, after i run command: roslaunch realsense2_camera rs_camera.launch enable_gyro:=true enable_accel:=true unite_imu_method:=linear_interpolation
    Then, I got the following error:

    And i try use python script:

    import pyrealsense2 as rs
    import numpy as np

    def initialize_camera():
    # start the frames pipe
    p = rs.pipeline()
    conf = rs.config()
    conf.enable_stream(rs.stream.accel)
    conf.enable_stream(rs.stream.gyro)
    prof = p.start(conf)
    return p

    def gyro_data(gyro):
    return np.asarray([gyro.x, gyro.y, gyro.z])

    def accel_data(accel):
    return np.asarray([accel.x, accel.y, accel.z])

    p = initialize_camera()
    try:
    while True:
    f = p.wait_for_frames()
    accel = accel_data(f[0].as_motion_frame().get_motion_data())
    gyro = gyro_data(f[1].as_motion_frame().get_motion_data())
    print("accelerometer: ", accel)
    print("gyro: ", gyro)

    finally:
    p.stop()

    I got error:

     Can you help me to solve this problem?
    Thank you!

    0
    Comment actions Permalink
  • MartyG

    Does the ROS error still occur if you reset the camera at launch with the initial_reset:=true instruction?

     roslaunch realsense2_camera rs_camera.launch enable_gyro:=true enable_accel:=true unite_imu_method:=linear_interpolation initial_reset:=true

     

    In the Python script, does it work if you change 'import pyrealsense2 as rs' to this:

    import pyrealsense2.pyrealsense2 as rs

    0
    Comment actions Permalink
  • Dothanhnguyen1403

    Hi MartyG, i'm still get error : "Failed to set power state"
    after i run:  roslaunch realsense2_camera rs_camera.launch enable_gyro:=true enable_accel:=true unite_imu_method:=linear_interpolation initial_reset:=true

    And  if i try use python script, i got error:


    0
    Comment actions Permalink
  • MartyG

    Are you able to use the realsense-viewer tool?  If you are, is the camera detected in it and can you use the IMU by enabling the Motion Module in the options side-panel?

    0
    Comment actions Permalink
  • Dothanhnguyen1403

    When i use the realsense-viewer tool, i still get error: Failed to set power state

     

    0
    Comment actions Permalink
  • Dothanhnguyen1403

    When i run Ubuntu 20.04 on Oracle VM VirtualBox, i use librealsense v2.53.1, it's OK.

     

    0
    Comment actions Permalink
  • MartyG

    Does your model of Jetson Nano have a barrel jack connector for providing extra power?  If your Nsno does have one then Intel strongly recommend enabling it using the instructions at the link below.

    https://www.jetsonhacks.com/2019/04/10/jetson-nano-use-more-power/

    0
    Comment actions Permalink
  • Dothanhnguyen1403

    Hi MartyG, my Jetson Nano dev-kit-A doens't have barrel jack J48, but i run jetson at mode MAXN.

    0
    Comment actions Permalink
  • MartyG

    Are you using Oracle VM VirtualBox on the Nano?

    0
    Comment actions Permalink
  • Dothanhnguyen1403

    I use Oracle VM VirtualBox on PC run Window.

     

    0
    Comment actions Permalink
  • MartyG

    It sounds as though the entire camera is not being detected on Nano, not just the camera's IMU.  As the camera can be detected on Windows, we can assume that the camera hardware, USB cable and camera firmware driver are okay, and it is an issue with Nano specifically.

     

    Did you build librealsense from source code in the librealsense-2.51.1/build folder like in my instructions at the link below, please?  It looks as though you are running your Python script from the /catkin_ws/src folder.

    https://support.intelrealsense.com/hc/en-us/community/posts/17013512540179/comments/17053189134227

    0
    Comment actions Permalink

Please sign in to leave a comment.