-
Notifications
You must be signed in to change notification settings - Fork 2
Created realsense interface #44
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
base: main
Are you sure you want to change the base?
Conversation
schromya
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some comments for you. You will also need to meet acceptance criteria in task #41. Also remember to leave a comment on the task with the PR link and add the time you spent.
|
|
||
|
|
||
| def _capture_loop(self): | ||
| assert self._pipeline is not None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add full function comment. See software conventions
| break | ||
|
|
||
|
|
||
| def _now_ns() -> int: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add full function comment. See software conventions
|
|
||
| cur_dir = os.path.dirname(__file__) | ||
| # TODO:Update this config with the correct numbers | ||
| config_path = os.path.join(cur_dir, "config", "realsense_config.yaml") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update this yaml with the correct numbers.
| self._thread = threading.Thread(target=self._capture_loop, name="RealSenseCapture", daemon=True) | ||
| self._thread.start() | ||
|
|
||
| ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove all these .... They were placeholders
| from sensor_interface.camera.rgbd_camera import CameraIntrinsics, RGBDCameraInterface, RGBDFrame | ||
|
|
||
| try: | ||
| import pyrealsense2 as rs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add this dependency to the pyproject.toml
schromya
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These files do not run due to the following error. Please avoid submitting PRs with files that cannot run due to errors.
Exception in thread RealsenseCaptureLoop:
Traceback (most recent call last):
File "/home/mya/Desktop/github/HCI/dexterity-interface/libs/sensor_interface/sensor_interface_py/src/sensor_interface/camera/realsense_interface.py", line 292, in _capture_loop
frame = RGBDFrame(
^^^^^^^^^^
TypeError: RGBDFrame.__init__() got an unexpected keyword argument 'timestamp_ns'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
self.run()
File "/usr/lib/python3.11/threading.py", line 975, in run
self._target(*self._args, **self._kwargs)
File "/home/mya/Desktop/github/HCI/dexterity-interface/libs/sensor_interface/sensor_interface_py/src/sensor_interface/camera/realsense_interface.py", line 299, in _capture_loop
frame = RGBDFrame(color_rgb, depth_m, ts_ns)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: RGBDFrame.__init__() missing 1 required positional argument: 'frame_id'
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/home/mya/Desktop/github/HCI/dexterity-interface/libs/sensor_interface/sensor_interface_py/src/sensor_interface/camera/realsense_interface.py", line 319, in <module>
f = cam.latest()
^^^^^^^^^^^^
File "/home/mya/Desktop/github/HCI/dexterity-interface/libs/sensor_interface/sensor_interface_py/src/sensor_interface/camera/realsense_interface.py", line 236, in latest
raise RuntimeError("No frame captured yet. Did you call start() and wait briefly?")
RuntimeError: No frame captured yet. Did you call start() and wait briefly?| import argparse | ||
| import time | ||
|
|
||
| import cv2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This dependency needs to be added to pyproject.toml.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add instructions for running this file, along with arg description to sensor_interface/readme.md.
Also, this file shares a lot of overlap with the kinect equivalent. Either extract shared functionality or adjust so the same example can run either interface based off of arg passed (i.e. kinect or realsense).
Creating a realsense interface