How to install ROS Wrapper for Intel RealSense Device D435i for Jetson Nano run Ubuntu 20.04.6 arm64
Hi, I followed the steps as shown in the link on Jetson Nano running Ubuntu 20.04.6 with arm64.
https://github.com/IntelRealSense/librealsense/blob/master/doc/installation_jetson.md
After I execute the command: sudo apt-get install librealsense2-utils
Then got the following error: Unable to locate package librealsense2-utils.
Can you help me to solve this problem?
Thank you!
-
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
-
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! -
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.
-
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
-
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 npdef 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 pdef 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! -
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
-
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/
-
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
Please sign in to leave a comment.
Comments
16 comments