add 4k capture
This commit is contained in:
@@ -10,12 +10,15 @@ from datetime import datetime
|
|||||||
class CameraController(Node):
|
class CameraController(Node):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__('camera_controller')
|
super().__init__('camera_controller')
|
||||||
self.cam = cv2.VideoCapture(0)
|
self.capture = cv2.VideoCapture(0,cv2.CAP_DSHOW)
|
||||||
|
self.capture.set(cv2.CAP_PROP_FRAME_WIDTH, 4656)
|
||||||
|
self.capture.set(cv2.CAP_PROP_FRAME_HEIGHT, 3496)
|
||||||
|
|
||||||
self.get_logger().info("Camera controller started. Waiting for service call...")
|
self.get_logger().info("Camera controller started. Waiting for service call...")
|
||||||
self.srv = self.create_service(TakePicture, 'drone/picture', self.take_picture_callback)
|
self.srv = self.create_service(TakePicture, 'drone/picture', self.take_picture_callback)
|
||||||
|
|
||||||
def take_picture_callback(self, request, response):
|
def take_picture_callback(self, request, response):
|
||||||
result, image = self.cam.read()
|
result, image = self.capture.read()
|
||||||
if (result):
|
if (result):
|
||||||
if (request.input_name == "default"):
|
if (request.input_name == "default"):
|
||||||
self.get_logger().info("Taking picture with default filename")
|
self.get_logger().info("Taking picture with default filename")
|
||||||
|
|||||||
Submodule src/px4_msgs updated: ffc3a4cd57...b64ef0475c
Reference in New Issue
Block a user