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

l515 fails to start #1293

Closed
ramilmsh opened this issue Jul 17, 2020 · 17 comments
Closed

l515 fails to start #1293

ramilmsh opened this issue Jul 17, 2020 · 17 comments
Labels

Comments

@ramilmsh
Copy link

ramilmsh commented Jul 17, 2020

I've built libreasense (f7cdf6e), realsense_ros (a25ea06) and ddynamic_reconfigure (0481332a3e4dceff458c202657f64c6b44224eb5) with catkin build on ubuntu gnome 16.04.

I am trying to test l515 camera and I am not sure how to do that properly.

I tried to do roslaunch realsense2_camera rs_camera.launch and it failed with the following message:

SUMMARY
========

PARAMETERS
 * /camera/realsense2_camera/accel_fps: 250
 * /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: 30
 * /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/depth_fps: 30
 * /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_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: 30
 * /camera/realsense2_camera/fisheye_frame_id: camera_fisheye_frame
 * /camera/realsense2_camera/fisheye_height: 480
 * /camera/realsense2_camera/fisheye_optical_frame_id: camera_fisheye_op...
 * /camera/realsense2_camera/fisheye_width: 640
 * /camera/realsense2_camera/gyro_fps: 400
 * /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_width: 640
 * /camera/realsense2_camera/initial_reset: False
 * /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/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/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: kinetic
 * /rosversion: 1.12.12

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

auto-starting new master
process[master]: started with pid [32267]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 453ea012-c806-11ea-bb25-6045cba6d4c9
process[rosout-1]: started with pid [32280]
started core service [/rosout]
process[camera/realsense2_camera_manager-2]: started with pid [32297]
process[camera/realsense2_camera-3]: started with pid [32298]
[ INFO] [1594973985.115231597]: Initializing nodelet with 8 worker threads.
[ INFO] [1594973985.262471325]: RealSense ROS v2.2.15
[ INFO] [1594973985.262492045]: Built with LibRealSense v2.36.0
[ INFO] [1594973985.262501375]: Running with LibRealSense v2.36.0
[ INFO] [1594973985.272127214]:  
[ INFO] [1594973985.368550052]: Device with serial number 00000000f0140571 was found.

[ INFO] [1594973985.368619829]: Device with physical ID /sys/devices/pci0000:00/0000:00:14.0/usb2/2-3/2-3:1.0/video4linux/video2 was found.
[ INFO] [1594973985.368655759]: Device with name Intel RealSense L515 was found.
[ INFO] [1594973985.369671230]: Device with port number 2-3 was found.
[ INFO] [1594973985.377239676]: getParameters...
[ INFO] [1594973985.526126909]: setupDevice...
[ INFO] [1594973985.526186872]: JSON file is not provided
[ INFO] [1594973985.526217698]: ROS Node Namespace: camera
[ INFO] [1594973985.526254352]: Device Name: Intel RealSense L515
[ INFO] [1594973985.526274428]: Device Serial No: 00000000f0140571
[ INFO] [1594973985.526298089]: Device physical port: /sys/devices/pci0000:00/0000:00:14.0/usb2/2-3/2-3:1.0/video4linux/video2
[ INFO] [1594973985.526322980]: Device FW version: 01.04.01.02
[ INFO] [1594973985.526342452]: Device Product ID: 0x0B64
[ INFO] [1594973985.526362723]: Enable PointCloud: Off
[ INFO] [1594973985.526383246]: Align Depth: Off
[ INFO] [1594973985.526403715]: Sync Mode: Off
[ INFO] [1594973985.526522738]: Device Sensors: 
 17/07 13:19:45,528 WARNING [139898572363520] (backend-v4l2.cpp:1223) Pixel format 20202043-0000-0010-8000-00aa003 likely requires patch for fourcc code C   !
[ INFO] [1594973985.532414370]: L500 Depth Sensor was found.
[ INFO] [1594973985.537559566]: RGB Camera was found.
[ INFO] [1594973985.538821560]: Motion Module was found.
[ INFO] [1594973985.538874310]: num_filters: 0
[ INFO] [1594973985.538894866]: Setting Dynamic reconfig parameters.
nodelet: /path/to/l515/src/librealsense/src/types.cpp:179: const char* librealsense::get_string(rs2_sensor_mode): Assertion `!is_valid(value)' failed.
@jmiseikis
Copy link

You can use the following launch file to start it. The main thing is to set correct resolutions for depth and color cams in the launch file.

<launch>
  <arg name="serial_no"           default=""/>
  <arg name="usb_port_id"         default=""/>
  <arg name="device_type"         default=""/>
  <arg name="json_file_path"      default=""/>
  <arg name="camera"              default="l515"/>
  <arg name="tf_prefix"           default="$(arg camera)"/>
  <arg name="external_manager"    default="false"/>
  <arg name="manager"             default="realsense2_camera_manager"/>

  <arg name="fisheye_width"       default="1280"/>
  <arg name="fisheye_height"      default="720"/>
  <arg name="enable_fisheye"      default="false"/>

  <arg name="depth_width"         default="1024"/>
  <arg name="depth_height"        default="768"/>
  <arg name="enable_depth"        default="true"/>

  <arg name="infra_width"        default="1280"/>
  <arg name="infra_height"       default="720"/>
  <arg name="enable_infra1"       default="false"/>
  <arg name="enable_infra2"       default="false"/>

  <arg name="color_width"         default="1920"/>
  <arg name="color_height"        default="1080"/>
  <arg name="enable_color"        default="true"/>

  <arg name="fisheye_fps"         default="30"/>
  <arg name="depth_fps"           default="30"/>
  <arg name="infra_fps"           default="30"/>
  <arg name="color_fps"           default="30"/>
  <arg name="gyro_fps"            default="400"/>
  <arg name="accel_fps"           default="250"/>
  <arg name="enable_gyro"         default="false"/>
  <arg name="enable_accel"        default="false"/>

  <arg name="enable_pointcloud"         default="false"/>
  <arg name="pointcloud_texture_stream" default="RS2_STREAM_COLOR"/>
  <arg name="pointcloud_texture_index"  default="0"/>

  <arg name="enable_sync"               default="false"/>
  <arg name="align_depth"               default="true"/>

  <arg name="publish_tf"                default="true"/>
  <arg name="tf_publish_rate"           default="0"/>

  <arg name="filters"                   default=""/>
  <arg name="clip_distance"             default="-2"/>
  <arg name="linear_accel_cov"          default="0.01"/>
  <arg name="initial_reset"             default="false"/>
  <arg name="unite_imu_method"          default=""/>
  <arg name="topic_odom_in"             default="odom_in"/>
  <arg name="calib_odom_file"           default=""/>
  <arg name="publish_odom_tf"           default="true"/>
  <arg name="allow_no_texture_points"   default="false"/>

  <group ns="$(arg camera)">
    <include file="$(find realsense2_camera)/launch/includes/nodelet.launch.xml">
      <arg name="tf_prefix"                value="$(arg tf_prefix)"/>
      <arg name="external_manager"         value="$(arg external_manager)"/>
      <arg name="manager"                  value="$(arg manager)"/>
      <arg name="serial_no"                value="$(arg serial_no)"/>
      <arg name="usb_port_id"              value="$(arg usb_port_id)"/>
      <arg name="device_type"              value="$(arg device_type)"/>
      <arg name="json_file_path"           value="$(arg json_file_path)"/>

      <arg name="enable_pointcloud"        value="$(arg enable_pointcloud)"/>
      <arg name="pointcloud_texture_stream" value="$(arg pointcloud_texture_stream)"/>
      <arg name="pointcloud_texture_index"  value="$(arg pointcloud_texture_index)"/>
      <arg name="enable_sync"              value="$(arg enable_sync)"/>
      <arg name="align_depth"              value="$(arg align_depth)"/>

      <arg name="fisheye_width"            value="$(arg fisheye_width)"/>
      <arg name="fisheye_height"           value="$(arg fisheye_height)"/>
      <arg name="enable_fisheye"           value="$(arg enable_fisheye)"/>

      <arg name="depth_width"              value="$(arg depth_width)"/>
      <arg name="depth_height"             value="$(arg depth_height)"/>
      <arg name="enable_depth"             value="$(arg enable_depth)"/>

      <arg name="color_width"              value="$(arg color_width)"/>
      <arg name="color_height"             value="$(arg color_height)"/>
      <arg name="enable_color"             value="$(arg enable_color)"/>

      <arg name="infra_width"              value="$(arg infra_width)"/>
      <arg name="infra_height"             value="$(arg infra_height)"/>
      <arg name="enable_infra1"            value="$(arg enable_infra1)"/>
      <arg name="enable_infra2"            value="$(arg enable_infra2)"/>

      <arg name="fisheye_fps"              value="$(arg fisheye_fps)"/>
      <arg name="depth_fps"                value="$(arg depth_fps)"/>
      <arg name="infra_fps"                value="$(arg infra_fps)"/>
      <arg name="color_fps"                value="$(arg color_fps)"/>
      <arg name="gyro_fps"                 value="$(arg gyro_fps)"/>
      <arg name="accel_fps"                value="$(arg accel_fps)"/>
      <arg name="enable_gyro"              value="$(arg enable_gyro)"/>
      <arg name="enable_accel"             value="$(arg enable_accel)"/>

      <arg name="publish_tf"               value="$(arg publish_tf)"/>
      <arg name="tf_publish_rate"          value="$(arg tf_publish_rate)"/>

      <arg name="filters"                  value="$(arg filters)"/>
      <arg name="clip_distance"            value="$(arg clip_distance)"/>
      <arg name="linear_accel_cov"         value="$(arg linear_accel_cov)"/>
      <arg name="initial_reset"            value="$(arg initial_reset)"/>
      <arg name="unite_imu_method"         value="$(arg unite_imu_method)"/>
      <arg name="topic_odom_in"            value="$(arg topic_odom_in)"/>
      <arg name="calib_odom_file"          value="$(arg calib_odom_file)"/>
      <arg name="publish_odom_tf"          value="$(arg publish_odom_tf)"/>
      <arg name="allow_no_texture_points"  value="$(arg allow_no_texture_points)"/>
    </include>
  </group>
</launch>

@nkhedekar
Copy link

Just as an additional point of reference, have a look at #1246

@RealSenseSupport
Copy link
Collaborator

Hi @ramilmsh - Were you able to get things going?

*If we don’t hear from you in 7 days, this issue will be closed.

@ramilmsh
Copy link
Author

@RealSenseCustomerSupport no, I have not. I keep getting the same error. I will be happy to provide any additional information about my set up

@doronhi
Copy link
Contributor

doronhi commented Jul 27, 2020

If the camera is connected as a usb2.0 device it may explain the error. Can you make sure you are connected as a USB3 device? Check with realsense-viewer if you can.

@ramilmsh
Copy link
Author

@doronhi yeah, it's working over usb 3.1, according to realsense viewer

@randomblbl
Copy link

randomblbl commented Jul 28, 2020

I have the same problem, L515 is connected as USB3.2 device. Is there any solution?
BTW, I am using the latest SDK and latest ROS github.

@doterkuile
Copy link

I also encountered the same problem and I think it may be caused by some new commits in librealsense ( 81cffa8 & 10e402a ). In this commit the enum RS2_OPTION_SENSOR_MODE gets an extra option QVGA. I am not sure how but somewhere the enum options get mixed up and i think this causes the error in the librealsense. I found a fix by changing line 1258 of model-views.cpp from

if (res >= RS2_SENSOR_MODE_VGA && res < RS2_SENSOR_MODE_COUNT)
to:

if (res >= RS2_SENSOR_MODE_XGA && res < RS2_SENSOR_MODE_COUNT)

By doing this it rs_camera.launch worked for me although I cannot explain exactly why and it is only a quick fix, but maybe this helps figuring out the exact issue.

@randomblbl
Copy link

I also encountered the same problem and I think it may be caused by some new commits in librealsense ( 81cffa8 & 10e402a ). In this commit the enum RS2_OPTION_SENSOR_MODE gets an extra option QVGA. I am not sure how but somewhere the enum options get mixed up and i think this causes the error in the librealsense. I found a fix by changing line 1258 of model-views.cpp from

if (res >= RS2_SENSOR_MODE_VGA && res < RS2_SENSOR_MODE_COUNT)
to:

if (res >= RS2_SENSOR_MODE_XGA && res < RS2_SENSOR_MODE_COUNT)

By doing this it rs_camera.launch worked for me although I cannot explain exactly why and it is only a quick fix, but maybe this helps figuring out the exact issue.

It's not working. The enum is defined as follow. It does not make sense change RS2_SENSOR_MODE_VGA to RS2_SENSOR_MODE_XGA in line 1258 of model-views.cpp

typedef enum rs2_sensor_mode
{
RS2_SENSOR_MODE_VGA,
RS2_SENSOR_MODE_XGA,
RS2_SENSOR_MODE_QVGA,
RS2_SENSOR_MODE_COUNT /**< Number of enumeration values. Not a valid input: intended to be used in for-loops. */
} rs2_sensor_mode;

@doterkuile
Copy link

Ah yes, sorry I forgot to mention to change the order of the enum as well:

typedef enum rs2_sensor_mode
{
RS2_SENSOR_MODE_QVGA,
RS2_SENSOR_MODE_VGA,
RS2_SENSOR_MODE_XGA,
RS2_SENSOR_MODE_COUNT /**< Number of enumeration values. Not a valid input: intended to be used in for-loops. */
} rs2_sensor_mode;

@randomblbl
Copy link

randomblbl commented Jul 30, 2020

Ah yes, sorry I forgot to mention to change the order of the enum as well:

typedef enum rs2_sensor_mode
{
RS2_SENSOR_MODE_QVGA,
RS2_SENSOR_MODE_VGA,
RS2_SENSOR_MODE_XGA,
RS2_SENSOR_MODE_COUNT /**< Number of enumeration values. Not a valid input: intended to be used in for-loops. */
} rs2_sensor_mode;

It works for me. Thanks for sharing the solution.

To summarize @doronhi ' s solution:

  • In "librealsense/include/librealsense2/h/rs_option.h", change definition of rs2_sensor_mode (starting line 151) to
    typedef enum rs2_sensor_mode
    {
    RS2_SENSOR_MODE_QVGA,
    RS2_SENSOR_MODE_VGA,
    RS2_SENSOR_MODE_XGA,
    RS2_SENSOR_MODE_COUNT /**< Number of enumeration values. Not a valid input: intended to be used in for-loops. */
    } rs2_sensor_mode;

  • In "librealsense/common/model-views.cpp", change line 1258, from
    if (res >= RS2_SENSOR_MODE_VGA && res < RS2_SENSOR_MODE_COUNT)
    to
    if (res >= RS2_SENSOR_MODE_XGA && res < RS2_SENSOR_MODE_COUNT)

Then, in "librealsense/build" folder run

  • make && sudo make install

The problem will be resolved.

@ramilmsh
Copy link
Author

ramilmsh commented Aug 3, 2020

@doronhi I will change it locally for testing purposes, but, would you mind making a PR?

@doronhi
Copy link
Contributor

doronhi commented Aug 3, 2020

First of all, thanks for the credit but it was not my solution. Thank @doterkuile and @randomblbl for their work and investigation :)
The problem I am having is that I cannot reproduce this with a USB3.2 connection.
What firmware is installed on your L515? You mentioned Ubuntu16.04 but on what machine and what kernel (uname -r)?

@Nir-Az
Copy link
Collaborator

Nir-Az commented Aug 3, 2020

Hi all,
I am not sure how this flow raised this exception but it seems to be related to QVGA resolution like mentioned above.
QVGA resolution was added for future use and it is not supported currently in libRealSense (The reason it was added as the last Enum value before count value was for not breaking the API).

a relevant bug was fixed recently (for another reason but fixed a lot of issues with the RS Enums) and I believe it is the root of the issue.
Please see c97f43fe
and PR7007

This fix will be included in the next release.

If you can try undoing the changes you made and apply the commit change I attached it will help us understand if the issue is fixed or something else is hiding over there.

Thanks.

@blakely3dnm
Copy link

Will the QVGA option increase the confidence at a given range?

@doterkuile
Copy link

@doronhi

I use Ubuntu 18.04 on a desktop with kernel 4.15.0-72-generic. I have updated the firmware of my l515 to the latest version 01.04.01.02 using it with a usb3.2 connection. Hope this helps!

@RealSenseSupport
Copy link
Collaborator

Hi,

Will you be needing further help with this? If we don’t hear from you in 7 days, this issue will be closed.

Thanks

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

No branches or pull requests

9 participants