Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
H1rono committed Jul 24, 2024
1 parent 25b9406 commit 5ee1f1d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions device/camera_reader/camera_reader/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ def __init__(self):
self.publisher_ = self.create_publisher(Image, "camera_image", 10)
self.timer = self.create_timer(0.01, self.timer_callback)
param = self.declare_parameter("camera_id", 0)
id = self.get_parameter_or(param.name, param).get_parameter_value().integer_value
assert isinstance(id, int)
self.cap = cv2.VideoCapture(id)
camera_id = (
self.get_parameter_or(param.name, param).get_parameter_value().integer_value
)
assert isinstance(camera_id, int)
self.cap = cv2.VideoCapture(camera_id)
self.bridge = CvBridge()
if not self.cap.isOpened():
self.get_logger().error("Failed to open camera")
Expand Down

0 comments on commit 5ee1f1d

Please sign in to comment.