diff --git a/config/params.yaml b/config/params.yaml new file mode 100644 index 00000000..5ec51428 --- /dev/null +++ b/config/params.yaml @@ -0,0 +1,22 @@ +/**: + ros__parameters: + video_device: "/dev/video0" + framerate: 10.0 + io_method: "mmap" + frame_id: "camera" + pixel_format: "yuyv" # see usb_cam/supported_formats for list of supported formats + image_width: 2320 + image_height: 1744 + camera_name: "drone_camera" + camera_info_url: "package://usb_cam/config/camera_info.yaml" + brightness: -1 + contrast: -1 + saturation: -1 + sharpness: -1 + gain: -1 + auto_white_balance: true + white_balance: 4000 + autoexposure: true + exposure: 100 + autofocus: false + focus: -1 diff --git a/src/api_communication/api_communication/api_listener.py b/src/api_communication/api_communication/api_listener.py index 0a0b2375..807d7a86 100644 --- a/src/api_communication/api_communication/api_listener.py +++ b/src/api_communication/api_communication/api_listener.py @@ -84,7 +84,7 @@ class ApiListener(Node): async def handle_api(self): self.get_logger().info('Starting API') self.server = await websockets.serve(self.api_handler, '0.0.0.0', 9001) - self.get_logger().info('API started') + self.get_logger().info('API started on port 9001') await self.server.wait_closed() def process_image_request(self, message_json): diff --git a/src/px4_msgs b/src/px4_msgs index b64ef047..ffc3a4cd 160000 --- a/src/px4_msgs +++ b/src/px4_msgs @@ -1 +1 @@ -Subproject commit b64ef0475c1d44605688f4770899fe453d532be4 +Subproject commit ffc3a4cd578776213a444abe17d7eabf9621b266 diff --git a/websocket-client-test.py b/websocket-client-test.py new file mode 100644 index 00000000..a3ce0699 --- /dev/null +++ b/websocket-client-test.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python + +import asyncio +from websockets.sync.client import connect + +def hello(): + with connect("ws://localhost:8765") as websocket: + websocket.send("Hello world!") + message = websocket.recv() + print(f"Received: {message}") + +hello()