Hello, I am a newbie trying to record data from an OAK-D Pro PoE.
I want to record the stereo pair of cameras, as well as depth with at least 30fps. Additionally, I want to record the IMU data, while the color frames are of less relevance. Are there any general things I have to keep in mind?
Recording and replaying with RecordType.VIDEO works, but as far as I understand it, it is not possible to record IMU data this way.
The specific problem I have is that I don't know how to replay rosbag files in Python/I get an error when trying it, but I can view it in Foxglove Studio.
This is my code for recording, which is based on https://docs.luxonis.com/projects/sdk/en/latest/samples/recording/SDK_rosbag_record/ and seems to work.
from depthai_sdk import OakCamera, RecordType
with OakCamera() as oak:
# color = oak.create_camera('color', resolution='1080p', encode='jpeg', fps=10)
left = oak.create_camera('left', resolution='800p', encode='jpeg', fps=60)
right = oak.create_camera('right', resolution='800p', encode='jpeg', fps=60)
stereo = oak.create_stereo(left=left, right=right)
stereo.config_stereo(align=right)
imu = oak.create_imu()
imu.config_imu(report_rate=100, batch_report_threshold=5)
# DB3 / ROSBAG. ROSBAG doesn't require having ROS installed, while DB3 does.
record_components = [left.out.encoded, right.out.encoded, stereo.out.depth, imu]
oak.record(record_components, './ros_records', record_type=RecordType.ROSBAG)
# Visualize only color stream
oak.visualize(left.out.encoded, scale=1/2)
oak.start(blocking=True)
This would be my attempt to replay the streams, but I get 2 errors.
from depthai_sdk import OakCamera, RecordType
with OakCamera(replay="./ros_records/7-18443010A1C99E0F00") as oak:
left = oak.create_camera('left')
right = oak.create_camera('right')
stereo = oak.create_stereo()
oak.visualize([left, stereo], fps=True)
oak.start(blocking=True)
Traceback (most recent call last):
File "c:\Users\andreas.patuzzi\Downloads\depthai\replay.py", line 3, in <module>
with OakCamera(replay="./ros_records/7-18443010A1C99E0F00") as oak:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\andreas.patuzzi\AppData\Local\Programs\Python\Python311\Lib\site-packages\depthai_sdk\oak_camera.py", line 128, in __init__
self.replay = Replay(replay)
^^^^^^^^^^^^^^
File "C:\Users\andreas.patuzzi\AppData\Local\Programs\Python\Python311\Lib\site-packages\depthai_sdk\replay.py", line 114, in __init__
self.reader = RosbagReader(self.path)
^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Can't instantiate abstract class RosbagReader with abstract method disableStream
Sentry is attempting to send 2 pending error messages