Skip to content

Missing the key "serial_number" to find RealSence using name #2493

@sotanakamura

Description

@sotanakamura

System Info

- lerobot version: 0.4.2
- Platform: Linux-6.8.0-87-generic-x86_64-with-glibc2.35
- Python version: 3.10.12
- Huggingface Hub version: 0.35.3
- Datasets version: 4.1.1
- Numpy version: 2.2.6
- PyTorch version: 2.7.1+cu126
- Is PyTorch built with CUDA support?: True
- Cuda version: 12.6
- GPU model: NVIDIA GeForce RTX 3070 Laptop GPU
- Using GPU in script?: False

Information

  • One of the scripts in the examples/ folder of LeRobot
  • My own task or dataset (give details below)

Reproduction

Connect one RealSense and run the following script:

from lerobot.cameras.realsense import RealSenseCamera, RealSenseCameraConfig

realsense = RealSenseCamera(RealSenseCameraConfig("Intel RealSense D415"))
realsense.connect()
realsense.disconnect()

The output is as follows:

Traceback (most recent call last):
  File "/home/nakamura/git/sciurus17-lerobot/camera.py", line 3, in <module>
    realsense = RealSenseCamera(RealSenseCameraConfig("Intel RealSense D415"))
  File "/home/nakamura/git/lerobot/src/lerobot/cameras/realsense/camera_realsense.py", line 123, in __init__
    self.serial_number = self._find_serial_number_from_name(config.serial_number_or_name)
  File "/home/nakamura/git/lerobot/src/lerobot/cameras/realsense/camera_realsense.py", line 265, in _find_serial_number_from_name
    serial_number = str(found_devices[0]["serial_number"])
KeyError: 'serial_number'

Expected behavior

_find_serial_number_from_name can find RealSense using name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions