Skip to content

cannot import name 'realsense_msgs__msg__StreamInfo' in record.py #527

@afgoo

Description

@afgoo

I am trying to use the record example from gen2-record-replay, and am getting an error: ImportError: cannot import name 'realsense_msgs__msg__StreamInfo' from 'rosbags.typesys.types' . I am trying to record depth and colour streams for later playback using this command:
python record.py -save color depth --fps 10

Oak-d PoE Pro
Python 3.11.1
depthai 2.26.0.0
depthai_sdk 1.2.3

DeprecationWarning: Use constructor taking 'UsbSpeed' instead device = stack.enter_context(dai.Device(openvino_version, device_info, usb2Mode=False)) Traceback (most recent call last): File "C:\Projects\camera tests\depthai-experiments-master\depthai-experiments-master\gen2-record-replay\record.py", line 145, in <module> run() File "C:\Projects\camera tests\depthai-experiments-master\depthai-experiments-master\gen2-record-replay\record.py", line 95, in run recording.start() # Start recording ^^^^^^^^^^^^^^^^^ File "c:\users\afgoo\AppData\local\Programs\Python\Python311\Lib\site-packages\depthai_sdk\record.py", line 135, in start self.process = Thread(target=_run, args=(self._getRecorders(), self.frame_q)) ^^^^^^^^^^^^^^^^^^^^ File "c:\users\afgoo\AppData\local\Programs\Python\Python311\Lib\site-packages\depthai_sdk\record.py", line 95, in _getRecorders recorders['depth'] = RosbagRecorder(self.path, self.device, self.getSizes()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\users\afgoo\AppData\local\Programs\Python\Python311\Lib\site-packages\depthai_sdk\recorders\rosbag_recorder.py", line 247, in __init__ self.write_streamInfo(depth=True) File "c:\users\afgoo\AppData\local\Programs\Python\Python311\Lib\site-packages\depthai_sdk\recorders\rosbag_recorder.py", line 332, in write_streamInfo from rosbags.typesys.types import realsense_msgs__msg__StreamInfo as StreamInfo ImportError: cannot import name 'realsense_msgs__msg__StreamInfo' from 'rosbags.typesys.types' (c:\users\afgoo\AppData\local\Programs\Python\Python311\Lib\site-packages\rosbags\typesys\types.py)

I have also tried installing depthai 2.17.0.0, as in the requirements. The installation failed in building the wheels, but I have managed to get it installed with python 3.8. Unfortunately, this throws different errors:

Traceback (most recent call last): File "record.py", line 145, in <module> run() File "record.py", line 95, in run recording.start() # Start recording File "C:\Users\afgoo\AppData\Local\Programs\Python\Python38\lib\site-packages\depthai_sdk\record.py", line 135, in start self.process = Thread(target=_run, args=(self._getRecorders(), self.frame_q)) File "C:\Users\afgoo\AppData\Local\Programs\Python\Python38\lib\site-packages\depthai_sdk\record.py", line 95, in _getRecorders recorders['depth'] = RosbagRecorder(self.path, self.device, self.getSizes()) File "C:\Users\afgoo\AppData\Local\Programs\Python\Python38\lib\site-packages\depthai_sdk\recorders\rosbag_recorder.py", line 233, in __init__ from rosbags.typesys.types import sensor_msgs__msg__CamInfo as CamInfo ImportError: cannot import name 'sensor_msgs__msg__CamInfo' from 'rosbags.typesys.types' (C:\Users\afgoo\AppData\Local\Programs\Python\Python38\lib\site-packages\rosbags\typesys\types.py)

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