librealsense icon indicating copy to clipboard operation
librealsense copied to clipboard

Unable to read IMU data on the D435i

Open zbreit opened this issue 4 years ago • 19 comments

Required Info
Camera Model D435i
Firmware Version 05.12.07.150
Operating System & Version Ubuntu 18.04
Kernel Version (Linux Only) 4.9.253-tegra
Platform NVIDIA Jetson Xavier NX
SDK Version 2.50.0
Language python
Segment Robot

Issue Description

Hello :wave:! I'm trying to get a D435i working on my NVIDIA Jetson Xavier NX, but I am unable to stream data from my IMU.

Inside the realsense-viewer, I see all three camera modules (RGB, Stereo, and Motion). When I activate the Motion Module, nothing appears in my Window other than a set of axes.

image

Similarly, when I try to read IMU data inside ros melodic using [email protected], I get the following error:

$ roslaunch realsense2_camera rs_camera.launch initial_reset:=true enable_gyro:=true enable_accel:=true
SUMMARY
========

PARAMETERS
 * /camera/realsense2_camera/accel_fps: -1
 * /camera/realsense2_camera/accel_frame_id: camera_accel_frame
 * /camera/realsense2_camera/accel_optical_frame_id: camera_accel_opti...
 * /camera/realsense2_camera/align_depth: False
 * /camera/realsense2_camera/aligned_depth_to_color_frame_id: camera_aligned_de...
 * /camera/realsense2_camera/aligned_depth_to_fisheye1_frame_id: camera_aligned_de...
 * /camera/realsense2_camera/aligned_depth_to_fisheye2_frame_id: camera_aligned_de...
 * /camera/realsense2_camera/aligned_depth_to_fisheye_frame_id: camera_aligned_de...
 * /camera/realsense2_camera/aligned_depth_to_infra1_frame_id: camera_aligned_de...
 * /camera/realsense2_camera/aligned_depth_to_infra2_frame_id: camera_aligned_de...
 * /camera/realsense2_camera/allow_no_texture_points: False
 * /camera/realsense2_camera/base_frame_id: camera_link
 * /camera/realsense2_camera/calib_odom_file: 
 * /camera/realsense2_camera/clip_distance: -2.0
 * /camera/realsense2_camera/color_fps: -1
 * /camera/realsense2_camera/color_frame_id: camera_color_frame
 * /camera/realsense2_camera/color_height: -1
 * /camera/realsense2_camera/color_optical_frame_id: camera_color_opti...
 * /camera/realsense2_camera/color_width: -1
 * /camera/realsense2_camera/confidence_fps: -1
 * /camera/realsense2_camera/confidence_height: -1
 * /camera/realsense2_camera/confidence_width: -1
 * /camera/realsense2_camera/depth_fps: -1
 * /camera/realsense2_camera/depth_frame_id: camera_depth_frame
 * /camera/realsense2_camera/depth_height: -1
 * /camera/realsense2_camera/depth_optical_frame_id: camera_depth_opti...
 * /camera/realsense2_camera/depth_width: -1
 * /camera/realsense2_camera/device_type: 
 * /camera/realsense2_camera/enable_accel: True
 * /camera/realsense2_camera/enable_color: True
 * /camera/realsense2_camera/enable_confidence: True
 * /camera/realsense2_camera/enable_depth: True
 * /camera/realsense2_camera/enable_fisheye1: False
 * /camera/realsense2_camera/enable_fisheye2: False
 * /camera/realsense2_camera/enable_fisheye: False
 * /camera/realsense2_camera/enable_gyro: True
 * /camera/realsense2_camera/enable_infra1: False
 * /camera/realsense2_camera/enable_infra2: False
 * /camera/realsense2_camera/enable_infra: False
 * /camera/realsense2_camera/enable_pointcloud: False
 * /camera/realsense2_camera/enable_pose: False
 * /camera/realsense2_camera/enable_sync: False
 * /camera/realsense2_camera/filters: 
 * /camera/realsense2_camera/fisheye1_frame_id: camera_fisheye1_f...
 * /camera/realsense2_camera/fisheye1_optical_frame_id: camera_fisheye1_o...
 * /camera/realsense2_camera/fisheye2_frame_id: camera_fisheye2_f...
 * /camera/realsense2_camera/fisheye2_optical_frame_id: camera_fisheye2_o...
 * /camera/realsense2_camera/fisheye_fps: -1
 * /camera/realsense2_camera/fisheye_frame_id: camera_fisheye_frame
 * /camera/realsense2_camera/fisheye_height: -1
 * /camera/realsense2_camera/fisheye_optical_frame_id: camera_fisheye_op...
 * /camera/realsense2_camera/fisheye_width: -1
 * /camera/realsense2_camera/gyro_fps: -1
 * /camera/realsense2_camera/gyro_frame_id: camera_gyro_frame
 * /camera/realsense2_camera/gyro_optical_frame_id: camera_gyro_optic...
 * /camera/realsense2_camera/imu_optical_frame_id: camera_imu_optica...
 * /camera/realsense2_camera/infra1_frame_id: camera_infra1_frame
 * /camera/realsense2_camera/infra1_optical_frame_id: camera_infra1_opt...
 * /camera/realsense2_camera/infra2_frame_id: camera_infra2_frame
 * /camera/realsense2_camera/infra2_optical_frame_id: camera_infra2_opt...
 * /camera/realsense2_camera/infra_fps: 30
 * /camera/realsense2_camera/infra_height: 480
 * /camera/realsense2_camera/infra_rgb: False
 * /camera/realsense2_camera/infra_width: 848
 * /camera/realsense2_camera/initial_reset: True
 * /camera/realsense2_camera/json_file_path: 
 * /camera/realsense2_camera/linear_accel_cov: 0.01
 * /camera/realsense2_camera/odom_frame_id: camera_odom_frame
 * /camera/realsense2_camera/ordered_pc: False
 * /camera/realsense2_camera/pointcloud_texture_index: 0
 * /camera/realsense2_camera/pointcloud_texture_stream: RS2_STREAM_COLOR
 * /camera/realsense2_camera/pose_frame_id: camera_pose_frame
 * /camera/realsense2_camera/pose_optical_frame_id: camera_pose_optic...
 * /camera/realsense2_camera/publish_odom_tf: True
 * /camera/realsense2_camera/publish_tf: True
 * /camera/realsense2_camera/reconnect_timeout: 6.0
 * /camera/realsense2_camera/rosbag_filename: 
 * /camera/realsense2_camera/serial_no: 
 * /camera/realsense2_camera/stereo_module/exposure/1: 7500
 * /camera/realsense2_camera/stereo_module/exposure/2: 1
 * /camera/realsense2_camera/stereo_module/gain/1: 16
 * /camera/realsense2_camera/stereo_module/gain/2: 16
 * /camera/realsense2_camera/tf_publish_rate: 0.0
 * /camera/realsense2_camera/topic_odom_in: odom_in
 * /camera/realsense2_camera/unite_imu_method: 
 * /camera/realsense2_camera/usb_port_id: 
 * /camera/realsense2_camera/wait_for_device_timeout: -1.0
 * /rosdistro: melodic
 * /rosversion: 1.14.12

NODES
  /camera/
    realsense2_camera (nodelet/nodelet)
    realsense2_camera_manager (nodelet/nodelet)

ROS_MASTER_URI=http://localhost:11311

process[camera/realsense2_camera_manager-1]: started with pid [28221]
process[camera/realsense2_camera-2]: started with pid [28222]
[ INFO] [1646869055.630537822]: Initializing nodelet with 6 worker threads.
[ INFO] [1646869055.970920685]: RealSense ROS v2.3.2
[ INFO] [1646869055.971054351]: Built with LibRealSense v2.50.0
[ INFO] [1646869055.971170737]: Running with LibRealSense v2.50.0
[ INFO] [1646869056.075239642]:  
[ INFO] [1646869056.511142245]: Device with serial number 112222071473 was found.

[ INFO] [1646869056.511985939]: Device with physical ID 2-3.1-3 was found.
[ INFO] [1646869056.513606542]: Device with name Intel RealSense D435I was found.
[ INFO] [1646869056.516727298]: Device with port number 2-3.1 was found.
[ INFO] [1646869056.516865445]: Device USB type: 3.2
[ INFO] [1646869056.517486863]: Resetting device...
[ INFO] [1646869062.631294200]:  
[ INFO] [1646869063.076463054]: Device with serial number 112222071473 was found.

[ INFO] [1646869063.077511136]: Device with physical ID 2-3.1-3 was found.
[ INFO] [1646869063.077804997]: Device with name Intel RealSense D435I was found.
[ INFO] [1646869063.079578339]: Device with port number 2-3.1 was found.
[ INFO] [1646869063.079707237]: Device USB type: 3.2
[ INFO] [1646869063.089283653]: getParameters...
[ INFO] [1646869063.484071283]: setupDevice...
[ INFO] [1646869063.484878720]: JSON file is not provided
[ INFO] [1646869063.484982978]: ROS Node Namespace: camera
[ INFO] [1646869063.485066819]: Device Name: Intel RealSense D435I
[ INFO] [1646869063.485137316]: Device Serial No: 112222071473
[ INFO] [1646869063.485209446]: Device physical port: 2-3.1-3
[ INFO] [1646869063.485282087]: Device FW version: 05.12.07.150
[ INFO] [1646869063.485523179]: Device Product ID: 0x0B3A
[ INFO] [1646869063.485638701]: Enable PointCloud: Off
[ INFO] [1646869063.485762511]: Align Depth: Off
[ INFO] [1646869063.485835728]: Sync Mode: Off
[ INFO] [1646869063.485997299]: Device Sensors: 
[ INFO] [1646869063.592392967]: Stereo Module was found.
[ INFO] [1646869063.640798257]: RGB Camera was found.
[ INFO] [1646869063.641592318]: Motion Module was found.
[ INFO] [1646869063.641788738]: (Confidence, 0) sensor isn't supported by current device! -- Skipping...
[ INFO] [1646869063.641948324]: num_filters: 0
[ INFO] [1646869063.642035366]: Setting Dynamic reconfig parameters.
[ INFO] [1646869067.623209358]: Done Setting Dynamic reconfig parameters.
[ INFO] [1646869067.625123822]: depth stream is enabled - width: 848, height: 480, fps: 30, Format: Z16
[ INFO] [1646869067.629327348]: color stream is enabled - width: 1280, height: 720, fps: 30, Format: RGB8
[ INFO] [1646869067.629639001]: gyro stream is enabled - fps: 200
[ INFO] [1646869067.629758875]: accel stream is enabled - fps: 63
[ INFO] [1646869067.629854781]: setupPublishers...
[ INFO] [1646869067.644638005]: Expected frequency for depth = 30.00000
[ INFO] [1646869067.660615520]: Expected frequency for color = 30.00000
[ INFO] [1646869067.691540614]: setupStreams...
 09/03 18:37:47,853 WARNING [547138564480] (ds5-motion.cpp:473) IMU Calibration is not available, default intrinsic and extrinsic will be used.
[ INFO] [1646869068.401903976]: SELECTED BASE:Depth, 0
[ INFO] [1646869068.480539406]: RealSense Node Is Up!
[ WARN] [1646869068.522014917]: 
 09/03 18:37:48,526 WARNING [546836558208] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11
 09/03 18:37:48,577 WARNING [546836558208] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11
 09/03 18:37:48,730 WARNING [546836558208] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11
 09/03 18:37:48,782 WARNING [546836558208] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11
 09/03 18:37:48,832 WARNING [546836558208] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11
 09/03 18:37:48,883 WARNING [546836558208] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11
 09/03 18:37:48,934 WARNING [546836558208] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11
 09/03 18:37:48,985 WARNING [546836558208] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11

Here is some info on what rostopics are being published:

$ rostopic list
/camera/accel/imu_info
/camera/accel/metadata
/camera/accel/sample
/camera/color/camera_info
/camera/color/image_raw
/camera/color/metadata
/camera/depth/camera_info
/camera/depth/image_rect_raw
/camera/depth/metadata
/camera/extrinsics/depth_to_color
/camera/gyro/imu_info
/camera/gyro/metadata
/camera/gyro/sample
/camera/motion_module/parameter_descriptions
/camera/motion_module/parameter_updates
/camera/realsense2_camera_manager/bond
/camera/rgb_camera/auto_exposure_roi/parameter_descriptions
/camera/rgb_camera/auto_exposure_roi/parameter_updates
/camera/rgb_camera/parameter_descriptions
/camera/rgb_camera/parameter_updates
/camera/stereo_module/auto_exposure_roi/parameter_descriptions
/camera/stereo_module/auto_exposure_roi/parameter_updates
/camera/stereo_module/parameter_descriptions
/camera/stereo_module/parameter_updates
/diagnostics
/rosout
/rosout_agg
/tf
/tf_static

$ rostopic echo /camera/accel/sample # Blank

$ rostopic echo /camera/gyro/sample # Blank

$ rostopic echo /camera/accel/imu_info
frame_id: "camera_accel_optical_frame"
data: [1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0]
noise_variances: [0.0, 0.0, 0.0]
bias_variances: [0.0, 0.0, 0.0]
---

$ rostopic echo /camera/gyro/imu_info
frame_id: "camera_gyro_optical_frame"
data: [1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0]
noise_variances: [0.0, 0.0, 0.0]
bias_variances: [0.0, 0.0, 0.0]
---

I'm not sure exactly what's wrong with my setup, but I have a suspicion that it's an issue with my realsense SDK installation. I installed the realsense SDK using the "Install with Debian Packages" instructions in the Jetson installation instructions. I saw that some realsense features may require applying the kernel patches described in the "Building from Source Using the Native backend" section, but I wasn't sure if that applied to the D435i IMU.

Any guidance will be greatly appreciated!

zbreit avatar Mar 10 '22 00:03 zbreit

Hi @zbreit Your image of the RealSense Viewer shows that you are in the 3D point cloud mode, which does not display IMU information. To view the Motion Module data (gyro and accelerometer), left-click on the 2D option in the top corner of the Viewer window.

If you installed the RealSense SDK from packages then you do not need to patch the kernel as the patch is included in the packages.

Your roslaunch log shows that the gyro and accel are detected and published, and the SDK and RealSense ROS wrapper versions are correctly matched.

In regard to the control_transfer returned warnings at the bottom of the log, these can be ignored if they are only appearing at the start of launch or appearing about once a minute instead of generating continuously. If the control_transfer returned warnings are generated continuously though then this may indicate a serious communication problem with the device.

Are the warnings being generated in the log constantly after launch has completed successfully with the message 'RealSense Node is Up!'

Also, can you confirm that you do not have the Motion Module enabled in the Viewer when performing roslaunch, please?

MartyG-RealSense avatar Mar 10 '22 06:03 MartyG-RealSense

Hi @MartyG-RealSense. Thanks for the info--I can't believe I missed 2D mode in the realsense-viewer. I'll have to try it out tomorrow or Monday when I have access to the camera again.

As far as I remember, the control_transfer returned warnings only appeared at the start of launch. I don't think the motion module was enabled in the realsense-viewer when I performed my roslaunch test.

zbreit avatar Mar 11 '22 04:03 zbreit

A couple of other RealSense ROS users had the same problem this year with IMU data and experienced the same control_transfer returned error. One of those users advised at https://github.com/IntelRealSense/realsense-ros/issues/2212#issuecomment-1007003514 that using librealsense 2.48.0 and wrapper 2.3.1 solved the problem in their particular case.

MartyG-RealSense avatar Mar 11 '22 09:03 MartyG-RealSense

I just got back to the lab and tried setting the mode to 2D in the realsense viewer. Unfortunately, I don't seem to be getting any frames of data from the gyro or the accelerometer. On one run of the realsense-viewer, I experienced a Motion Module Error: image

On a separate run, the 2D mode successfully booted up, but no frames were received: image

I am going to try swapping to librealsense 2.48.0 and ROS wrapper 2.3.1. I will report back with any updates.

zbreit avatar Mar 14 '22 19:03 zbreit

There was another case at https://github.com/IntelRealSense/realsense-ros/issues/2213 with a Jetson Xavier NX where the IMU data was not being received in the Viewer, and also not in the RealSense ROS wrapper. They too experienced the Motion module failure error. The camera worked correctly on a PC, indicating that there was not a hardware failure in the IMU. They reported at https://github.com/IntelRealSense/realsense-ros/issues/2213#issuecomment-1008126279 that the IMU problem was resolved after using JetPack 4.5.1.

MartyG-RealSense avatar Mar 14 '22 20:03 MartyG-RealSense

Update 1: I successfully got IMU data in the realsense-viewer by installing librealsense2=2.48.0. On my Jetson NX running Ubuntu 18.04, I had to run the following commands:

# Uninstall all realsense packages
sudo apt remove librealsense2 ros-melodic-realsense2-camera librealsense2-udev-rules ros-melodic-librealsense2

# Reinstall librealsense2 at version 2.48.0 and place those packages on hold (to prevent
# automatic upgrades)
sudo apt install \
	librealsense2=2.48.0-5ubuntu5~1.gbp156c1b \
	librealsense2-udev-rules=2.48.0-5ubuntu5~1.gbp156c1b \
	librealsense2-utils=2.48.0-5ubuntu5~1.gbp156c1b \
	librealsense2-gl=2.48.0-5ubuntu5~1.gbp156c1b \
	librealsense2-net=2.48.0-5ubuntu5~1.gbp156c1b \
	librealsense2-dev=2.48.0-5ubuntu5~1.gbp156c1b
sudo apt-mark hold \
	librealsense2 \
	librealsense2-udev-rules \
	librealsense2-utils \
	librealsense2-gl \
	librealsense2-net \
	librealsense2-dev
	
# To remove the hold on the package versions, just run `sudo apt-mark unhold <package name>`

I will set up ros-melodic-realsense2-camera=2.3.1 momentarily.

zbreit avatar Mar 14 '22 20:03 zbreit

Great to hear about your success with the Viewer! Thanks so much for sharing the details of your method with the RealSense community. :)

MartyG-RealSense avatar Mar 14 '22 20:03 MartyG-RealSense

Update 2: I was able to install the old version of realsense-ros=2.3.1. Unfortunately, installing an old version of ros packages using apt isn't very well supported, so I had to build the package from source

# Setup catkin workspace for realsense-ros=2.3.1
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src/
git clone https://github.com/IntelRealSense/realsense-ros.git
cd realsense-ros/
git checkout 2.3.1
cd ..
catkin_init_workspace
cd ..

# Fix bug w/ catkin_make clean for Jetsons (see 
# https://github.com/ros-perception/vision_opencv/issues/345#issuecomment-663416626).
# If you're not comfortable with the sed command, feel free to manually change `opencv`
# to `opencv4` in the file, as mentioned in the issue above.
sudo sed -i 's/set(_include_dirs "include;\/usr\/include;\/usr\/include\/opencv")/set(_include_dirs "include;\/usr\/include;\/usr\/include\/opencv4")/g' /opt/ros/melodic/share/cv_bridge/cmake/cv_bridgeConfig.cmake
rosdep install --from-paths src --ignore-src -r -y
sudo apt purge ros-melodic-librealsense2
catkin_make clean

Before running the next commands, I had to fix a bug with an undefined find_if() symbol in ~/catkin_ws/src/realsense-ros/realsense2_camera/src/base_realsense_node.cpp. To fix this issue, I replaced all instances of find_if that were missing namespaces to std::find_if (as per https://github.com/IntelRealSense/realsense-ros/issues/910#issuecomment-1062554386).

Finally, I could run

catkin_make -DCATKIN_ENABLE_TESTING=False -DCMAKE_BUILD_TYPE=Release
catkin_make install
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc

In the end, I was able to run

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

However, I still have a problem: IMU samples don't seem to be posted to the appropriate ros topics. Specifically, /camera/gyro/sample and /camera/accel/sample are both empty when I run rostopic echo. Any advice?

Here are my roslaunch logs:

SUMMARY
========

PARAMETERS

  • /camera/realsense2_camera/accel_fps: -1
  • /camera/realsense2_camera/accel_frame_id: camera_accel_frame
  • /camera/realsense2_camera/accel_optical_frame_id: camera_accel_opti...
  • /camera/realsense2_camera/align_depth: False
  • /camera/realsense2_camera/aligned_depth_to_color_frame_id: camera_aligned_de...
  • /camera/realsense2_camera/aligned_depth_to_fisheye1_frame_id: camera_aligned_de...
  • /camera/realsense2_camera/aligned_depth_to_fisheye2_frame_id: camera_aligned_de...
  • /camera/realsense2_camera/aligned_depth_to_fisheye_frame_id: camera_aligned_de...
  • /camera/realsense2_camera/aligned_depth_to_infra1_frame_id: camera_aligned_de...
  • /camera/realsense2_camera/aligned_depth_to_infra2_frame_id: camera_aligned_de...
  • /camera/realsense2_camera/allow_no_texture_points: False
  • /camera/realsense2_camera/base_frame_id: camera_link
  • /camera/realsense2_camera/calib_odom_file:
  • /camera/realsense2_camera/clip_distance: -2.0
  • /camera/realsense2_camera/color_fps: -1
  • /camera/realsense2_camera/color_frame_id: camera_color_frame
  • /camera/realsense2_camera/color_height: -1
  • /camera/realsense2_camera/color_optical_frame_id: camera_color_opti...
  • /camera/realsense2_camera/color_width: -1
  • /camera/realsense2_camera/confidence_fps: -1
  • /camera/realsense2_camera/confidence_height: -1
  • /camera/realsense2_camera/confidence_width: -1
  • /camera/realsense2_camera/depth_fps: -1
  • /camera/realsense2_camera/depth_frame_id: camera_depth_frame
  • /camera/realsense2_camera/depth_height: -1
  • /camera/realsense2_camera/depth_optical_frame_id: camera_depth_opti...
  • /camera/realsense2_camera/depth_width: -1
  • /camera/realsense2_camera/device_type:
  • /camera/realsense2_camera/enable_accel: True
  • /camera/realsense2_camera/enable_color: True
  • /camera/realsense2_camera/enable_confidence: True
  • /camera/realsense2_camera/enable_depth: True
  • /camera/realsense2_camera/enable_fisheye1: False
  • /camera/realsense2_camera/enable_fisheye2: False
  • /camera/realsense2_camera/enable_fisheye: False
  • /camera/realsense2_camera/enable_gyro: True
  • /camera/realsense2_camera/enable_infra1: False
  • /camera/realsense2_camera/enable_infra2: False
  • /camera/realsense2_camera/enable_infra: False
  • /camera/realsense2_camera/enable_pointcloud: False
  • /camera/realsense2_camera/enable_pose: False
  • /camera/realsense2_camera/enable_sync: False
  • /camera/realsense2_camera/filters:
  • /camera/realsense2_camera/fisheye1_frame_id: camera_fisheye1_f...
  • /camera/realsense2_camera/fisheye1_optical_frame_id: camera_fisheye1_o...
  • /camera/realsense2_camera/fisheye2_frame_id: camera_fisheye2_f...
  • /camera/realsense2_camera/fisheye2_optical_frame_id: camera_fisheye2_o...
  • /camera/realsense2_camera/fisheye_fps: -1
  • /camera/realsense2_camera/fisheye_frame_id: camera_fisheye_frame
  • /camera/realsense2_camera/fisheye_height: -1
  • /camera/realsense2_camera/fisheye_optical_frame_id: camera_fisheye_op...
  • /camera/realsense2_camera/fisheye_width: -1
  • /camera/realsense2_camera/gyro_fps: -1
  • /camera/realsense2_camera/gyro_frame_id: camera_gyro_frame
  • /camera/realsense2_camera/gyro_optical_frame_id: camera_gyro_optic...
  • /camera/realsense2_camera/imu_optical_frame_id: camera_imu_optica...
  • /camera/realsense2_camera/infra1_frame_id: camera_infra1_frame
  • /camera/realsense2_camera/infra1_optical_frame_id: camera_infra1_opt...
  • /camera/realsense2_camera/infra2_frame_id: camera_infra2_frame
  • /camera/realsense2_camera/infra2_optical_frame_id: camera_infra2_opt...
  • /camera/realsense2_camera/infra_fps: 30
  • /camera/realsense2_camera/infra_height: 480
  • /camera/realsense2_camera/infra_rgb: False
  • /camera/realsense2_camera/infra_width: 848
  • /camera/realsense2_camera/initial_reset: True
  • /camera/realsense2_camera/json_file_path:
  • /camera/realsense2_camera/linear_accel_cov: 0.01
  • /camera/realsense2_camera/odom_frame_id: camera_odom_frame
  • /camera/realsense2_camera/ordered_pc: False
  • /camera/realsense2_camera/pointcloud_texture_index: 0
  • /camera/realsense2_camera/pointcloud_texture_stream: RS2_STREAM_COLOR
  • /camera/realsense2_camera/pose_frame_id: camera_pose_frame
  • /camera/realsense2_camera/pose_optical_frame_id: camera_pose_optic...
  • /camera/realsense2_camera/publish_odom_tf: True
  • /camera/realsense2_camera/publish_tf: True
  • /camera/realsense2_camera/rosbag_filename:
  • /camera/realsense2_camera/serial_no:
  • /camera/realsense2_camera/stereo_module/exposure/1: 7500
  • /camera/realsense2_camera/stereo_module/exposure/2: 1
  • /camera/realsense2_camera/stereo_module/gain/1: 16
  • /camera/realsense2_camera/stereo_module/gain/2: 16
  • /camera/realsense2_camera/tf_publish_rate: 0.0
  • /camera/realsense2_camera/topic_odom_in: odom_in
  • /camera/realsense2_camera/unite_imu_method:
  • /camera/realsense2_camera/usb_port_id:
  • /rosdistro: melodic
  • /rosversion: 1.14.12

NODES /camera/ realsense2_camera (nodelet/nodelet) realsense2_camera_manager (nodelet/nodelet)

ROS_MASTER_URI=http://localhost:11311

process[camera/realsense2_camera_manager-1]: started with pid [29386] process[camera/realsense2_camera-2]: started with pid [29387] [ INFO] [1647294422.523275584]: Initializing nodelet with 6 worker threads. [ INFO] [1647294423.678597988]: RealSense ROS v2.3.1 [ INFO] [1647294423.678779846]: Built with LibRealSense v2.50.0 [ INFO] [1647294423.678914439]: Running with LibRealSense v2.50.0 [ INFO] [1647294423.771719450]:
[ INFO] [1647294424.230753920]: Device with serial number 112222071473 was found.

[ INFO] [1647294424.231806540]: Device with physical ID 2-3.4-9 was found. [ INFO] [1647294424.231934605]: Device with name Intel RealSense D435I was found. [ INFO] [1647294424.235749623]: Device with port number 2-3.4 was found. [ INFO] [1647294424.235953593]: Device USB type: 3.2 [ INFO] [1647294424.236074938]: Resetting device... [ INFO] [1647294430.359496021]:
[ INFO] [1647294430.822033030]: Device with serial number 112222071473 was found.

[ INFO] [1647294430.822330634]: Device with physical ID 2-3.4-9 was found. [ INFO] [1647294430.822499883]: Device with name Intel RealSense D435I was found. [ INFO] [1647294430.824373184]: Device with port number 2-3.4 was found. [ INFO] [1647294430.824563170]: Device USB type: 3.2 [ INFO] [1647294430.837550895]: getParameters... [ INFO] [1647294431.229244445]: setupDevice... [ INFO] [1647294431.229414143]: JSON file is not provided [ INFO] [1647294431.229533056]: ROS Node Namespace: camera [ INFO] [1647294431.229612577]: Device Name: Intel RealSense D435I [ INFO] [1647294431.229687842]: Device Serial No: 112222071473 [ INFO] [1647294431.229754723]: Device physical port: 2-3.4-9 [ INFO] [1647294431.229820195]: Device FW version: 05.12.07.150 [ INFO] [1647294431.229926149]: Device Product ID: 0x0B3A [ INFO] [1647294431.229996901]: Enable PointCloud: Off [ INFO] [1647294431.230116295]: Align Depth: Off [ INFO] [1647294431.230271976]: Sync Mode: Off [ INFO] [1647294431.230442346]: Device Sensors: [ INFO] [1647294431.337285271]: Stereo Module was found. [ INFO] [1647294431.399844481]: RGB Camera was found. [ INFO] [1647294431.400555785]: Motion Module was found. [ INFO] [1647294431.400777899]: (Confidence, 0) sensor isn't supported by current device! -- Skipping... [ INFO] [1647294431.400888268]: num_filters: 0 [ INFO] [1647294431.401001582]: Setting Dynamic reconfig parameters. [ INFO] [1647294435.216656659]: Done Setting Dynamic reconfig parameters. [ INFO] [1647294435.219085454]: depth stream is enabled - width: 848, height: 480, fps: 30, Format: Z16 [ INFO] [1647294435.223300252]: color stream is enabled - width: 1280, height: 720, fps: 30, Format: RGB8 [ INFO] [1647294435.223569599]: gyro stream is enabled - fps: 200 [ INFO] [1647294435.223695648]: accel stream is enabled - fps: 63 [ INFO] [1647294435.223804097]: setupPublishers... [ INFO] [1647294435.238977319]: Expected frequency for depth = 30.00000 [ INFO] [1647294435.257944886]: Expected frequency for color = 30.00000 [ INFO] [1647294435.275460149]: setupStreams... [ INFO] [1647294435.362750221]: insert Depth to Stereo Module [ INFO] [1647294435.363043248]: insert Color to RGB Camera [ INFO] [1647294435.363320467]: insert Gyro to Motion Module [ INFO] [1647294435.363599670]: insert Accel to Motion Module 14/03 17:47:15,444 WARNING [546834882944] (ds5-motion.cpp:473) IMU Calibration is not available, default intrinsic and extrinsic will be used. [ INFO] [1647294439.069469220]: SELECTED BASE:Depth, 0 [ INFO] [1647294439.143410603]: RealSense Node Is Up! [ WARN] [1647294439.190424940]: 14/03 17:47:19,191 WARNING [546391974272] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11 14/03 17:47:19,242 WARNING [546391974272] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11 14/03 17:47:19,394 WARNING [546391974272] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11 14/03 17:47:19,446 WARNING [546391974272] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11 14/03 17:47:19,496 WARNING [546391974272] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11 14/03 17:47:19,547 WARNING [546391974272] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11 14/03 17:47:19,597 WARNING [546391974272] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11 14/03 17:47:19,649 WARNING [546391974272] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11 14/03 17:48:41,679 WARNING [546391974272] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11 14/03 17:52:08,920 WARNING [546391974272] (messenger-libusb.cpp:42) control_transfer returned error, index: 768, error: Resource temporarily unavailable, number: 11

zbreit avatar Mar 14 '22 21:03 zbreit

There is a version mismatch between librealsense and the ROS wrapper. SDK 2.50.0 should be matched with wrapper 2.3.2 as the 2.3.1 wrapper is designed for use with SDK 2.48.0.

It is also worth bearing in mind that (a) librealsense should be built first and the ROS wrapper second, and (b) if you change the librealsense version then the ROS wrapper has to be built again afterwards.

MartyG-RealSense avatar Mar 14 '22 22:03 MartyG-RealSense

Aaah, you are right, but I don't know how to correct this issue. To summarize my steps so far:

  1. I installed [email protected] over apt.
  2. I downloaded the ros-realsense2-camera git repo, checked out the tag 2.3.1, and tried building with catkin.

I thought this would all work out, but it appears that during during step 2, I installed ros-melodic-librealsense2 accidentally with the following command:

~/catkin_ws $ rosdep install --from-paths src --ignore-src -r -y
executing command [sudo -H apt-get install -y ros-melodic-librealsense2]
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  at ros-melodic-ddynamic-reconfigure
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
  ros-melodic-librealsense2
0 upgraded, 1 newly installed, 0 to remove and 14 not upgraded.
Need to get 0 B/12.5 MB of archives.
After this operation, 36.1 MB of additional disk space will be used.
Selecting previously unselected package ros-melodic-librealsense2.
(Reading database ... 216832 files and directories currently installed.)
Preparing to unpack .../ros-melodic-librealsense2_2.50.0-1bionic.20211115.142954_arm64.deb ...
Unpacking ros-melodic-librealsense2 (2.50.0-1bionic.20211115.142954) ...
Setting up ros-melodic-librealsense2 (2.50.0-1bionic.20211115.142954) ...
Processing triggers for libc-bin (2.27-3ubuntu1.5) ...
#All required rosdeps installed successfully

So it appears that [email protected] is incorrectly installed by rosdep even when I was checked out to [email protected] in the git repo. If I want to get [email protected], what do I have to do?

zbreit avatar Mar 16 '22 19:03 zbreit

Can you test whether the command below uninstalls your package installation of the wrapper, please.

sudo apt-get remove ros-melodic-realsense2-camera

You could then try building ROS wrapper 2.3.1 from source code using the wrapper's Method 2 installation procedure.

https://github.com/IntelRealSense/realsense-ros/releases/tag/2.3.1

If you installed librealsense from packages and feel that you need to uninstall it then all librealsense related packages can be uninstalled with the command below.

dpkg -l | grep "realsense" | cut -d " " -f 3 | xargs sudo dpkg --purge

MartyG-RealSense avatar Mar 16 '22 20:03 MartyG-RealSense

Here is the output of the command:

$ sudo apt-get remove ros-melodic-realsense2-camera
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'ros-melodic-realsense2-camera' is not installed, so not removed
The following packages were automatically installed and are no longer required:
  at ros-melodic-ddynamic-reconfigure
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 14 not upgraded.

I have been trying to build the ROS wrapper from source, but it doesn't seem to like that I've installed [email protected] using apt.

zbreit avatar Mar 16 '22 20:03 zbreit

When installing the wrapper from source, it should not be affected by how librealsense was installed (by apt or by source code).

When installing librealsense from packages on Jetson, you should ideally be doing so either by using the package instructions on Intel's Jetson installation page or with the JetsonHacks installLibrealsense.sh script.

Intel Jetson installation instructions https://github.com/IntelRealSense/librealsense/blob/master/doc/installation_jetson.md#4-install-with-debian-packages

JetsonHacks https://github.com/JetsonHacksNano/installLibrealsense

Note about the above link that if you build librealsense from packages with installLibrealsense.sh then you should not then build from source code with the buildLibrealsense.sh script.

If you want to build from source code with the JetsonHacks method, use buildLibrealsense.sh instead of installLibrealsense.sh

MartyG-RealSense avatar Mar 16 '22 21:03 MartyG-RealSense

I'll give these a shot, thanks.

zbreit avatar Mar 16 '22 21:03 zbreit

I found the issue! I was missing librealsense2-dev, which prevented rosdep from detecting that I already had librealsense2 installed. I've modified my commands above to fix the issue.

Now, I correctly see data on the /camera/gyro/sample and the /camera/accel/sample topics.

zbreit avatar Mar 17 '22 22:03 zbreit

That's excellent news, @zbreit - thanks very much for the update about your success :)

MartyG-RealSense avatar Mar 17 '22 22:03 MartyG-RealSense

Hi @zbreit Do you require further assistance with this case, please? Thanks!

MartyG-RealSense avatar Mar 23 '22 07:03 MartyG-RealSense

Nope, I am all set. Thanks for the assistance! I can close this issue if you want.

zbreit avatar Mar 23 '22 15:03 zbreit

Thanks very much @zbreit for the update! If you are satisfied with the outcome of this case then please do feel free to close it. Thanks again!

MartyG-RealSense avatar Mar 23 '22 15:03 MartyG-RealSense