IntelRealSense / realsense-ros

ROS Wrapper for Intel(R) RealSense(TM) Cameras
http://wiki.ros.org/RealSense
Apache License 2.0
2.56k stars 1.75k forks source link

RealSense Camera Initialization Errors: Parameter Configuration, Metadata, and Hardware Command Issues #3228

Open Angels-Ray opened 1 week ago

Angels-Ray commented 1 week ago

Required Info
Camera Model D405
Firmware Version 5.16.0.1
Operating System & Version Linux (Ubuntu 18)
Kernel Version (Linux Only) 4.9.253-tegra
Platform NVIDIA Jetson nano
Librealsense SDK Version 2.55.1
Language C/opencv/python
Segment Robot
ROS Distro melodic
RealSense ROS Wrapper Version 2.3.2

Issue Description

When launching the RealSense camera using the command roslaunch realsense2_camera rs_camera.launch, the camera has successfully initialized and is publishing data to the following topics:

However, despite the camera appearing to function normally, the following errors are still occurring:

  1. Parameter Configuration Error: The power line frequency parameter is set incorrectly, causing it to be removed from dynamic reconfigure options.

    [ WARN] [1728680053.979289847]: Param '/camera/stereo_module/power_line_frequency' has value 3 that is not in the enum { {50Hz: 1} {60Hz: 2} {Disabled: 0} }. Removing this parameter from dynamic reconfigure options.
  2. Frame Metadata Unavailable: Unable to obtain frame metadata, the system uses system time as the timestamp domain.

    [ WARN] [1728680054.352323545]: Frame metadata isn't available! (frame_timestamp_domain = RS2_TIMESTAMP_DOMAIN_SYSTEM_TIME)
  3. Hardware Command Failure: Attempt to set Region of Interest (ROI) failed during hardware command execution.

    [ERROR] [1728680054.353715211]: hwmon command 0x75( 0 1df 0 27f ) failed (response -6= Invalid parameter)

Launch File Configuration:

The rs_camera.launch file includes the following relevant parameters:

Actual Behavior:

While the camera appears to initialize and publish data to the expected topics, it encounters errors related to power line frequency setting, frame metadata, and ROI configuration.

Questions and Concerns:

  1. Why is the power line frequency parameter set to 3 when the launch file specifies 0?
  2. Is the ROI functionality disabled (enable_roi: false), and if so, why is there an attempt to set ROI parameters?
  3. Are the depth and color images being published correctly despite these errors?
  4. Could these issues affect the quality or synchronization of the depth and color data?

Ros Output:

hiwonder@JetMax:~$ roslaunch realsense2_camera rs_camera.launch
... logging to /home/hiwonder/.ros/log/3f491e00-87e0-11ef-baf9-f277850f2689/roslaunch-JetMax-20220.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://JetMax:33489/

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: 15
 * /camera/realsense2_camera/color_frame_id: camera_color_frame
 * /camera/realsense2_camera/color_height: 480
 * /camera/realsense2_camera/color_optical_frame_id: camera_color_opti...
 * /camera/realsense2_camera/color_width: 640
 * /camera/realsense2_camera/confidence_fps: -1
 * /camera/realsense2_camera/confidence_height: -1
 * /camera/realsense2_camera/confidence_width: -1
 * /camera/realsense2_camera/depth_fps: 15
 * /camera/realsense2_camera/depth_frame_id: camera_depth_frame
 * /camera/realsense2_camera/depth_height: 480
 * /camera/realsense2_camera/depth_optical_frame_id: camera_depth_opti...
 * /camera/realsense2_camera/depth_width: 640
 * /camera/realsense2_camera/device_type: 
 * /camera/realsense2_camera/enable_accel: False
 * /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: False
 * /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

WARNING: Package name "Ai_JetMax" does not follow the naming conventions. It should start with a lower case letter and only contain lower case letters, digits, underscores, and dashes.
WARNING: Package name "Sensor" does not follow the naming conventions. It should start with a lower case letter and only contain lower case letters, digits, underscores, and dashes.
process[camera/realsense2_camera_manager-1]: started with pid [20255]
process[camera/realsense2_camera-2]: started with pid [20256]
[ INFO] [1728682974.148964723]: Initializing nodelet with 4 worker threads.
[ INFO] [1728682974.660263004]: RealSense ROS v2.3.2
[ INFO] [1728682974.660554202]: Built with LibRealSense v2.55.1
[ INFO] [1728682974.660805920]: Running with LibRealSense v2.55.1
[ INFO] [1728682974.745054775]:  
[ INFO] [1728682974.790841754]: Device with serial number 419122270115 was found.

[ INFO] [1728682974.791002379]: Device with physical ID /sys/devices/70090000.xusb/usb2/2-1/2-1.2/2-1.2:1.0/video4linux/video0 was found.
[ INFO] [1728682974.791061441]: Device with name Intel RealSense D405 was found.
[ INFO] [1728682974.792309983]: Device with port number 2-1.2 was found.
[ INFO] [1728682974.792393525]: Device USB type: 3.2
[ INFO] [1728682974.792465868]: Resetting device...
[ INFO] [1728682980.815750606]:  
[ INFO] [1728682980.867495762]: Device with serial number 419122270115 was found.

[ INFO] [1728682980.867604720]: Device with physical ID /sys/devices/70090000.xusb/usb2/2-1/2-1.2/2-1.2:1.0/video4linux/video0 was found.
[ INFO] [1728682980.867650866]: Device with name Intel RealSense D405 was found.
[ INFO] [1728682980.868646856]: Device with port number 2-1.2 was found.
[ INFO] [1728682980.868756908]: Device USB type: 3.2
[ INFO] [1728682980.878253939]: getParameters...
[ INFO] [1728682981.176988262]: setupDevice...
[ INFO] [1728682981.177085814]: JSON file is not provided
[ INFO] [1728682981.177147845]: ROS Node Namespace: camera
[ INFO] [1728682981.177206178]: Device Name: Intel RealSense D405
[ INFO] [1728682981.177256803]: Device Serial No: 419122270115
[ INFO] [1728682981.177306335]: Device physical port: /sys/devices/70090000.xusb/usb2/2-1/2-1.2/2-1.2:1.0/video4linux/video0
[ INFO] [1728682981.177352897]: Device FW version: 5.16.0.1
[ INFO] [1728682981.177398678]: Device Product ID: 0x0B5B
[ INFO] [1728682981.177441439]: Enable PointCloud: Off
[ INFO] [1728682981.177485032]: Align Depth: Off
[ INFO] [1728682981.177527585]: Sync Mode: Off
[ INFO] [1728682981.177643157]: Device Sensors: 
[ INFO] [1728682981.227122324]: Stereo Module was found.
[ INFO] [1728682981.227241595]: (Confidence, 0) sensor isn't supported by current device! -- Skipping...
[ INFO] [1728682981.227335501]: num_filters: 0
[ INFO] [1728682981.227393157]: Setting Dynamic reconfig parameters.
[ WARN] [1728682981.306139512]: Param '/camera/stereo_module/power_line_frequency' has value 3 that is not in the enum { {50Hz: 1} {60Hz: 2} {Disabled: 0} }. Removing this parameter from dynamic reconfigure options.
[ INFO] [1728682981.366929512]: Done Setting Dynamic reconfig parameters.
[ INFO] [1728682981.370088991]: depth stream is enabled - width: 640, height: 480, fps: 15, Format: Z16
[ INFO] [1728682981.371901335]: color stream is enabled - width: 640, height: 480, fps: 15, Format: RGB8
[ INFO] [1728682981.372054824]: setupPublishers...
[ INFO] [1728682981.381331074]: Expected frequency for depth = 15.00000
[ INFO] [1728682981.392716126]: Expected frequency for color = 15.00000
[ INFO] [1728682981.404069512]: setupStreams...
[ INFO] [1728682981.416137012]: SELECTED BASE:Depth, 0
[ INFO] [1728682981.460267689]: RealSense Node Is Up!
[ WARN] [1728682981.599789616]: Frame metadata isn't available! (frame_timestamp_domain = RS2_TIMESTAMP_DOMAIN_SYSTEM_TIME)
 12/10 05:43:01,601 ERROR [546459083136] (rs.cpp:237) [rs2_set_region_of_interest( sensor:0x7f48020550, min_x:0, min_y:0, max_x:639, max_y:479 ) Invalid Value] hwmon command 0x75( 0 1df 0 27f ) failed (response -6= Invalid parameter)
[ERROR] [1728682981.601351803]: hwmon command 0x75( 0 1df 0 27f ) failed (response -6= Invalid parameter)
MartyG-RealSense commented 1 week ago

Hi @Angels-Ray Thanks very much for your questions.

  1. This harmless warning about the power line frequency value is often in the launch logs of RealSense ROS1 wrapper users and can be safely ignored without any consequences.

  2. I am not aware of the existence of an enable_roiparameter in the ROS1 wrapper. It is not in the default rs_camera.launch file. There are also not any parameters for setting the dimensions of a ROI in the default rs_camera.launch file.

The ROI can though be defined in the launch file by users by inserting a rosparam code block into the file, like this:

<rosparam>
/camera/stereo_module/auto_exposure_roi/left: 20
/camera/stereo_module/auto_exposure_roi/right: 200
</rosparam>

So if you wanted the dimensions to be 0, you could try inserting the above code block with the values both set to 0.

  1. Depth and color are being published at 15 FPS, yes. This is shown by two lines near the bottom of the log.
[ INFO] [1728682981.381331074]: Expected frequency for depth = 15.00000
[ INFO] [1728682981.392716126]: Expected frequency for color = 15.00000
  1. The issues that you experienced shouldn't affect quality or sync.

In regard to the frame metadata message, this can occur if the librealsense SDK was built from source code, the libuvc backend or RSUSB backend installation methods of building from source code were not used, and a patch script was not applied to the Linux kernel. Patching the kernel is what enables support for metadata.

But if librealsense is built from source code with the flags -dforce_libuvc=true or -dforce_rsusb_backend=true included in the CMake build instruction then metadata support is included in the build of librealsense and it is not necessary to apply a patch script to the kernel.

It is also not necessary to use the patch script if librealsense was installed from packages, as the patch is bundled in the packages and so using a patch script is not required.

Angels-Ray commented 1 week ago

@MartyG-RealSense Thanks so much for your detailed explanation, it’s really helpful!

When I encountered an error before, an AI tool mistakenly suggested that I add the enable_roi parameter to the rs_camera.launch file, which I now understand is not valid.

Also, I installed librealsense using the package manager. Based on the issues I’ve been facing, do you think I need to reinstall it, or should I check something else?

Thanks again for your help!

MartyG-RealSense commented 1 week ago

You are very welcome!

AI tools that generate advice by analyzing other references are useful as a quick at-a-glance guide but their suggestions aren't always accurate. So they are best used as a basis for ideas for further research rather than trusted completely.

As you have an Nvidia Jetson, if you want to build from packages then you should use the instructions on the Jetson installation instruction page at the link below. The packages on this page - librealsense2-utils and librealsense2-dev - are designed specially for Jetson.

https://github.com/intelRealSense/librealsense/blob/master/doc/installation_jetson.md#4-install-with-debian-packages

Alternatively, you could use the installLibrealsense.sh build script on the JetsonHacks website, which will install the same packages.

https://github.com/JetsonHacksNano/installLibrealsense?tab=readme-ov-file#installlibrealsensesh

Angels-Ray commented 1 week ago

Thanks a lot for the guidance! I’ll go ahead and follow the instructions to try this out.